lotus/api
Hector Sanjuan fa93c23813 Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several
problems:
  * Code does not finish cleanly and things hang on ctrl-c
  * Same block is read multiple times in a row (artificially increasing cached
    blockstore metrics to 50%)
  * It is unclear whether there are additional races (a single worker quits
    when reaching height 0)
  * CARs produced have duplicated blocks (~400k for an 80M-blocks CAR or
    so). Some blocks appear up to 5 times.
  * Using pointers for tasks where it is not necessary.

The changes:

  * Use a FIFO instead of stack: simpler implementation as its own type. This
has not proven to be much more memory-friendly, but it has not made things
worse either.
  * We avoid a probably not small amount of allocations by not using
    unnecessary pointers.
  * Fix duplicated blocks by atomically checking+adding to CID set.
  * Context-termination now works correctly. Worker lifetime is correctly tracked and all channels
  are closed, avoiding any memory leaks and deadlocks.
  * We ensure all work is finished before finishing, something that might have
  been broken in some edge cases previously. In practice, we would not have
  seen this except perhaps in very early snapshots close to genesis.

Initial testing shows the code is currently about 5% faster. Resulting
snapshots do not have duplicates so they are a bit smaller. We have manually
verified that no CID is lost versus previous results, with both old and recent
snapshots.
2023-02-14 21:08:10 +01:00
..
client gateway: eth_subscribe support 2023-01-31 10:28:12 +01:00
docgen chore: all: bump go-libipfs to replace go-block-format 2023-01-26 17:03:18 +01:00
docgen-openrpc chore: fix imports 2022-06-14 17:00:51 +02:00
mocks First efficient ranged-export implementation by @frisst 2023-02-14 15:41:10 +01:00
types feat: gateway: eth_ api support 2023-01-13 20:04:41 +01:00
v0api Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
v1api Add uuid to mpool message sent to chain node from miner 2022-08-16 15:39:06 -04:00
api_common.go feat: Add node uptime rpc / output in info command 2022-10-11 10:11:09 +02:00
api_errors.go fix: itest: check for closed connection 2022-09-27 15:34:01 +00:00
api_full.go Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
api_gateway.go Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-13 11:45:09 +00:00
api_net.go Don't use go-libp2p-core 2022-08-25 14:20:41 -04:00
api_storage.go Merge branch 'feat/nv18-fevm' into feat/nv18-events 2022-12-07 22:16:56 -08:00
api_test.go address magik supernit 2022-09-27 15:34:01 +00:00
api_wallet.go lotus-wallet: Support permissioned api 2021-05-31 13:56:35 +02:00
api_worker.go sealing: Split unsealed cleanup from Finalize 2022-11-23 18:57:16 +01:00
cbor_gen.go update markets 2022-10-06 11:06:21 -04:00
checkstatuscode_string.go implement MessagePool.CheckMessages 2021-05-07 15:30:04 +02:00
eth_aliases.go Eth JSON-RPC: implement web3_clientVersion 2023-01-24 22:56:04 -05:00
miner_subsystems.go fix docs and nits. 2021-07-28 20:03:25 +01:00
permissioned.go api: Separate the Net interface from Common 2021-07-15 11:41:30 +02:00
proxy_gen.go Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
proxy_util_test.go fix make gen 2022-08-29 16:25:30 +02:00
proxy_util.go api: Separate the Net interface from Common 2021-07-15 11:41:30 +02:00
README.md api: Add basic package readme 2021-03-25 18:00:29 +01:00
types.go Chain ranged export: rework and address current shortcomings 2023-02-14 21:08:10 +01:00
utils.go Update to specs v0.9.6 2020-09-07 15:48:41 -04:00
version.go sealing: Split unsealed cleanup from Finalize 2022-11-23 18:57:16 +01:00
wrap.go api: Fix Wrap for nested proxy structs 2021-06-28 19:00:37 +02:00

Lotus API

This package contains all lotus API definitions. Interfaces defined here are exposed as JsonRPC 2.0 endpoints by lotus programs.

Versions

File Alias File Interface Exposed by Version HTTP Endpoint Status Docs
api_common.go v0api/latest.go Common lotus; lotus-miner v0 /rpc/v0 Latest, Stable Methods
api_full.go v1api/latest.go FullNode lotus v1 /rpc/v1 Latest, Work in progress Methods
api_storage.go v0api/latest.go StorageMiner lotus-miner v0 /rpc/v0 Latest, Stable Methods
api_worker.go v0api/latest.go Worker lotus-worker v0 /rpc/v0 Latest, Stable Methods
v0api/full.go FullNode lotus v0 /rpc/v0 Stable Methods