Commit Graph

40 Commits

Author SHA1 Message Date
Steven Allen
7caaa60992 fix: exchange: explicitly cast the block message limit const (#11511)
It's not a const for the testground build, and needs to be an int 99%
of the time. So we might as well just cast here.
2023-12-09 22:32:13 +08:00
Steven Allen
f086374233 fix lints 2023-12-09 21:20:19 +08:00
Steven Allen
2b771693eb fix: exchange: allow up to 10k messages per block
Also explicitly limit how many bytes we're willing to read in one go
such that we're capable of reading a worst-case tipset (like, really,
never going to happen worst-case). Previously, this wasn't an issue.
However, we've bumped the max number of messages from 8,192 to 150,000
and need to limit allocations somewhere else.
2023-12-09 21:19:55 +08:00
Alejandro Criado-Pérez
b6a77dfafc
Fix/texts (#11298)
* documentation text corrections

* Text corrections in go files

* make docsgen-cli
2023-10-27 11:32:42 -07:00
Aayush
5e76b05b17 Merge branch 'feat/nv21' into asr/merge-feat-nv21 2023-10-16 11:13:33 -04:00
Steven Allen
c6debaadf0 make gen 2023-09-23 17:54:44 -04:00
Icarus9913
2a8ea957fa stop using go-libp2p deprecated peer.ID.Pretty
Signed-off-by: Icarus9913 <icaruswu66@qq.com>
2023-09-12 13:13:34 +08:00
hanabi1224
6b14b0536e fix: error checks 2023-01-04 20:10:21 +08:00
hanabi1224
6ae7cdab64 call Stream.CloseWrite right after writing 2022-12-16 17:22:53 +08:00
Łukasz Magiera
08b22edd89 fix make gen 2022-08-29 16:25:30 +02:00
Łukasz Magiera
2086b219d2 Don't use go-libp2p-core 2022-08-25 14:20:41 -04:00
Łukasz Magiera
05cdeb80c3 chore: remove redundant import prefixes 2022-06-15 12:06:22 +02:00
Łukasz Magiera
e65fae28de chore: fix imports 2022-06-14 17:00:51 +02:00
Aayush
789f212f6c refactor: remove old BlockSyncProtocolID 2022-06-08 13:38:56 -04:00
Jennifer Wang
5cfedacf9f make jen 2022-05-23 15:11:46 -04:00
vyzo
dd327f0b22 plumb more contexts 2021-12-17 11:42:09 +02:00
Aayush Rajasekaran
dfb65ed89f Plumb contexts through 2021-12-11 17:04:00 -05:00
Łukasz Magiera
95b128b7bc chain: Cleanup consensus logic 2021-09-02 18:09:37 +02:00
Aarsh Shah
d7076778e2
integrate DAG store and CARv2 in deal-making (#6671)
This commit removes badger from the deal-making processes, and
moves to a new architecture with the dagstore as the cental
component on the miner-side, and CARv2s on the client-side.

Every deal that has been handed off to the sealing subsystem becomes
a shard in the dagstore. Shards are mounted via the LotusMount, which
teaches the dagstore how to load the related piece when serving
retrievals.

When the miner starts the Lotus for the first time with this patch,
we will perform a one-time migration of all active deals into the
dagstore. This is a lightweight process, and it consists simply
of registering the shards in the dagstore.

Shards are backed by the unsealed copy of the piece. This is currently
a CARv1. However, the dagstore keeps CARv2 indices for all pieces, so
when it's time to acquire a shard to serve a retrieval, the unsealed
CARv1 is joined with its index (safeguarded by the dagstore), to form
a read-only blockstore, thus taking the place of the monolithic
badger.

Data transfers have been adjusted to interface directly with CARv2 files.
On inbound transfers (client retrievals, miner storage deals), we stream
the received data into a CARv2 ReadWrite blockstore. On outbound transfers
(client storage deals, miner retrievals), we serve the data off a CARv2
ReadOnly blockstore.

Client-side imports are managed by the refactored *imports.Manager
component (when not using IPFS integration). Just like it before, we use
the go-filestore library to avoid duplicating the data from the original
file in the resulting UnixFS DAG (concretely the leaves). However, the
target of those imports are what we call "ref-CARv2s": CARv2 files placed
under the `$LOTUS_PATH/imports` directory, containing the intermediate
nodes in full, and the leaves as positional references to the original file
on disk.

Client-side retrievals are placed into CARv2 files in the location:
`$LOTUS_PATH/retrievals`.

A new set of `Dagstore*` JSON-RPC operations and `lotus-miner dagstore`
subcommands have been introduced on the miner-side to inspect and manage
the dagstore.

Despite moving to a CARv2-backed system, the IPFS integration has been
respected, and it continues to be possible to make storage deals with data
held in an IPFS node, and to perform retrievals directly into an IPFS node.

NOTE: because the "staging" and "client" Badger blockstores are no longer
used, existing imports on the client will be rendered useless. On startup,
Lotus will enumerate all imports and print WARN statements on the log for
each import that needs to be reimported. These log lines contain these
messages:

- import lacks carv2 path; import will not work; please reimport
- import has missing/broken carv2; please reimport

At the end, we will print a "sanity check completed" message indicating
the count of imports found, and how many were deemed broken.

Co-authored-by: Aarsh Shah <aarshkshah1992@gmail.com>
Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>

Co-authored-by: Raúl Kripalani <raul@protocol.ai>
Co-authored-by: Dirk McCormick <dirkmdev@gmail.com>
2021-08-16 23:34:32 +01:00
Peter Rabbitson
25a77d905d Centralize everything on ipfs/go-log/v2
I am not entirely sure this is right, but everything seems to build...
2021-04-06 15:04:32 +02:00
Łukasz Magiera
26399dba70 Update markets, cbor-gen with soft map decoding 2021-02-19 20:11:43 +01:00
Ruslan Tushov
f9aca39caf
Buffered stream for chainxchg response 2020-12-25 16:03:46 +03:00
vyzo
ef444676c2 combine add and remove evts and use a single emitter
to reduce likelihood of races
2020-11-20 16:15:44 +02:00
vyzo
7aec500384 emit event for peer disconnectionsa and act upon them in the blocksync peer tracker 2020-11-20 15:58:27 +02:00
Łukasz Magiera
6742a74260
Merge pull request #4814 from filecoin-project/feat/rw-close
update libp2p for stream interface changes
2020-11-13 00:23:29 +01:00
Steven Allen
5f1737379a update libp2p for stream interface changes 2020-11-12 13:57:19 -08:00
Łukasz Magiera
9270ac6358 Make some logs quieter 2020-11-03 13:28:41 +01:00
whyrusleeping
bd0633ff90 add a command to view block space utilization 2020-10-05 14:06:03 -07:00
Aayush Rajasekaran
e09d291e5d
Merge pull request #3939 from filecoin-project/fix/chain-sync-validation
Validate chain sync response indices when fetching messages
2020-09-23 17:35:14 -04:00
Łukasz Magiera
a2278e26af
Merge pull request #3887 from filecoin-project/feat/parallel-sync
Parallel fetch for chain sync
2020-09-23 19:24:54 +02:00
Lucas Molas
dcf2735836 move validation from protocol to API 2020-09-22 20:19:31 -03:00
vyzo
5663b2d697 change GetChainMessages api to include tipsets for validation 2020-09-21 18:58:52 +03:00
vyzo
44b52941f7 add option to validate messages against expected tipset 2020-09-21 18:50:41 +03:00
vyzo
58a85f378c refactor response compressed index validation into its own function 2020-09-21 18:33:31 +03:00
Łukasz Magiera
82b95e34b7 cbor gen 2020-09-17 17:37:16 +02:00
vyzo
2a428f09e6 increase exchange ShufflePeersPrefix to 16, use that as the value of concurrent sync requests 2020-09-17 18:07:01 +03:00
vyzo
61c0b8c3db properly close streams in blocksync
we were leaking streams right and left...
2020-09-17 18:07:01 +03:00
Raúl Kripalani
b33db9c1ab Merge branch 'master' into blocksync-refactor 2020-09-08 14:22:43 +01:00
Raúl Kripalani
453e826a0f rename p2p protocol to /fil/chain/xchg/0.0.1 (backwards-compatible); rename more. 2020-09-07 19:45:34 +01:00
Raúl Kripalani
55b1456d45 blocksync: introduce interfaces; rename to chainexchange. 2020-09-07 19:31:43 +01:00