From d5544e016fe1da6dd3e5f54f33288800b8b60920 Mon Sep 17 00:00:00 2001 From: signor1 Date: Wed, 10 Sep 2025 19:57:54 +0100 Subject: [PATCH 01/34] feat(spellcheck): Unify and expand to entire repo. Consolidates tooling to use only . --- .config/forest.dic | 561 +++++++++++++++++++++++++++++++++++++++- .config/spellcheck.toml | 4 + CHANGELOG.md | 2 + 3 files changed, 553 insertions(+), 14 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index e503ebf36b94..374186fe1bf2 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,146 +1,679 @@ +0s +1h +100GiB +14GiB +51ms +60GiB +7GiB +2k 73 +Abell +abi +addr +addrs +ActorID +ActorState +algo Algorand/M +allocator +Ameen +Ansermino API/M +Api APIs +API-V1-compatible +api +approx_cmp +Archlinux args arities arity +arm64 async +Async +async-std +async_std +Asyncronous_codec +asyncverification +asynchronous_codec attoFIL +Ayush +B4 +backend +backend. +backfilling +backport +bajillion +Base-Devel +Base64 +base32 benchmark/GD +benchmarking +BigInt +BigUint bitfield +BitField +Bitfield bitswap +Bitswap +bitswap. +bitvec BLAKE2b +BlockHeader +Blockheader +BlockSync +Blocksync +blocksync blockchain/M +blockstore +Blockstore blockstore/SM +bls BLS +bls_signatures +blst +bootnodes +bootstrapper +Brickwood +BufferedBlockstore +bugfix +BuildKit butterflynet +Butterflynet +C1 +calc calibnet +Calibnet +calibnet-related calldata callee +camelCase +cancelation +cancelled canonicalization CAR/SM +cardinality CARv1/SM CARv2/SM CBOR +Cbor +cbor +cfg +ChainEpoch +ChainExchange +ChainNotify +ChainSafe +ChainSafe/M +chainsafe +ChainSafe's +ChainStore +chainstore +ChainSync +chainsync +ChainSyncer +changelog +chrono CID/SM CIDs -ChainSafe/M +cid +circ +CircleCI +CircSupply CLI -Cloudflare +cli +clippy +Clippy clonable +Cloudflare +CloudFlare codebase codec +codecov +CodeID +codeowners +commcid +computating +Config +config +configs +Connor +cov +creativ +creativcoder +Cron cron +CronEvents crypto -CurrentEpoch +cryptographic +ctrl +ctrl-c daemon daemonize +daeamon +DAGJson +DagCBOR +Dagny Datacap -devnet +datacap DB/S +de +DealProposal +Denethor +Denethor/M +Denethor's +dep +deps +deserialisation/M +Deserialization +deserialization +deserialize deserialize/D +deserializing destructuring +dev_comments +devnet +Devnet +devnets +Devops +Devs +DHT +Diátaxis +DigitalOcean DNS +Dockerfile +dockerfile +dockerfiles +Docusaurus +Drand +drand durations +dutter +ecrecover +eg EIP EIP155 +Elmattic +empty_params +Env +env enum Enum +enums EOF +Etaoin +Etaoin/M +Eth +EthCallMessage Ethereum -eth -exa +everyting EVM -f4 +exa +expirations +ExitCode +f3 F3 +F3-sidecar +f4 +F4 +F9 +F10 +F11 +F12 +F13 +F15 +F17 +F18 +F19 +F21 +F24 +F25 +F27 +F28 +fetch-params FFI FIL +fil +fil-actor-interface +fil-actor-states +fil-proofs +Filecoin Filecoin/M +filecoin +filecoin-project +filecoin-proofs-api/M +Filfox Filops +FilOz +filesystem FIP +FIP-0085 +FIPs +fmt +fn +Foldesi +forest-cli +ForestCAR +formatter +Fraccaroli +François +Friedel +FULLNODE_API_INFO +futures_cbor_codec +fuzzer FVM +Garillot GC +GetMarketState +gh +gh-pages +Gianmarco GiB +Github +github +gitignore +GossipSub +Gossipsub +gossipsub +GraphQL +GraphSync +Guillaume +Hakuna +Hakuna/M +Hamt +hamt HAMT +hardcoded +hardlink +hardlink/S hasher healthcheck +Homebrew +homebrew +hotfix +http-client +i.e. +i64 +IaC +Ijon +Ijon/M +impl +impls +Implementers +implementers implementor/SM -IPFS +indexmap +Init +init +InitActor +InternalServerError +Interop +interop +interopnet +Interopnet +interops +invariants +io ip +IPFS IPLD +Ipld +ipld +Jaden +Jemalloc +jemalloc JSON +Json +json +JSON-RPC JWT +jwt +JWTs +Kad Kademlia +keypair +KeyStore +Keystore Kubernetes +kubernetes +lazycell +len +LesnyRumcajs +LetsEncrypt +libs libp2p +LibP2P +Libp2p +libsecp256k1 +Linters +linters +Linux liveness +Liveness localhost +localhost's +lockfile +lookups +loopback +LRU +M1 +M2 +MacOS +macOS mainnet +Mainnet +Makefile +makefile +Markou +Matata +Matata/M +MdBook +mdbook MDNS +mdns mempool +Mempool Merkle +messagepool +MessageInfo +MessageParams +MessagePool +messageReceipt +MethodNum +MethodParameter +MethodParams +mh MiB middleware +migrator +migrators milliGas +Mische +Mishra +MissingMethod +MockRuntime +Mojica +MPool +Mpool +mpool +MsgPool +msgs +Mullett multiaddr/SM +multiaddress +multiaddresses +multibase multihash +multimap multisig +Multisig +mut mutex +namespace +nata +nata/M +Natanael +Neo4j +NetworkEvents +NetworkVersion +nextest +non-ascii +non-filecoin +nlprules +Nullable +NV15 +NV16 +NV17 +NV18 +NV19 +NV20 +NV21 +NV22 +NV23 +NV24 +NV25 +NV27 +nv15 +nv16 +nv17 +nv24 +nvXX +NVMe +Olivero +onwards +OOMs +Ok Open OpenRPC +orchestrator +Organisation +organisation +os +overriden overallocation P2P +p2p +Parallelize +Parametrize param/SM -ParityDb +param +params ParityDB +ParityDb parsable +PathBuf +Paych +paych +peerid +peerstores +perf performant -PoC +Pinecone pointer/SM +PoC PoSt -precommit +Pre +pre-commit +pre-compiled +pre-made +pre-migrations +preload +preloaded +progressbar +prometheus +proofs-api +protobuf +protoc +PRs +pubsub +Q4 R2 -RLP +Raj +Rajarupan +reachability/M +README +Readme +readme +ref-fvm +reflow +ReportConsensusFault +repo +repos +ResponseManager +retag +Reth +Reth-like +rle +RNG +Roadmap +roadmap +RocksDB +RocksDb +Rocksdb +rocksdb RPC +Rpc +rpc +RPC-JSON/M +Rupan +Rusqlite +rust-toolchain +rustc +rustfmt +rustup +RUSTSEC-2020-0071 +RUSTSEC-2020-0159 +RUSTSEC-2021-0130 +RUSTSEC-2022-0009 +S3-compatible +Sampanthan +sccache schema/SM schemas +schemars/M +Schoe SECP SECP256k1 +SecP256k1 +secio seekable +semver +serde +serde_bytes +serde_cbor +serde_generic_array serializable serializer/SM +serverless +SetMultimap +sha256 +shellcheck +shrdlu +Sig +sig +sighup +sigterm skippable +Songthaew +Sqlx +Stackoverflow +standardised statediff +statediffs stateful +Stateful +StateManager +StateTree +statetree +stateroots +statrs stderr stdout +Stmgr +StoragePower struct/SM +struct +structops +structs +Styleguides +styleguides +subcommand +subcommands +submitwindowedpost/M +summarization +swappiness +symlinked synchronizer +SyncBucket +SyncManager +SyncStateMachine +Syncer syscall/S +syscalls +TabItem +Taggart +TBD TCP +Teardown +Teep/M +Terraform testnet +Tichy +tide-websockets +tide-websockets-sink +TiB +TipIndex +Tipset +tipset tipset/SM +tipsetconversions +TipsetKeys tipsetkey/S +tipsets +ToCid +TokenAmount +tokio TOML +toolchain trie truthy TTY +Tuk +TukTuk +TxnIdParams +txn_id +ubuntu +unbanned uncompress +unencrypted unrepresentable untrusted +unvested URL +utf8 +utils UUID +V0 v0 +V1 v1 +V2 v2 +V3 +v3 +v4 +V5 +v5 +V7 +v6 +v9 +v10 +v11 +v12 +v14 validator/S varint +vec +Verifier verifier verifreg +Vermeulen +virtualized VM/SM +Vm +vm +Volker +VPS VRF -WebAssembly +WIP +wasm +wasmtime +WatermelonFix/M +webapp WebSocket +ws WPoStProvingPeriodDeadlines -zstd +yaml +yml +YugabyteDB +Ziegelmayer +zstd \ No newline at end of file diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index b7de9b332d93..40485a943a11 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -9,6 +9,10 @@ use_builtin = true tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=" extra_dictionaries = ["forest.dic", "en_US.dic"] +[hunspell.paths] +include = ["**/*.md"] +exclude = [] + [hunspell.quirks] transform_regex = [ # 10.7% diff --git a/CHANGELOG.md b/CHANGELOG.md index 9032eb6d7230..1e5bd8053110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ Mandatory release for calibration network node operators. It includes the NV27 _ - [#6006](https://github.com/ChainSafe/forest/issues/6006) More strict checks for the address arguments in the `forest-cli` subcommands. +- [#5958](https://github.com/ChainSafe/forest/issues/5958): Extended cargo-spellcheck coverage to include .github directory for repository-wide markdown spellchecking. + - [#5897](https://github.com/ChainSafe/forest/issues/5987) Added support for the NV27 _Golden Week_ network upgrade for devnets. - [#5897](https://github.com/ChainSafe/forest/issues/5987) Added support for the NV27 _Golden Week_ network upgrade for calibration network. The upgrade epoch is set to `3_007_294` (Wed 10 Sep 23:00:00 UTC 2025). From 1114de410be2114d21979c5586272df7f579bac7 Mon Sep 17 00:00:00 2001 From: signor1 Date: Wed, 10 Sep 2025 20:10:59 +0100 Subject: [PATCH 02/34] fix(spellcheck): updated wrong spellings --- CHANGELOG.md | 16 ++++++++-------- CONTRIBUTING.md | 2 +- .../developer_documentation/chain_index_spike.md | 2 +- .../rpc_api_compatibility.md | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5bd8053110..65d15128ca79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -629,7 +629,7 @@ improvements. Be sure to check the breaking changes before upgrading. copying them if not applicable. - [#4768](https://github.com/ChainSafe/forest/pull/4768) Moved all RPC methods - to V1 when applicabile + to V1 when applicable ### Added @@ -982,7 +982,7 @@ details. - [#4029](https://github.com/ChainSafe/forest/pull/4029) Add `forest-tool shed private-key-from-key-pair` and - `forest-tool shed key-pair-from-private-key` commands. These facilate moving + `forest-tool shed key-pair-from-private-key` commands. These facilitate moving between Forest and Lotus without losing the peer-to-peer identity. - [#4052](https://github.com/ChainSafe/forest/pull/4052) Add @@ -1770,7 +1770,7 @@ Notable updates: [#2404](https://github.com/ChainSafe/forest/issues/2404) - bitswap queries cancellation that do not respond after a period. [#2398](https://github.com/ChainSafe/forest/issues/2398) -- Forest daeamon crashing on sending bitswap requests. +- Forest daemon crashing on sending bitswap requests. [#2405](https://github.com/ChainSafe/forest/issues/2405) - Corrected counts displayed when using `forest-cli --chain sync wait`. [#2429](https://github.com/ChainSafe/forest/issues/2429) @@ -1862,7 +1862,7 @@ Notable updates: - Fat snapshots (snapshots that contain all transaction receipts since genesis) have been deprecated in favor of slim snapshots where receipts are downloaded on demand. -- All security advistory exceptions. Forest's dependencies are now free of known +- All security advisory exceptions. Forest's dependencies are now free of known vulnerabilities. ## Forest v0.4.1 (2022-10-04) @@ -1913,7 +1913,7 @@ Notable updates: - Resolve two security concerns by removing legacy code (RUSTSEC-2020-0071 and RUSTSEC-2021-0130). - Fixed Docker image and released it to GH container registry. -- Network selection (ie mainnet vs testnet) moved to a CLI flag rather than a +- Network selection (i.e. mainnet vs testnet) moved to a CLI flag rather than a compile-time flag. ## Forest v0.2.2 _alpha_ (2022-04-06) @@ -2323,7 +2323,7 @@ All initial change sets: (Eric Tu) - `4047ff5e` 3 -> 4 ([#1153](https://github.com/ChainSafe/forest/pull/1153)) (Eric Tu) -- `446bea40` Swap to asyncronous_codec and bump futures_cbor_codec +- `446bea40` Swap to asynchronous_codec and bump futures_cbor_codec ([#1163](https://github.com/ChainSafe/forest/pull/1163)) (Eric Tu) - `e4e6711b` Encrypted keystore now defaults to enabled. Warn the user if using an unencrypted keystore. @@ -2758,7 +2758,7 @@ All initial change sets: ([#783](https://github.com/ChainSafe/forest/pull/783)) (Austin Abell) - `7743da7e` Fix projection period for faults ([#784](https://github.com/ChainSafe/forest/pull/784)) (Austin Abell) -- `fb2ca2be` Build and Api Versoining +- `fb2ca2be` Build and Api Versioning ([#752](https://github.com/ChainSafe/forest/pull/752)) (Purple Hair Rust Bard) - `aa397491` Fix get_sectors_for_winning_post and cleanup ([#781](https://github.com/ChainSafe/forest/pull/781)) (Austin Abell) @@ -3453,7 +3453,7 @@ All initial change sets: ([#134](https://github.com/ChainSafe/forest/pull/134)) (Austin Abell) - `eace8d81` Storage Power Actor framework ([#129](https://github.com/ChainSafe/forest/pull/129)) (Austin Abell) -- `ede60e7b` Naive DB + Rocksdb implemenation +- `ede60e7b` Naive DB + Rocksdb implementation ([#125](https://github.com/ChainSafe/forest/pull/125)) (Gregory Markou) - `957d0529` Implement BlockHeader builder pattern ([#124](https://github.com/ChainSafe/forest/pull/124)) (Austin Abell) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7b51c843615..38efc6c27b23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,7 +112,7 @@ steps in advance to help us fix any potential bug as fast as possible. We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an +- Open a [bug report](https://github.com/ChainSafe/forest/issues/new?assignees=&labels=Type%3A+Bug&projects=&template=1-bug_report.md&title=). - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the _reproduction diff --git a/documentation/src/developer_documentation/chain_index_spike.md b/documentation/src/developer_documentation/chain_index_spike.md index b6fafa478782..f868861b799f 100644 --- a/documentation/src/developer_documentation/chain_index_spike.md +++ b/documentation/src/developer_documentation/chain_index_spike.md @@ -84,7 +84,7 @@ on how much historical state is indexed. **Question:** What are our options for Rust in this context? 1. **Rusqlite**? -2. **Sqlx** crate? In case of abtraction of the backend DB: +2. **Sqlx** crate? In case of abstraction of the backend DB: - **PostgreSQL** - **SQLite** - Other options diff --git a/documentation/src/developer_documentation/rpc_api_compatibility.md b/documentation/src/developer_documentation/rpc_api_compatibility.md index 87f86e73f7e7..1fde8bc9ba1d 100644 --- a/documentation/src/developer_documentation/rpc_api_compatibility.md +++ b/documentation/src/developer_documentation/rpc_api_compatibility.md @@ -55,7 +55,7 @@ be implemented in the foreseeable future. The `lotus-gateway` executable is a reverse-proxy that sanitizes RPC calls before they're forwarded to a Filecoin node. The `forest-tool api compare` command will fail if run against a gateway rather than directly against a node. -This means API compatiblity testing has to be done with a local node rather than +This means API compatibility testing has to be done with a local node rather than `api.node.glif.io`. ## Use `mitmproxy` From 59d7aad00a897b72fb1af275b8408a5ff70e9241 Mon Sep 17 00:00:00 2001 From: signor1 Date: Wed, 10 Sep 2025 20:31:29 +0100 Subject: [PATCH 03/34] fix(spellcheck): updated wrong words --- .config/forest.dic | 4 +--- .config/spellcheck.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 374186fe1bf2..be2a15b2675c 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -33,7 +33,6 @@ async Async async-std async_std -Asyncronous_codec asyncverification asynchronous_codec attoFIL @@ -132,7 +131,7 @@ codecov CodeID codeowners commcid -computating +computing Config config configs @@ -149,7 +148,6 @@ ctrl ctrl-c daemon daemonize -daeamon DAGJson DagCBOR Dagny diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index 40485a943a11..bae34f2bb28f 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -10,7 +10,7 @@ tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=" extra_dictionaries = ["forest.dic", "en_US.dic"] [hunspell.paths] -include = ["**/*.md"] +include = ["**/*.md", ".github/**/*.md"] exclude = [] [hunspell.quirks] From 1724ab5a8d4fd19c09ce5e260c5ea42d82da33a6 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 11 Sep 2025 10:40:23 +0100 Subject: [PATCH 04/34] fix(spellcheck): update on spellcheck.toml & Makefile to handle spellcheck on .md --- .config/spellcheck.toml | 4 ---- Makefile | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index bae34f2bb28f..b7de9b332d93 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -9,10 +9,6 @@ use_builtin = true tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=" extra_dictionaries = ["forest.dic", "en_US.dic"] -[hunspell.paths] -include = ["**/*.md", ".github/**/*.md"] -exclude = [] - [hunspell.quirks] transform_regex = [ # 10.7% diff --git a/Makefile b/Makefile index 1bcba1f4610c..3cfd8ce2a2e8 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ deny: spellcheck: cargo spellcheck --code 1 || (echo "See .config/spellcheck.md for tips"; false) + cargo spellcheck --code 1 --cfg .config/spellcheck.toml ./**/*.md || (echo "See .config/spellcheck.md for tips"; false) lint: license clean lint-clippy cargo fmt --all --check From 17e1cb7fa2c2c31d97775ea828bf051e4c1340e0 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 11 Sep 2025 11:48:57 +0100 Subject: [PATCH 05/34] fix: CI make lint-all error --- .config/forest.dic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/forest.dic b/.config/forest.dic index be2a15b2675c..942b373b82e2 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,3 +1,4 @@ +73 0s 1h 100GiB @@ -6,7 +7,6 @@ 60GiB 7GiB 2k -73 Abell abi addr From fa000355472e3cf492baa435bd9f421b4390d414 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 11 Sep 2025 12:57:50 +0100 Subject: [PATCH 06/34] fix: update forest.dic --- .config/forest.dic | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 942b373b82e2..4e6aa4fe9833 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -124,7 +124,6 @@ clippy Clippy clonable Cloudflare -CloudFlare codebase codec codecov @@ -203,7 +202,7 @@ Etaoin/M Eth EthCallMessage Ethereum -everyting +everything EVM exa expirations @@ -266,7 +265,7 @@ gh gh-pages Gianmarco GiB -Github +GitHub github gitignore GossipSub From 3856e9ce03ae0980b4245f2a16fec1611447bf6e Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 11 Sep 2025 22:03:36 +0100 Subject: [PATCH 07/34] fix(spellcheck): resolved error from 'make spellcheck' --- .config/forest.dic | 8 +++++++- docs/README.md | 2 +- f3-sidecar/README.md | 2 +- src/shim/actors/builtin/miner/mod.rs | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 4e6aa4fe9833..1a6a76c82fb8 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -199,6 +199,7 @@ enums EOF Etaoin Etaoin/M +eth Eth EthCallMessage Ethereum @@ -673,4 +674,9 @@ yaml yml YugabyteDB Ziegelmayer -zstd \ No newline at end of file +zstd +CurrentEpoch +RLP +Grafana +UI +MDX \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 276381bd1740..bd5e963c1fb8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -44,7 +44,7 @@ yarn typecheck # Validate typescript files ### Deployment -The documentation site is continuously deployed to CloudFlare Pages, triggered on every commit to `main`. [This workflow](/.github/workflows/docs-deploy.yml) defines the deployment process. +The documentation site is continuously deployed to Cloudflare Pages, triggered on every commit to `main`. [This workflow](/.github/workflows/docs-deploy.yml) defines the deployment process. ## Site Structure diff --git a/f3-sidecar/README.md b/f3-sidecar/README.md index 19739287ff16..4253224e1f5c 100644 --- a/f3-sidecar/README.md +++ b/f3-sidecar/README.md @@ -3,7 +3,7 @@ In addition to the Rust toolchain, Go toolchain is required to build the `f3-sidecar`. The Go version is specified in `go.mod`. -Follow https://go.dev/doc/install or use one of the version managers of Go. +Follow this [guide](https://go.dev/doc/install) to install or use one of the version managers of Go. (e.g. https://github.com/voidint/g?tab=readme-ov-file#installation) ### EC tests diff --git a/src/shim/actors/builtin/miner/mod.rs b/src/shim/actors/builtin/miner/mod.rs index 796c17b32ea2..9fd052ffece3 100644 --- a/src/shim/actors/builtin/miner/mod.rs +++ b/src/shim/actors/builtin/miner/mod.rs @@ -376,7 +376,7 @@ impl State { } } - /// Unclaimed funds. Actor balance - (locked funds, precommit deposit, ip requirement) Can go negative if the miner is in IP debt. + /// Unclaimed funds. Actor balance - (locked funds, pre-commit deposit, ip requirement) Can go negative if the miner is in IP debt. pub fn available_balance(&self, balance: &BigInt) -> anyhow::Result { let balance: TokenAmount = TokenAmount::from_atto(balance.clone()); let balance_v3 = from_token_v2_to_v3(&balance); From 334ccb210957ef20776e8f6881509616fd63cd91 Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Thu, 11 Sep 2025 19:37:03 +0800 Subject: [PATCH 08/34] fix(ci): ignore `eth_newBlockFilter` test in `forest-tool api test-stateful` (#6070) --- src/tool/subcommands/api_cmd/stateful_tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tool/subcommands/api_cmd/stateful_tests.rs b/src/tool/subcommands/api_cmd/stateful_tests.rs index e87a05bf165b..e1af970925e4 100644 --- a/src/tool/subcommands/api_cmd/stateful_tests.rs +++ b/src/tool/subcommands/api_cmd/stateful_tests.rs @@ -630,7 +630,9 @@ pub(super) async fn create_tests(tx: TestTransaction) -> Vec { EthUninstallFilter ), with_methods!( - eth_new_block_filter().name("eth_newBlockFilter works"), + eth_new_block_filter() + .name("eth_newBlockFilter works") + .ignore("https://github.com/ChainSafe/forest/issues/6069"), EthNewBlockFilter, EthGetFilterChanges, EthUninstallFilter From b72521fc2cd32e3f79e13dc985940dc5ad4d482a Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Thu, 11 Sep 2025 20:51:47 +0800 Subject: [PATCH 09/34] fix: remove invalid chars in prometheus metrics (#6065) --- Cargo.lock | 70 +++++++++++++++++--------------------- Cargo.toml | 1 - src/state_manager/cache.rs | 63 +++++++++++++--------------------- src/state_manager/mod.rs | 2 +- src/utils/misc/mod.rs | 2 -- src/utils/misc/type.rs | 32 ----------------- 6 files changed, 56 insertions(+), 114 deletions(-) delete mode 100644 src/utils/misc/type.rs diff --git a/Cargo.lock b/Cargo.lock index 1bab72dc3b01..c8b054e2fe47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -355,7 +355,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 1.1.1", + "rustix 1.1.2", "slab", "windows-sys 0.60.2", ] @@ -1491,15 +1491,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "convert_case" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -2111,7 +2102,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ - "convert_case 0.7.1", + "convert_case", "proc-macro2", "quote", "syn 2.0.106", @@ -3148,7 +3139,6 @@ dependencies = [ "clap_complete", "colored 3.0.0", "console-subscriber", - "convert_case 0.8.0", "criterion", "crypto_secretbox", "cs_serde_bytes", @@ -3968,7 +3958,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc257fdb4038301ce4b9cd1b3b51704509692bb3ff716a410cbd07925d9dae55" dependencies = [ - "rustix 1.1.1", + "rustix 1.1.2", "windows-targets 0.52.6", ] @@ -3995,7 +3985,7 @@ dependencies = [ "js-sys", "libc", "r-efi", - "wasi 0.14.4+wasi-0.2.4", + "wasi 0.14.5+wasi-0.2.4", "wasm-bindgen", ] @@ -5777,12 +5767,6 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - [[package]] name = "linux-raw-sys" version = "0.11.0" @@ -5953,7 +5937,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "rustix 1.1.1", + "rustix 1.1.2", ] [[package]] @@ -6050,11 +6034,11 @@ dependencies = [ [[package]] name = "miow" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "359f76430b20a79f9e20e115b3428614e654f04fab314482fc0fda0ebd3c6044" +checksum = "536bfad37a309d62069485248eeaba1e8d9853aaf951caaeaed0585a95346f08" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.61.0", ] [[package]] @@ -6917,7 +6901,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.1", + "rustix 1.1.2", "windows-sys 0.60.2", ] @@ -7895,15 +7879,14 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9621e389a110cae094269936383d69b869492f03e5c1ed2d575a53c029d4441d" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags 2.9.4", "errno", "libc", "linux-raw-sys 0.11.0", - "linux-raw-sys 0.9.4", "windows-sys 0.61.0", ] @@ -8971,21 +8954,21 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" +checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" [[package]] name = "tempfile" -version = "3.21.0" +version = "3.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.1.1", - "windows-sys 0.60.2", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] @@ -9698,9 +9681,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-properties" @@ -9866,9 +9849,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.4+wasi-0.2.4" +version = "0.14.5+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4494f6290a82f5fe584817a676a34b9d6763e8d9d18204009fb31dceca98fd4" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.0+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a" +checksum = "03fa2761397e5bd52002cd7e73110c71af2109aca4e521a9f40473fe685b0a24" dependencies = [ "wit-bindgen", ] @@ -10808,7 +10800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af3a19837351dc82ba89f8a125e22a3c475f05aba604acc023d62b2739ae2909" dependencies = [ "libc", - "rustix 1.1.1", + "rustix 1.1.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 575ea3e2c1de..a36b792aff4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ cid = { workspace = true } clap = { version = "4", features = ["derive"] } clap_complete = "4" colored = "3" -convert_case = "0.8" crypto_secretbox = "0.1" data-encoding = "2" data-encoding-macro = "0.1" diff --git a/src/state_manager/cache.rs b/src/state_manager/cache.rs index 83dd2f89ba27..108ce526b0ea 100644 --- a/src/state_manager/cache.rs +++ b/src/state_manager/cache.rs @@ -12,42 +12,24 @@ use std::pin::Pin; use std::sync::Arc; use tokio::sync::Mutex as TokioMutex; -const DEFAULT_RECEIPT_AND_EVENT_CACHE_SIZE: NonZeroUsize = nonzero!(4096usize); - struct TipsetStateCacheInner { values: SizeTrackingLruCache, pending: Vec<(TipsetKey, Arc>)>, } -impl Default for TipsetStateCacheInner { - fn default() -> Self { - Self { - values: SizeTrackingLruCache::new_with_default_metrics_registry( - Self::cache_name().into(), - DEFAULT_TIPSET_CACHE_SIZE, - ), - pending: Vec::with_capacity(8), - } - } -} - impl TipsetStateCacheInner { - pub fn with_size(cache_size: NonZeroUsize) -> Self { + pub fn with_size(cache_identifier: &str, cache_size: NonZeroUsize) -> Self { Self { values: SizeTrackingLruCache::new_with_default_metrics_registry( - Self::cache_name().into(), + Self::cache_name(cache_identifier).into(), cache_size, ), pending: Vec::with_capacity(8), } } - fn cache_name() -> String { - use convert_case::{Case, Casing as _}; - format!( - "tipset_state_{}", - crate::utils::misc::short_type_name::().to_case(Case::Snake) - ) + fn cache_name(cache_identifier: &str) -> String { + format!("tipset_state_{cache_identifier}") } } @@ -56,27 +38,22 @@ pub(crate) struct TipsetStateCache { cache: Arc>>, } -impl Default for TipsetStateCache { - fn default() -> Self { - TipsetStateCache::with_size(DEFAULT_RECEIPT_AND_EVENT_CACHE_SIZE) - } -} - enum CacheLookupStatus { Exist(V), Empty(Arc>), } impl TipsetStateCache { - pub fn new() -> Self { - Self { - cache: Arc::new(SyncMutex::new(TipsetStateCacheInner::default())), - } + pub fn new(cache_identifier: &str) -> Self { + Self::with_size(cache_identifier, DEFAULT_TIPSET_CACHE_SIZE) } - pub fn with_size(cache_size: NonZeroUsize) -> Self { + pub fn with_size(cache_identifier: &str, cache_size: NonZeroUsize) -> Self { Self { - cache: Arc::new(SyncMutex::new(TipsetStateCacheInner::with_size(cache_size))), + cache: Arc::new(SyncMutex::new(TipsetStateCacheInner::with_size( + cache_identifier, + cache_size, + ))), } } @@ -195,9 +172,17 @@ pub struct EnabledTipsetDataCache { impl EnabledTipsetDataCache { pub fn new() -> Self { + const DEFAULT_RECEIPT_AND_EVENT_CACHE_SIZE: NonZeroUsize = nonzero!(4096usize); + Self { - events_cache: TipsetStateCache::default(), - receipt_cache: TipsetStateCache::default(), + events_cache: TipsetStateCache::with_size( + "events", + DEFAULT_RECEIPT_AND_EVENT_CACHE_SIZE, + ), + receipt_cache: TipsetStateCache::with_size( + "receipts", + DEFAULT_RECEIPT_AND_EVENT_CACHE_SIZE, + ), } } } @@ -337,7 +322,7 @@ mod tests { #[tokio::test] async fn test_tipset_cache_basic_functionality() { - let cache: TipsetStateCache = TipsetStateCache::new(); + let cache: TipsetStateCache = TipsetStateCache::new("test"); let key = create_test_tipset_key(1); // Test cache miss and computation @@ -357,7 +342,7 @@ mod tests { #[tokio::test] async fn test_concurrent_same_key_computation() { - let cache: Arc> = Arc::new(TipsetStateCache::new()); + let cache: Arc> = Arc::new(TipsetStateCache::new("test")); let key = create_test_tipset_key(1); let computation_count = Arc::new(AtomicU8::new(0)); @@ -404,7 +389,7 @@ mod tests { #[tokio::test] async fn test_concurrent_different_keys() { - let cache: Arc> = Arc::new(TipsetStateCache::new()); + let cache: Arc> = Arc::new(TipsetStateCache::new("test")); let computation_count = Arc::new(AtomicU8::new(0)); // Start tasks that try to compute the different keys diff --git a/src/state_manager/mod.rs b/src/state_manager/mod.rs index 5ca111b48777..24de41efc66f 100644 --- a/src/state_manager/mod.rs +++ b/src/state_manager/mod.rs @@ -202,7 +202,7 @@ where Ok(Self { cs, - cache: TipsetStateCache::new(), // For StateOutputValue + cache: TipsetStateCache::new("state_output"), // For StateOutputValue beacon, chain_config, engine, diff --git a/src/utils/misc/mod.rs b/src/utils/misc/mod.rs index f44465991feb..61b8277d5b56 100644 --- a/src/utils/misc/mod.rs +++ b/src/utils/misc/mod.rs @@ -8,8 +8,6 @@ pub use adaptive_value_provider::*; mod logo; pub use logo::*; pub mod env; -mod r#type; -pub use r#type::*; #[derive(Debug, Clone, PartialEq, Eq, strum::EnumString)] #[strum(serialize_all = "kebab-case")] diff --git a/src/utils/misc/type.rs b/src/utils/misc/type.rs deleted file mode 100644 index 0fe4009a41d9..000000000000 --- a/src/utils/misc/type.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use std::{any::type_name, borrow::Cow}; - -pub fn short_type_name() -> Cow<'static, str> { - let prefix_pattern = lazy_regex::regex!(r#"(([^,:<>]+::)|\s)*"#); - let n = type_name::(); - prefix_pattern.replace_all(n, "") -} - -#[cfg(test)] -mod tests { - use super::*; - use std::borrow::Cow; - use std::io::Result as IoResult; - - #[test] - fn test_short_type_name() { - assert_eq!(short_type_name::(), "String"); - assert_eq!(short_type_name::>(), "Option"); - assert_eq!( - short_type_name::>>(), - "Result,Error>" - ); - assert_eq!(short_type_name::>(), "Cow"); - assert_eq!( - short_type_name::>>(), - "Result,Error>" - ); - } -} From 599a4fad44f3999507bab4ce5a7df2935da387c5 Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Thu, 11 Sep 2025 21:16:31 +0800 Subject: [PATCH 10/34] fix(ci): rpc parity test (#6071) --- src/lotus_json/actor_states/evm_state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lotus_json/actor_states/evm_state.rs b/src/lotus_json/actor_states/evm_state.rs index 650ce8c62de2..f5d4d7e97404 100644 --- a/src/lotus_json/actor_states/evm_state.rs +++ b/src/lotus_json/actor_states/evm_state.rs @@ -22,7 +22,7 @@ pub struct EVMStateLotusJson { pub contract_state: Cid, #[schemars(with = "LotusJson>")] - #[serde(with = "crate::lotus_json", skip_serializing_if = "Option::is_none")] + #[serde(with = "crate::lotus_json")] pub transient_data: Option>, // only available in evm actor state v16 pub nonce: u64, From 857067141dc7854d5819fce34ee3c4a820621614 Mon Sep 17 00:00:00 2001 From: Aryan Tikarya Date: Thu, 11 Sep 2025 21:55:05 +0530 Subject: [PATCH 11/34] Clean up `StateDecodeParams` API changes (#6000) --- CHANGELOG.md | 1 + Cargo.toml | 32 +- .../methods/account_constructor_params.rs | 51 - .../methods/init_constructor_params.rs | 55 - .../actor_states/methods/init_exec4_params.rs | 78 - .../actor_states/methods/init_exec_params.rs | 70 - src/lotus_json/actor_states/methods/mod.rs | 20 - src/lotus_json/actors/mod.rs | 6 + .../params/account_params.rs} | 49 +- .../params/cron_params.rs} | 2 +- .../params/datacap_params.rs} | 8 +- .../methods => actors/params}/eam_params.rs | 6 +- .../params/evm_params.rs} | 4 +- src/lotus_json/actors/params/init_params.rs | 181 ++ .../params/market_params.rs} | 18 +- .../params/miner_params.rs} | 76 +- src/lotus_json/actors/params/mod.rs | 17 + .../params/multisig_params.rs} | 16 +- .../methods => actors/params}/paych_params.rs | 4 +- .../params/power_params.rs} | 36 +- .../params/reward_params.rs} | 6 +- .../params/verified_reg_params.rs} | 20 +- .../states}/account_state.rs | 0 .../states}/cron_state.rs | 0 .../states}/datacap_state.rs | 0 .../states}/evm_state.rs | 0 .../states}/init_state.rs | 0 .../states}/market_state.rs | 0 .../states}/miner_state.rs | 0 .../{actor_states => actors/states}/mod.rs | 2 +- .../states}/multisig_state.rs | 0 .../states}/payment_channel_state.rs | 0 .../states}/power_states.rs | 0 .../states}/reward_state.rs | 0 .../states}/system_state.rs | 0 .../states}/verified_reg_state.rs | 0 .../states}/vesting_funds.rs | 0 src/lotus_json/mod.rs | 2 +- src/rpc/registry/actors/account.rs | 105 +- src/rpc/registry/actors/cron.rs | 27 +- src/rpc/registry/actors/datacap.rs | 22 +- src/rpc/registry/actors/eam.rs | 26 +- src/rpc/registry/actors/eth_account.rs | 40 +- src/rpc/registry/actors/evm.rs | 24 +- src/rpc/registry/actors/init.rs | 55 +- src/rpc/registry/actors/market.rs | 48 +- src/rpc/registry/actors/miner.rs | 142 +- src/rpc/registry/actors/multisig.rs | 43 +- src/rpc/registry/actors/payment_channel.rs | 57 +- src/rpc/registry/actors/power.rs | 49 +- src/rpc/registry/actors/reward.rs | 41 +- src/rpc/registry/actors/system.rs | 27 +- src/rpc/registry/actors/verified_reg.rs | 39 +- src/rpc/registry/actors_reg.rs | 11 +- src/rpc/registry/methods_reg.rs | 18 +- src/state_migration/nv27/mod.rs | 3 +- src/tool/subcommands/api_cmd.rs | 1 + .../subcommands/api_cmd/api_compare_tests.rs | 1768 +---------------- .../state_decode_params_tests/account.rs | 33 + .../api_cmd/state_decode_params_tests/cron.rs | 32 + .../state_decode_params_tests/datacap.rs | 172 ++ .../api_cmd/state_decode_params_tests/eam.rs | 47 + .../state_decode_params_tests/ethaccount.rs | 15 + .../api_cmd/state_decode_params_tests/evm.rs | 76 + .../api_cmd/state_decode_params_tests/init.rs | 44 + .../state_decode_params_tests/market.rs | 285 +++ .../state_decode_params_tests/miner.rs | 506 +++++ .../api_cmd/state_decode_params_tests/mod.rs | 51 + .../state_decode_params_tests/multisig.rs | 120 ++ .../state_decode_params_tests/paych.rs | 65 + .../state_decode_params_tests/power.rs | 121 ++ .../state_decode_params_tests/reward.rs | 53 + .../state_decode_params_tests/system.rs | 15 + .../state_decode_params_tests/verified_reg.rs | 194 ++ 74 files changed, 2783 insertions(+), 2352 deletions(-) delete mode 100644 src/lotus_json/actor_states/methods/account_constructor_params.rs delete mode 100644 src/lotus_json/actor_states/methods/init_constructor_params.rs delete mode 100644 src/lotus_json/actor_states/methods/init_exec4_params.rs delete mode 100644 src/lotus_json/actor_states/methods/init_exec_params.rs delete mode 100644 src/lotus_json/actor_states/methods/mod.rs create mode 100644 src/lotus_json/actors/mod.rs rename src/lotus_json/{actor_states/methods/account_authenticate_params.rs => actors/params/account_params.rs} (56%) rename src/lotus_json/{actor_states/methods/cron_actor_params.rs => actors/params/cron_params.rs} (99%) rename src/lotus_json/{actor_states/methods/datacap_actor_params.rs => actors/params/datacap_params.rs} (99%) rename src/lotus_json/{actor_states/methods => actors/params}/eam_params.rs (96%) rename src/lotus_json/{actor_states/methods/evm_actor_params.rs => actors/params/evm_params.rs} (98%) create mode 100644 src/lotus_json/actors/params/init_params.rs rename src/lotus_json/{actor_states/methods/market_actor_params.rs => actors/params/market_params.rs} (98%) rename src/lotus_json/{actor_states/methods/miner_actor_params.rs => actors/params/miner_params.rs} (99%) create mode 100644 src/lotus_json/actors/params/mod.rs rename src/lotus_json/{actor_states/methods/multisig_actor.rs => actors/params/multisig_params.rs} (98%) rename src/lotus_json/{actor_states/methods => actors/params}/paych_params.rs (99%) rename src/lotus_json/{actor_states/methods/power_actor.rs => actors/params/power_params.rs} (94%) rename src/lotus_json/{actor_states/methods/reward_methods.rs => actors/params/reward_params.rs} (96%) rename src/lotus_json/{actor_states/methods/verified_reg_actor.rs => actors/params/verified_reg_params.rs} (99%) rename src/lotus_json/{actor_states => actors/states}/account_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/cron_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/datacap_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/evm_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/init_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/market_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/miner_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/mod.rs (96%) rename src/lotus_json/{actor_states => actors/states}/multisig_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/payment_channel_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/power_states.rs (100%) rename src/lotus_json/{actor_states => actors/states}/reward_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/system_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/verified_reg_state.rs (100%) rename src/lotus_json/{actor_states => actors/states}/vesting_funds.rs (100%) create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/account.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/cron.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/datacap.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/eam.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/ethaccount.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/evm.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/init.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/market.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/miner.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/mod.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/multisig.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/paych.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/power.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/reward.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/system.rs create mode 100644 src/tool/subcommands/api_cmd/state_decode_params_tests/verified_reg.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d15128ca79..edefb5144c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ ### Added - [#6057](https://github.com/ChainSafe/forest/issues/6057) Added `--no-progress-timeout` to `forest-cli f3 ready` subcommand to exit when F3 is stuck for the given timeout. +- [#6000](https://github.com/ChainSafe/forest/pull/6000) Add support for the `Filecoin.StateDecodeParams` API methods to enable decoding actors method params. ### Changed diff --git a/Cargo.toml b/Cargo.toml index a36b792aff4a..c13ff97da1d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,22 +67,22 @@ educe = { version = "0.6.0", features = ["Debug"], default-features = false } enumflags2 = "0.7" ethereum-types = { version = "0.15", features = ["ethbloom"] } ez-jsonrpc-types = "0.5" -fil_actor_account_state = { version = "24" } -fil_actor_cron_state = { version = "24" } -fil_actor_datacap_state = { version = "24" } -fil_actor_eam_state = { version = "24" } -fil_actor_ethaccount_state = { version = "24" } -fil_actor_evm_state = { version = "24" } -fil_actor_init_state = { version = "24" } -fil_actor_market_state = { version = "24" } -fil_actor_miner_state = { version = "24" } -fil_actor_multisig_state = { version = "24" } -fil_actor_paych_state = { version = "24" } -fil_actor_power_state = { version = "24" } -fil_actor_reward_state = { version = "24" } -fil_actor_system_state = { version = "24" } -fil_actor_verifreg_state = { version = "24" } -fil_actors_shared = { version = "24", features = ["json"] } +fil_actor_account_state = { version = "24.1.2" } +fil_actor_cron_state = { version = "24.1.2" } +fil_actor_datacap_state = { version = "24.1.2" } +fil_actor_eam_state = { version = "24.1.2" } +fil_actor_ethaccount_state = { version = "24.1.2" } +fil_actor_evm_state = { version = "24.1.2" } +fil_actor_init_state = { version = "24.1.2" } +fil_actor_market_state = { version = "24.1.2" } +fil_actor_miner_state = { version = "24.1.2" } +fil_actor_multisig_state = { version = "24.1.2" } +fil_actor_paych_state = { version = "24.1.2" } +fil_actor_power_state = { version = "24.1.2" } +fil_actor_reward_state = { version = "24.1.2" } +fil_actor_system_state = { version = "24.1.2" } +fil_actor_verifreg_state = { version = "24.1.2" } +fil_actors_shared = { version = "24.1.2", features = ["json"] } flate2 = "1" flume = { workspace = true } fs_extra = "1" diff --git a/src/lotus_json/actor_states/methods/account_constructor_params.rs b/src/lotus_json/actor_states/methods/account_constructor_params.rs deleted file mode 100644 index 1bd244dad4dc..000000000000 --- a/src/lotus_json/actor_states/methods/account_constructor_params.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT -use super::*; -use crate::shim::address::Address; -use paste::paste; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] -#[serde(transparent)] -pub struct AccountConstructorParamsLotusJson { - #[schemars(with = "LotusJson
")] - #[serde(with = "crate::lotus_json")] - pub address: Address, -} - -macro_rules! impl_account_constructor_params { - ($type_suffix:path: $($version:literal),+) => { - $( - paste! { - impl HasLotusJson for fil_actor_account_state::[]::$type_suffix { - type LotusJson = AccountConstructorParamsLotusJson; - - #[cfg(test)] - fn snapshots() -> Vec<(serde_json::Value, Self)> { - vec![ - ( - json!("f01234"), - Self { - address: Address::new_id(1234).into(), - }, - ), - ] - } - - fn into_lotus_json(self) -> Self::LotusJson { - AccountConstructorParamsLotusJson { address: self.address.into() } - } - - fn from_lotus_json(lotus_json: Self::LotusJson) -> Self { - Self { address: lotus_json.address.into() } - } - } - } - )+ - }; -} - -// not added other versions because `fil_actor_account_state::types` -// is private for all of them -impl_account_constructor_params!(types::ConstructorParams: 15, 16); -impl_account_constructor_params!(ConstructorParams: 11, 12, 13, 14); diff --git a/src/lotus_json/actor_states/methods/init_constructor_params.rs b/src/lotus_json/actor_states/methods/init_constructor_params.rs deleted file mode 100644 index fae5c3c05c73..000000000000 --- a/src/lotus_json/actor_states/methods/init_constructor_params.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use super::*; -use jsonrpsee::core::Serialize; -use paste::paste; -use schemars::JsonSchema; -use serde::Deserialize; -use std::fmt::Debug; - -#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] -#[serde(rename_all = "PascalCase")] -pub struct InitConstructorParamsLotusJson { - pub network_name: String, -} - -macro_rules! impl_lotus_json_for_init_constructor_params { - ($($version:literal),+) => { - $( - paste! { - impl HasLotusJson for fil_actor_init_state::[]::ConstructorParams { - type LotusJson = InitConstructorParamsLotusJson; - - #[cfg(test)] - fn snapshots() -> Vec<(serde_json::Value, Self)> { - vec![ - ( - json!({ - "NetworkName": "calibnet", - }), - Self { - network_name: "calibnet".to_string(), - }, - ), - ] - } - - fn into_lotus_json(self) -> Self::LotusJson { - Self::LotusJson { - network_name: self.network_name, - } - } - - fn from_lotus_json(json: Self::LotusJson) -> Self { - Self { - network_name: json.network_name, - } - } - } - } - )+ - } -} - -impl_lotus_json_for_init_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); diff --git a/src/lotus_json/actor_states/methods/init_exec4_params.rs b/src/lotus_json/actor_states/methods/init_exec4_params.rs deleted file mode 100644 index 0b9bffca8010..000000000000 --- a/src/lotus_json/actor_states/methods/init_exec4_params.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use super::*; -use ::cid::Cid; -use fvm_ipld_encoding::RawBytes; -use jsonrpsee::core::Serialize; -use paste::paste; -use schemars::JsonSchema; -use serde::Deserialize; -use std::fmt::Debug; - -#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] -#[serde(rename_all = "PascalCase")] -pub struct InitExec4ParamsLotusJson { - #[schemars(with = "LotusJson")] - #[serde(with = "crate::lotus_json")] - #[serde(rename = "CodeCID")] - pub code_cid: Cid, - - #[schemars(with = "LotusJson")] - #[serde(with = "crate::lotus_json")] - pub constructor_params: RawBytes, - - #[schemars(with = "LotusJson")] - #[serde(with = "crate::lotus_json")] - pub sub_address: RawBytes, -} - -macro_rules! impl_lotus_json_for_init_exec4_params { - ($($version:literal),+) => { - $( - paste! { - impl HasLotusJson for fil_actor_init_state::[]::Exec4Params { - type LotusJson = InitExec4ParamsLotusJson; - - #[cfg(test)] - fn snapshots() -> Vec<(serde_json::Value, Self)> { - vec![ - ( - json!({ - "CodeCid": { - "/": "baeaaaaa" - }, - "ConstructorParams": "ESIzRFU=", - "Subaddress": "ESIzRFU=", - }), - Self { - code_cid: Cid::default(), - constructor_params: RawBytes::new(hex::decode("1122334455").unwrap()), - subaddress: RawBytes::new(hex::decode("1122334455").unwrap()), - }, - ), - ] - } - - fn into_lotus_json(self) -> Self::LotusJson { - Self::LotusJson { - code_cid: self.code_cid, - constructor_params: self.constructor_params, - sub_address: self.subaddress, - } - } - - fn from_lotus_json(json: Self::LotusJson) -> Self { - Self { - code_cid: json.code_cid, - constructor_params: json.constructor_params, - subaddress: json.sub_address, - } - } - } - } - )+ - }; -} - -impl_lotus_json_for_init_exec4_params!(10, 11, 12, 13, 14, 15, 16); diff --git a/src/lotus_json/actor_states/methods/init_exec_params.rs b/src/lotus_json/actor_states/methods/init_exec_params.rs deleted file mode 100644 index 6820a72ec4d0..000000000000 --- a/src/lotus_json/actor_states/methods/init_exec_params.rs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use super::*; -use ::cid::Cid; -use fvm_ipld_encoding::RawBytes; -use jsonrpsee::core::Serialize; -use paste::paste; -use schemars::JsonSchema; -use serde::Deserialize; -use std::fmt::Debug; - -#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] -#[serde(rename_all = "PascalCase")] -pub struct InitExecParamsLotusJson { - #[schemars(with = "LotusJson")] - #[serde(with = "crate::lotus_json")] - #[serde(rename = "CodeCID")] - pub code_cid: Cid, - - #[schemars(with = "LotusJson")] - #[serde(with = "crate::lotus_json")] - pub constructor_params: RawBytes, -} - -macro_rules! impl_lotus_json_for_init_exec_params { - ($($version:literal),+) => { - $( - paste! { - impl HasLotusJson for fil_actor_init_state::[]::ExecParams { - type LotusJson = InitExecParamsLotusJson; - - #[cfg(test)] - fn snapshots() -> Vec<(serde_json::Value, Self)> { - vec![ - ( - json!({ - "CodeCid": { - "/": "baeaaaaa" - }, - "ConstructorParams": "ESIzRFU=", - }), - Self { - code_cid: Cid::default(), - constructor_params: RawBytes::new(hex::decode("1122334455").unwrap()), - }, - ), - ] - } - - fn into_lotus_json(self) -> Self::LotusJson { - Self::LotusJson { - code_cid: self.code_cid, - constructor_params: self.constructor_params, - } - } - - fn from_lotus_json(json: Self::LotusJson) -> Self { - Self { - code_cid: json.code_cid, - constructor_params: json.constructor_params, - } - } - } - } - )+ - }; -} - -impl_lotus_json_for_init_exec_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); diff --git a/src/lotus_json/actor_states/methods/mod.rs b/src/lotus_json/actor_states/methods/mod.rs deleted file mode 100644 index ae64614e81ad..000000000000 --- a/src/lotus_json/actor_states/methods/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2019-2025 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use super::*; -mod account_authenticate_params; -mod account_constructor_params; -mod cron_actor_params; -mod datacap_actor_params; -mod eam_params; -mod evm_actor_params; -mod init_constructor_params; -mod init_exec4_params; -mod init_exec_params; -mod market_actor_params; -mod miner_actor_params; -mod multisig_actor; -mod paych_params; -mod power_actor; -mod reward_methods; -pub mod verified_reg_actor; diff --git a/src/lotus_json/actors/mod.rs b/src/lotus_json/actors/mod.rs new file mode 100644 index 000000000000..77e47808441d --- /dev/null +++ b/src/lotus_json/actors/mod.rs @@ -0,0 +1,6 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +mod params; +mod states; diff --git a/src/lotus_json/actor_states/methods/account_authenticate_params.rs b/src/lotus_json/actors/params/account_params.rs similarity index 56% rename from src/lotus_json/actor_states/methods/account_authenticate_params.rs rename to src/lotus_json/actors/params/account_params.rs index e34accd2b63c..a0fbb2013c73 100644 --- a/src/lotus_json/actor_states/methods/account_authenticate_params.rs +++ b/src/lotus_json/actors/params/account_params.rs @@ -1,11 +1,21 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT + use super::*; +use crate::shim::address::Address; use jsonrpsee::core::Serialize; use paste::paste; use schemars::JsonSchema; use serde::Deserialize; +#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] +#[serde(transparent)] +pub struct AccountConstructorParamsLotusJson { + #[schemars(with = "LotusJson
")] + #[serde(with = "crate::lotus_json")] + pub address: Address, +} + #[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] #[serde(rename_all = "PascalCase")] pub struct AuthenticateParamsLotusJson { @@ -59,6 +69,39 @@ macro_rules! impl_account_authenticate_params { }; } -// not added other versions because AuthenticateMessageParams is private for the rest of them -impl_account_authenticate_params!(types::AuthenticateMessageParams: 15, 16); -impl_account_authenticate_params!(AuthenticateMessageParams: 11, 12, 13, 14); +macro_rules! impl_account_constructor_params { + ($type_suffix:path: $($version:literal),+) => { + $( + paste! { + impl HasLotusJson for fil_actor_account_state::[]::$type_suffix { + type LotusJson = AccountConstructorParamsLotusJson; + + #[cfg(test)] + fn snapshots() -> Vec<(serde_json::Value, Self)> { + vec![ + ( + json!("f01234"), + Self { + address: Address::new_id(1234).into(), + }, + ), + ] + } + + fn into_lotus_json(self) -> Self::LotusJson { + AccountConstructorParamsLotusJson { address: self.address.into() } + } + + fn from_lotus_json(lotus_json: Self::LotusJson) -> Self { + Self { address: lotus_json.address.into() } + } + } + } + )+ + }; +} + +impl_account_constructor_params!(types::ConstructorParams: 15, 16, 17); +impl_account_constructor_params!(ConstructorParams: 11, 12, 13, 14); +impl_account_authenticate_params!(types::AuthenticateMessageParams: 15, 16, 17); +impl_account_authenticate_params!(AuthenticateMessageParams: 9, 10, 11, 12, 13, 14); diff --git a/src/lotus_json/actor_states/methods/cron_actor_params.rs b/src/lotus_json/actors/params/cron_params.rs similarity index 99% rename from src/lotus_json/actor_states/methods/cron_actor_params.rs rename to src/lotus_json/actors/params/cron_params.rs index 82849bb7d941..b97298c0ad1a 100644 --- a/src/lotus_json/actor_states/methods/cron_actor_params.rs +++ b/src/lotus_json/actors/params/cron_params.rs @@ -79,4 +79,4 @@ macro_rules! impl_lotus_json_for_cron_constructor_params { }; } -impl_lotus_json_for_cron_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); +impl_lotus_json_for_cron_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/datacap_actor_params.rs b/src/lotus_json/actors/params/datacap_params.rs similarity index 99% rename from src/lotus_json/actor_states/methods/datacap_actor_params.rs rename to src/lotus_json/actors/params/datacap_params.rs index 2f6c17f1741f..cc9ad1a6109b 100644 --- a/src/lotus_json/actor_states/methods/datacap_actor_params.rs +++ b/src/lotus_json/actors/params/datacap_params.rs @@ -48,7 +48,7 @@ macro_rules! impl_datacap_balance_params_lotus_json { }; } -impl_datacap_balance_params_lotus_json!(v11, v12, v13, v14, v15, v16); +impl_datacap_balance_params_lotus_json!(v11, v12, v13, v14, v15, v16, v17); #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema)] #[serde(transparent)] @@ -85,7 +85,7 @@ macro_rules! impl_datacap_constructor_params_lotus_json { }; } -impl_datacap_constructor_params_lotus_json!(v11, v12, v13, v14, v15, v16); +impl_datacap_constructor_params_lotus_json!(v11, v12, v13, v14, v15, v16, v17); #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "PascalCase")] @@ -135,7 +135,7 @@ macro_rules! impl_datacap_destroy_params_lotus_json { }; } -impl_datacap_destroy_params_lotus_json!(v9, v10, v11, v12, v13, v14, v15, v16); +impl_datacap_destroy_params_lotus_json!(v9, v10, v11, v12, v13, v14, v15, v16, v17); #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "PascalCase")] @@ -195,7 +195,7 @@ macro_rules! impl_datacap_mint_params_lotus_json { }; } -impl_datacap_mint_params_lotus_json!(v9, v10, v11, v12, v13, v14, v15, v16); +impl_datacap_mint_params_lotus_json!(v9, v10, v11, v12, v13, v14, v15, v16, v17); #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "PascalCase")] diff --git a/src/lotus_json/actor_states/methods/eam_params.rs b/src/lotus_json/actors/params/eam_params.rs similarity index 96% rename from src/lotus_json/actor_states/methods/eam_params.rs rename to src/lotus_json/actors/params/eam_params.rs index be92e48f108c..b9023da1fb97 100644 --- a/src/lotus_json/actor_states/methods/eam_params.rs +++ b/src/lotus_json/actors/params/eam_params.rs @@ -147,6 +147,6 @@ macro_rules! impl_eam_create_external_params { }; } -impl_eam_create_params!(10, 11, 12, 13, 14, 15, 16); -impl_eam_create2_params!(10, 11, 12, 13, 14, 15, 16); -impl_eam_create_external_params!(10, 11, 12, 13, 14, 15, 16); +impl_eam_create_params!(10, 11, 12, 13, 14, 15, 16, 17); +impl_eam_create2_params!(10, 11, 12, 13, 14, 15, 16, 17); +impl_eam_create_external_params!(10, 11, 12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/evm_actor_params.rs b/src/lotus_json/actors/params/evm_params.rs similarity index 98% rename from src/lotus_json/actor_states/methods/evm_actor_params.rs rename to src/lotus_json/actors/params/evm_params.rs index 8cde8409f13e..13b72bd0e40e 100644 --- a/src/lotus_json/actor_states/methods/evm_actor_params.rs +++ b/src/lotus_json/actors/params/evm_params.rs @@ -61,7 +61,7 @@ macro_rules! impl_evm_constructor_params { }; } -impl_evm_constructor_params!(10, 11, 12, 13, 14, 15, 16); +impl_evm_constructor_params!(10, 11, 12, 13, 14, 15, 16, 17); #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema)] #[serde(rename_all = "PascalCase")] @@ -124,7 +124,7 @@ macro_rules! impl_evm_delegate_call_params_lotus_json { }; } -impl_evm_delegate_call_params_lotus_json!(10, 11, 12, 13, 14, 15, 16); +impl_evm_delegate_call_params_lotus_json!(10, 11, 12, 13, 14, 15, 16, 17); #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] diff --git a/src/lotus_json/actors/params/init_params.rs b/src/lotus_json/actors/params/init_params.rs new file mode 100644 index 000000000000..a754fac3945f --- /dev/null +++ b/src/lotus_json/actors/params/init_params.rs @@ -0,0 +1,181 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use ::cid::Cid; +use fvm_ipld_encoding::RawBytes; +use jsonrpsee::core::Serialize; +use paste::paste; +use schemars::JsonSchema; +use serde::Deserialize; +use std::fmt::Debug; + +#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] +#[serde(rename_all = "PascalCase")] +pub struct InitConstructorParamsLotusJson { + pub network_name: String, +} + +#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] +#[serde(rename_all = "PascalCase")] +pub struct InitExecParamsLotusJson { + #[schemars(with = "LotusJson")] + #[serde(with = "crate::lotus_json")] + #[serde(rename = "CodeCID")] + pub code_cid: Cid, + + #[schemars(with = "LotusJson")] + #[serde(with = "crate::lotus_json")] + pub constructor_params: RawBytes, +} + +#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone, PartialEq)] +#[serde(rename_all = "PascalCase")] +pub struct InitExec4ParamsLotusJson { + #[schemars(with = "LotusJson")] + #[serde(with = "crate::lotus_json")] + #[serde(rename = "CodeCID")] + pub code_cid: Cid, + + #[schemars(with = "LotusJson")] + #[serde(with = "crate::lotus_json")] + pub constructor_params: RawBytes, + + #[schemars(with = "LotusJson")] + #[serde(with = "crate::lotus_json")] + pub sub_address: RawBytes, +} + +macro_rules! impl_lotus_json_for_init_constructor_params { + ($($version:literal),+) => { + $( + paste! { + impl HasLotusJson for fil_actor_init_state::[]::ConstructorParams { + type LotusJson = InitConstructorParamsLotusJson; + + #[cfg(test)] + fn snapshots() -> Vec<(serde_json::Value, Self)> { + vec![ + ( + json!({ + "NetworkName": "calibnet", + }), + Self { + network_name: "calibnet".to_string(), + }, + ), + ] + } + + fn into_lotus_json(self) -> Self::LotusJson { + Self::LotusJson { + network_name: self.network_name, + } + } + + fn from_lotus_json(json: Self::LotusJson) -> Self { + Self { + network_name: json.network_name, + } + } + } + } + )+ + } +} + +macro_rules! impl_lotus_json_for_init_exec_params { + ($($version:literal),+) => { + $( + paste! { + impl HasLotusJson for fil_actor_init_state::[]::ExecParams { + type LotusJson = InitExecParamsLotusJson; + + #[cfg(test)] + fn snapshots() -> Vec<(serde_json::Value, Self)> { + vec![ + ( + json!({ + "CodeCID": { + "/": "baeaaaaa" + }, + "ConstructorParams": "ESIzRFU=", + }), + Self { + code_cid: Cid::default(), + constructor_params: RawBytes::new(hex::decode("1122334455").unwrap()), + }, + ), + ] + } + + fn into_lotus_json(self) -> Self::LotusJson { + Self::LotusJson { + code_cid: self.code_cid, + constructor_params: self.constructor_params, + } + } + + fn from_lotus_json(json: Self::LotusJson) -> Self { + Self { + code_cid: json.code_cid, + constructor_params: json.constructor_params, + } + } + } + } + )+ + }; +} + +macro_rules! impl_lotus_json_for_init_exec4_params { + ($($version:literal),+) => { + $( + paste! { + impl HasLotusJson for fil_actor_init_state::[]::Exec4Params { + type LotusJson = InitExec4ParamsLotusJson; + + #[cfg(test)] + fn snapshots() -> Vec<(serde_json::Value, Self)> { + vec![ + ( + json!({ + "CodeCID": { + "/": "baeaaaaa" + }, + "ConstructorParams": "ESIzRFU=", + "SubAddress": "ESIzRFU=", + }), + Self { + code_cid: Cid::default(), + constructor_params: RawBytes::new(hex::decode("1122334455").unwrap()), + subaddress: RawBytes::new(hex::decode("1122334455").unwrap()), + }, + ), + ] + } + + fn into_lotus_json(self) -> Self::LotusJson { + Self::LotusJson { + code_cid: self.code_cid, + constructor_params: self.constructor_params, + sub_address: self.subaddress, + } + } + + fn from_lotus_json(json: Self::LotusJson) -> Self { + Self { + code_cid: json.code_cid, + constructor_params: json.constructor_params, + subaddress: json.sub_address, + } + } + } + } + )+ + }; +} + +impl_lotus_json_for_init_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_init_exec_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_init_exec4_params!(10, 11, 12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/market_actor_params.rs b/src/lotus_json/actors/params/market_params.rs similarity index 98% rename from src/lotus_json/actor_states/methods/market_actor_params.rs rename to src/lotus_json/actors/params/market_params.rs index b6311ae9e6db..ddd78cedab62 100644 --- a/src/lotus_json/actor_states/methods/market_actor_params.rs +++ b/src/lotus_json/actors/params/market_params.rs @@ -210,18 +210,18 @@ macro_rules! impl_lotus_json_for_deal_proposal { "ClientCollateral": "3000" }), // Create the corresponding object using from_lotus_json to ensure compatibility - Self::from_lotus_json(crate::lotus_json::actor_states::methods::market_actor_params::DealProposalLotusJson { + Self::from_lotus_json(DealProposalLotusJson { piece_cid: test_cid, piece_size: 1024u64.into(), verified_deal: false, - client: crate::shim::address::Address::new_id(1234).into(), - provider: crate::shim::address::Address::new_id(5678).into(), - label: crate::lotus_json::actor_states::methods::market_actor_params::LabelLotusJson::String("test".to_string()), + client: Address::new_id(1234).into(), + provider: Address::new_id(5678).into(), + label: LabelLotusJson::String("test".to_string()), start_epoch: 100, end_epoch: 200, - storage_price_per_epoch: crate::shim::econ::TokenAmount::from_atto(1000u64).into(), - provider_collateral: crate::shim::econ::TokenAmount::from_atto(2000u64).into(), - client_collateral: crate::shim::econ::TokenAmount::from_atto(3000u64).into(), + storage_price_per_epoch: TokenAmount::from_atto(1000u64).into(), + provider_collateral: TokenAmount::from_atto(2000u64).into(), + client_collateral: TokenAmount::from_atto(3000u64).into(), }) )] } @@ -350,13 +350,13 @@ macro_rules! impl_lotus_json_for_client_deal_proposal { }), // Create object using from_lotus_json to ensure compatibility Self::from_lotus_json($lotus_json_type { - proposal: crate::lotus_json::actor_states::methods::market_actor_params::DealProposalLotusJson { + proposal: DealProposalLotusJson { piece_cid: test_cid, piece_size: 1024u64.into(), verified_deal: false, client: crate::shim::address::Address::new_id(1234).into(), provider: crate::shim::address::Address::new_id(5678).into(), - label: crate::lotus_json::actor_states::methods::market_actor_params::LabelLotusJson::String("test".to_string()), + label: LabelLotusJson::String("test".to_string()), start_epoch: 100, end_epoch: 200, storage_price_per_epoch: crate::shim::econ::TokenAmount::from_atto(1000u64).into(), diff --git a/src/lotus_json/actor_states/methods/miner_actor_params.rs b/src/lotus_json/actors/params/miner_params.rs similarity index 99% rename from src/lotus_json/actor_states/methods/miner_actor_params.rs rename to src/lotus_json/actors/params/miner_params.rs index be20adc8aaf2..04e0882b521c 100644 --- a/src/lotus_json/actor_states/methods/miner_actor_params.rs +++ b/src/lotus_json/actors/params/miner_params.rs @@ -2518,7 +2518,7 @@ macro_rules! impl_lotus_json_for_miner_apply_reward_params { }; } -macro_rules! impl_lotus_json_for_miner_prove_commit_aggregate_params_v13_and_above { +macro_rules! impl_lotus_json_for_miner_prove_commit_aggregate_params_v9_to_v16 { ($($version:literal),+) => { $( paste! { @@ -3695,54 +3695,54 @@ macro_rules! impl_miner_internal_sector_setup_for_preseal_params { }; } -impl_lotus_json_for_miner_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_change_worker_param!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_change_owner_address_params!(11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_extend_sector_expiration2_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_change_beneficiary_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_declare_faults_recovered_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_dispute_windowed_post_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_recover_declaration_params_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_post_partition_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16); +impl_lotus_json_for_miner_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_change_worker_param!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_change_owner_address_params!(11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_extend_sector_expiration2_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_change_beneficiary_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_declare_faults_recovered_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_dispute_windowed_post_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_recover_declaration_params_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_post_partition_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16, 17); impl_lotus_json_for_miner_submit_windowed_post_params_v9_and_above!(fvm_shared2: 9); impl_lotus_json_for_miner_submit_windowed_post_params_v9_and_above!(fvm_shared3: 10, 11); -impl_lotus_json_for_miner_submit_windowed_post_params_v9_and_above!(fvm_shared4: 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_declare_faults_params_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_declare_faults_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_termination_declaration_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_terminate_sectors_params_v9_and_above!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_withdraw_balance_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_change_multiaddrs_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_compact_partitions_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_compact_sector_numbers_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_pre_commit_sector_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_pre_commit_sector_and_batch_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_pre_commit_sector_batch2_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_prove_commit_sectors3_params!(13, 14, 15, 16); -impl_lotus_json_for_miner_prove_replica_updates3_params!(13, 14, 15, 16); -impl_lotus_json_for_miner_report_consensus_fault_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_check_sector_proven_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_apply_reward_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_prove_commit_aggregate_params_v13_and_above!( - 9, 10, 11, 12, 13, 14, 15, 16 +impl_lotus_json_for_miner_submit_windowed_post_params_v9_and_above!(fvm_shared4: 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_declare_faults_params_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_declare_faults_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_termination_declaration_v9_and_above!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_terminate_sectors_params_v9_and_above!( + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ); +impl_lotus_json_for_miner_withdraw_balance_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_change_multiaddrs_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_compact_partitions_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_compact_sector_numbers_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_pre_commit_sector_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_pre_commit_sector_and_batch_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_pre_commit_sector_batch2_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_prove_commit_sectors3_params!(13, 14, 15, 16, 17); +impl_lotus_json_for_miner_prove_replica_updates3_params!(13, 14, 15, 16, 17); +impl_lotus_json_for_miner_report_consensus_fault_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_check_sector_proven_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_apply_reward_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_prove_commit_aggregate_params_v9_to_v16!(9, 10, 11, 12, 13, 14, 15, 16); impl_lotus_json_for_miner_prove_replica_updates_params!(fvm_shared2: 8, 9); impl_lotus_json_for_miner_prove_replica_updates_params!(fvm_shared3: 10, 11); impl_lotus_json_for_miner_prove_replica_updates_params!(fvm_shared4: 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_is_controlling_address_param!(10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_max_termination_fee_params!(16); -impl_lotus_json_for_miner_change_peer_id_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_miner_sector_activation_manifest!(13, 14, 15, 16); -impl_lotus_json_for_miner_sector_update_manifest!(13, 14, 15, 16); -impl_miner_prove_commit_sector_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); +impl_lotus_json_for_miner_is_controlling_address_param!(10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_max_termination_fee_params!(16, 17); +impl_lotus_json_for_miner_change_peer_id_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_miner_sector_activation_manifest!(13, 14, 15, 16, 17); +impl_lotus_json_for_miner_sector_update_manifest!(13, 14, 15, 16, 17); +impl_miner_prove_commit_sector_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); impl_miner_extend_sector_expiration_params_v9_onwards!(9, 10, 11, 12, 13, 14, 15, 16); impl_miner_confirm_sector_proofs_param_v8_to_v13!(fvm_shared2: 8, 9); impl_miner_confirm_sector_proofs_param_v8_to_v13!(fvm_shared3: 10, 11,12, 13); -impl_miner_deferred_cron_event_params_v14_onwards!(14, 15, 16); +impl_miner_deferred_cron_event_params_v14_onwards!(14, 15, 16, 17); impl_miner_deferred_cron_event_params_v8_to_v13!(fvm_shared2: 8, 9); impl_miner_deferred_cron_event_params_v8_to_v13!(fvm_shared3: 10, 11, 12, 13); impl_miner_prove_replica_update_params2!(fvm_shared2: 9); impl_miner_prove_replica_update_params2!(fvm_shared3: 10, 11); impl_miner_prove_replica_update_params2!(fvm_shared4: 12); -impl_lotus_json_for_miner_prove_commit_sector_ni_params!(14, 15, 16); -impl_miner_internal_sector_setup_for_preseal_params!(14, 15, 16); +impl_lotus_json_for_miner_prove_commit_sector_ni_params!(14, 15, 16, 17); +impl_miner_internal_sector_setup_for_preseal_params!(14, 15, 16, 17); diff --git a/src/lotus_json/actors/params/mod.rs b/src/lotus_json/actors/params/mod.rs new file mode 100644 index 000000000000..edae9c291e56 --- /dev/null +++ b/src/lotus_json/actors/params/mod.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +mod account_params; +mod cron_params; +mod datacap_params; +mod eam_params; +mod evm_params; +mod init_params; +mod market_params; +mod miner_params; +mod multisig_params; +mod paych_params; +mod power_params; +mod reward_params; +mod verified_reg_params; diff --git a/src/lotus_json/actor_states/methods/multisig_actor.rs b/src/lotus_json/actors/params/multisig_params.rs similarity index 98% rename from src/lotus_json/actor_states/methods/multisig_actor.rs rename to src/lotus_json/actors/params/multisig_params.rs index 8de3eb4f5e97..b34e7f3c6177 100644 --- a/src/lotus_json/actor_states/methods/multisig_actor.rs +++ b/src/lotus_json/actors/params/multisig_params.rs @@ -457,11 +457,11 @@ macro_rules! impl_multisig_lock_balance_params { }; } -impl_multisig_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_propose_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_txn_id_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_add_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_remove_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_swap_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_change_num_approvals_threshold_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_multisig_lock_balance_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); +impl_multisig_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_propose_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_txn_id_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_add_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_remove_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_swap_signer_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_change_num_approvals_threshold_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_multisig_lock_balance_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/paych_params.rs b/src/lotus_json/actors/params/paych_params.rs similarity index 99% rename from src/lotus_json/actor_states/methods/paych_params.rs rename to src/lotus_json/actors/params/paych_params.rs index 42901f7dc381..0bff50ed1901 100644 --- a/src/lotus_json/actor_states/methods/paych_params.rs +++ b/src/lotus_json/actors/params/paych_params.rs @@ -540,7 +540,7 @@ macro_rules! impl_paych_update_channel_state_params_v4 { } // Apply implementations with correct fvm_shared versions -impl_paych_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); +impl_paych_constructor_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); impl_paych_update_channel_state_params_v2!(8, 9); impl_paych_update_channel_state_params_v3!(10, 11); -impl_paych_update_channel_state_params_v4!(12, 13, 14, 15, 16); +impl_paych_update_channel_state_params_v4!(12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/power_actor.rs b/src/lotus_json/actors/params/power_params.rs similarity index 94% rename from src/lotus_json/actor_states/methods/power_actor.rs rename to src/lotus_json/actors/params/power_params.rs index faea44701b5f..2207cdf108bc 100644 --- a/src/lotus_json/actor_states/methods/power_actor.rs +++ b/src/lotus_json/actors/params/power_params.rs @@ -289,7 +289,7 @@ macro_rules! impl_lotus_json_for_power_miner_raw_power_params { }; } -// Implementations for MinerPowerParams (only present in the power actor v16) +// Implementations for MinerPowerParams (only present in the power actor v16 and v17) impl HasLotusJson for fil_actor_power_state::v16::MinerPowerParams { type LotusJson = MinerPowerParamsLotusJson; @@ -314,8 +314,32 @@ impl HasLotusJson for fil_actor_power_state::v16::MinerPowerParams { } } -impl_lotus_json_for_power_create_miner_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_power_update_claimed_power_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_power_enroll_cron_event_params!(8, 9, 10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_power_update_pledge_total_params!(10, 11, 12, 13, 14, 15, 16); -impl_lotus_json_for_power_miner_raw_power_params!(10, 11, 12, 13, 14, 15, 16); +impl HasLotusJson for fil_actor_power_state::v17::MinerPowerParams { + type LotusJson = MinerPowerParamsLotusJson; + + #[cfg(test)] + fn snapshots() -> Vec<(serde_json::Value, Self)> { + vec![( + json!({ + "Miner": 1002, + }), + Self { miner: 1002 }, + )] + } + + fn into_lotus_json(self) -> Self::LotusJson { + MinerPowerParamsLotusJson { miner: self.miner } + } + + fn from_lotus_json(lotus_json: Self::LotusJson) -> Self { + Self { + miner: lotus_json.miner, + } + } +} + +impl_lotus_json_for_power_create_miner_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_power_update_claimed_power_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_power_enroll_cron_event_params!(8, 9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_power_update_pledge_total_params!(10, 11, 12, 13, 14, 15, 16, 17); +impl_lotus_json_for_power_miner_raw_power_params!(10, 11, 12, 13, 14, 15, 16, 17); diff --git a/src/lotus_json/actor_states/methods/reward_methods.rs b/src/lotus_json/actors/params/reward_params.rs similarity index 96% rename from src/lotus_json/actor_states/methods/reward_methods.rs rename to src/lotus_json/actors/params/reward_params.rs index e71d3177ba3e..004dbd3cce64 100644 --- a/src/lotus_json/actor_states/methods/reward_methods.rs +++ b/src/lotus_json/actors/params/reward_params.rs @@ -173,8 +173,8 @@ macro_rules! impl_update_network_kpi_params { }; } -impl_reward_constructor_params!(fvm_shared4::bigint: 16, 15, 14, 13, 12); +impl_reward_constructor_params!(fvm_shared4::bigint: 17, 16, 15, 14, 13, 12); impl_reward_constructor_params!(fvm_shared3::bigint: 11); -impl_award_block_reward_params!(16, 15, 14, 13, 12, 11, 10, 9, 8); -impl_update_network_kpi_params!(fvm_shared4::bigint: 16, 15, 14, 13, 12); +impl_award_block_reward_params!(17, 16, 15, 14, 13, 12, 11, 10, 9, 8); +impl_update_network_kpi_params!(fvm_shared4::bigint: 17, 16, 15, 14, 13, 12); impl_update_network_kpi_params!(fvm_shared3::bigint: 11); diff --git a/src/lotus_json/actor_states/methods/verified_reg_actor.rs b/src/lotus_json/actors/params/verified_reg_params.rs similarity index 99% rename from src/lotus_json/actor_states/methods/verified_reg_actor.rs rename to src/lotus_json/actors/params/verified_reg_params.rs index 06d86ba03102..a358e03c9f85 100644 --- a/src/lotus_json/actor_states/methods/verified_reg_actor.rs +++ b/src/lotus_json/actors/params/verified_reg_params.rs @@ -1236,20 +1236,20 @@ impl HasLotusJson for fil_actor_verifreg_state::v9::AddVerifierClientParams { } } -impl_constructor_params!(11, 12, 13, 14, 15, 16); -impl_verifier_params!(10, 11, 12, 13, 14, 15, 16); // Exclude v8,v9 due to different param names -impl_remove_verifier_params!(11, 12, 13, 14, 15, 16); -impl_remove_expired_allocations_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_get_claims_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_remove_expired_claims_params!(9, 10, 11, 12, 13, 14, 15, 16); -impl_extend_claim_terms_params!(9, 10, 11, 12, 13, 14, 15, 16); +impl_constructor_params!(11, 12, 13, 14, 15, 16, 17); +impl_verifier_params!(10, 11, 12, 13, 14, 15, 16, 17); // Exclude v8,v9 due to different param names +impl_remove_verifier_params!(11, 12, 13, 14, 15, 16, 17); +impl_remove_expired_allocations_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_get_claims_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_remove_expired_claims_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); +impl_extend_claim_terms_params!(9, 10, 11, 12, 13, 14, 15, 16, 17); impl_remove_data_cap_params_v2!(8, 9); impl_remove_data_cap_params_v3!(10, 11); -impl_remove_data_cap_params_v4!(12, 13, 14, 15, 16); +impl_remove_data_cap_params_v4!(12, 13, 14, 15, 16, 17); impl_claim_allocations_params_v11!(fvm_shared2: 9); impl_claim_allocations_params_v11!(fvm_shared3: 10, 11); -impl_claim_allocations_params_v12_plus!(fvm_shared4: 12, 13, 14, 15, 16); -impl_allocation_requests!(fvm_shared4: 12, 13, 14, 15, 16); +impl_claim_allocations_params_v12_plus!(fvm_shared4: 12, 13, 14, 15, 16, 17); +impl_allocation_requests!(fvm_shared4: 12, 13, 14, 15, 16, 17); impl_allocation_requests!(fvm_shared3: 11); diff --git a/src/lotus_json/actor_states/account_state.rs b/src/lotus_json/actors/states/account_state.rs similarity index 100% rename from src/lotus_json/actor_states/account_state.rs rename to src/lotus_json/actors/states/account_state.rs diff --git a/src/lotus_json/actor_states/cron_state.rs b/src/lotus_json/actors/states/cron_state.rs similarity index 100% rename from src/lotus_json/actor_states/cron_state.rs rename to src/lotus_json/actors/states/cron_state.rs diff --git a/src/lotus_json/actor_states/datacap_state.rs b/src/lotus_json/actors/states/datacap_state.rs similarity index 100% rename from src/lotus_json/actor_states/datacap_state.rs rename to src/lotus_json/actors/states/datacap_state.rs diff --git a/src/lotus_json/actor_states/evm_state.rs b/src/lotus_json/actors/states/evm_state.rs similarity index 100% rename from src/lotus_json/actor_states/evm_state.rs rename to src/lotus_json/actors/states/evm_state.rs diff --git a/src/lotus_json/actor_states/init_state.rs b/src/lotus_json/actors/states/init_state.rs similarity index 100% rename from src/lotus_json/actor_states/init_state.rs rename to src/lotus_json/actors/states/init_state.rs diff --git a/src/lotus_json/actor_states/market_state.rs b/src/lotus_json/actors/states/market_state.rs similarity index 100% rename from src/lotus_json/actor_states/market_state.rs rename to src/lotus_json/actors/states/market_state.rs diff --git a/src/lotus_json/actor_states/miner_state.rs b/src/lotus_json/actors/states/miner_state.rs similarity index 100% rename from src/lotus_json/actor_states/miner_state.rs rename to src/lotus_json/actors/states/miner_state.rs diff --git a/src/lotus_json/actor_states/mod.rs b/src/lotus_json/actors/states/mod.rs similarity index 96% rename from src/lotus_json/actor_states/mod.rs rename to src/lotus_json/actors/states/mod.rs index bcc7fa747475..296bc47b4cf3 100644 --- a/src/lotus_json/actor_states/mod.rs +++ b/src/lotus_json/actors/states/mod.rs @@ -1,5 +1,6 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT + use super::*; mod account_state; mod cron_state; @@ -7,7 +8,6 @@ mod datacap_state; mod evm_state; mod init_state; mod market_state; -mod methods; mod miner_state; mod multisig_state; mod payment_channel_state; diff --git a/src/lotus_json/actor_states/multisig_state.rs b/src/lotus_json/actors/states/multisig_state.rs similarity index 100% rename from src/lotus_json/actor_states/multisig_state.rs rename to src/lotus_json/actors/states/multisig_state.rs diff --git a/src/lotus_json/actor_states/payment_channel_state.rs b/src/lotus_json/actors/states/payment_channel_state.rs similarity index 100% rename from src/lotus_json/actor_states/payment_channel_state.rs rename to src/lotus_json/actors/states/payment_channel_state.rs diff --git a/src/lotus_json/actor_states/power_states.rs b/src/lotus_json/actors/states/power_states.rs similarity index 100% rename from src/lotus_json/actor_states/power_states.rs rename to src/lotus_json/actors/states/power_states.rs diff --git a/src/lotus_json/actor_states/reward_state.rs b/src/lotus_json/actors/states/reward_state.rs similarity index 100% rename from src/lotus_json/actor_states/reward_state.rs rename to src/lotus_json/actors/states/reward_state.rs diff --git a/src/lotus_json/actor_states/system_state.rs b/src/lotus_json/actors/states/system_state.rs similarity index 100% rename from src/lotus_json/actor_states/system_state.rs rename to src/lotus_json/actors/states/system_state.rs diff --git a/src/lotus_json/actor_states/verified_reg_state.rs b/src/lotus_json/actors/states/verified_reg_state.rs similarity index 100% rename from src/lotus_json/actor_states/verified_reg_state.rs rename to src/lotus_json/actors/states/verified_reg_state.rs diff --git a/src/lotus_json/actor_states/vesting_funds.rs b/src/lotus_json/actors/states/vesting_funds.rs similarity index 100% rename from src/lotus_json/actor_states/vesting_funds.rs rename to src/lotus_json/actors/states/vesting_funds.rs diff --git a/src/lotus_json/mod.rs b/src/lotus_json/mod.rs index 345bae794644..868e5cdbd249 100644 --- a/src/lotus_json/mod.rs +++ b/src/lotus_json/mod.rs @@ -218,7 +218,7 @@ decl_and_test!( // If a module cannot be tested normally above, you MAY declare it separately here // but you MUST document any tech debt - the reason WHY it cannot be tested above. -mod actor_states; +mod actors; mod allocation; mod beneficiary_term; // fil_actor_miner_state::v12::BeneficiaryTerm: !quickcheck::Arbitrary mod bit_field; // fil_actors_shared::fvm_ipld_bitfield::BitField: !quickcheck::Arbitrary diff --git a/src/rpc/registry/actors/account.rs b/src/rpc/registry/actors/account.rs index dce848fa62a4..0c0b57afdea8 100644 --- a/src/rpc/registry/actors/account.rs +++ b/src/rpc/registry/actors/account.rs @@ -2,12 +2,59 @@ // SPDX-License-Identifier: Apache-2.0, MIT use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; +use crate::shim::address::Address; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; -/// Macro to generate account method registration for different versions -macro_rules! register_account_version { - // For versions that use types module (v15, v16) +fn register_account_version_v8(registry: &mut MethodRegistry, cid: Cid) { + use fil_actor_account_state::v8::Method; + + register_actor_methods!(registry, cid, [(Method::Constructor, Address),]); + register_actor_methods!(registry, cid, [(Method::PubkeyAddress, empty)]); +} + +fn register_account_version_v9(registry: &mut MethodRegistry, cid: Cid) { + use fil_actor_account_state::v9::{AuthenticateMessageParams, Method}; + register_actor_methods!( + registry, + cid, + [ + (Method::Constructor, Address), + (Method::AuthenticateMessage, AuthenticateMessageParams) + ] + ); + + register_actor_methods!( + registry, + cid, + [ + (Method::PubkeyAddress, empty), + (Method::UniversalReceiverHook, empty) + ] + ); +} + +fn register_account_version_10(registry: &mut MethodRegistry, cid: Cid) { + use fil_actor_account_state::v10::{AuthenticateMessageParams, Method}; + + register_actor_methods!( + registry, + cid, + [ + (Method::Constructor, Address), + ( + Method::AuthenticateMessageExported, + AuthenticateMessageParams + ) + ] + ); + + register_actor_methods!(registry, cid, [(Method::PubkeyAddress, empty)]); +} + +macro_rules! register_account_version_11_onwards { + // For versions that use types module (v15 onwards) ($registry:expr, $code_cid:expr, $state_version:path, with_types) => {{ use $state_version::{Method, types}; @@ -22,6 +69,8 @@ macro_rules! register_account_version { ) ] ); + + register_actor_methods!($registry, $code_cid, [(Method::PubkeyAddress, empty)]); }}; // For versions that don't use types module (v11-v14) @@ -39,6 +88,8 @@ macro_rules! register_account_version { ) ] ); + + register_actor_methods!($registry, $code_cid, [(Method::PubkeyAddress, empty)]); }}; } @@ -46,15 +97,47 @@ macro_rules! register_account_version { pub(crate) fn register_account_actor_methods( registry: &mut MethodRegistry, cid: Cid, - version: u64, + version: ActorVersion, ) { match version { - 11 => register_account_version!(registry, cid, fil_actor_account_state::v11), - 12 => register_account_version!(registry, cid, fil_actor_account_state::v12), - 13 => register_account_version!(registry, cid, fil_actor_account_state::v13), - 14 => register_account_version!(registry, cid, fil_actor_account_state::v14), - 15 => register_account_version!(registry, cid, fil_actor_account_state::v15, with_types), - 16 => register_account_version!(registry, cid, fil_actor_account_state::v16, with_types), - _ => {} + ActorVersion::V8 => register_account_version_v8(registry, cid), + ActorVersion::V9 => register_account_version_v9(registry, cid), + ActorVersion::V10 => register_account_version_10(registry, cid), + ActorVersion::V11 => { + register_account_version_11_onwards!(registry, cid, fil_actor_account_state::v11) + } + ActorVersion::V12 => { + register_account_version_11_onwards!(registry, cid, fil_actor_account_state::v12) + } + ActorVersion::V13 => { + register_account_version_11_onwards!(registry, cid, fil_actor_account_state::v13) + } + ActorVersion::V14 => { + register_account_version_11_onwards!(registry, cid, fil_actor_account_state::v14) + } + ActorVersion::V15 => { + register_account_version_11_onwards!( + registry, + cid, + fil_actor_account_state::v15, + with_types + ) + } + ActorVersion::V16 => { + register_account_version_11_onwards!( + registry, + cid, + fil_actor_account_state::v16, + with_types + ) + } + ActorVersion::V17 => { + register_account_version_11_onwards!( + registry, + cid, + fil_actor_account_state::v17, + with_types + ) + } } } diff --git a/src/rpc/registry/actors/cron.rs b/src/rpc/registry/actors/cron.rs index 56117b2afbaf..f4efc581aadd 100644 --- a/src/rpc/registry/actors/cron.rs +++ b/src/rpc/registry/actors/cron.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_cron_version { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -20,17 +21,21 @@ macro_rules! register_cron_version { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_cron_version!(registry, cid, fil_actor_cron_state::v8), - 9 => register_cron_version!(registry, cid, fil_actor_cron_state::v9), - 10 => register_cron_version!(registry, cid, fil_actor_cron_state::v10), - 11 => register_cron_version!(registry, cid, fil_actor_cron_state::v11), - 12 => register_cron_version!(registry, cid, fil_actor_cron_state::v12), - 13 => register_cron_version!(registry, cid, fil_actor_cron_state::v13), - 14 => register_cron_version!(registry, cid, fil_actor_cron_state::v14), - 15 => register_cron_version!(registry, cid, fil_actor_cron_state::v15), - 16 => register_cron_version!(registry, cid, fil_actor_cron_state::v16), - _ => {} + ActorVersion::V8 => register_cron_version!(registry, cid, fil_actor_cron_state::v8), + ActorVersion::V9 => register_cron_version!(registry, cid, fil_actor_cron_state::v9), + ActorVersion::V10 => register_cron_version!(registry, cid, fil_actor_cron_state::v10), + ActorVersion::V11 => register_cron_version!(registry, cid, fil_actor_cron_state::v11), + ActorVersion::V12 => register_cron_version!(registry, cid, fil_actor_cron_state::v12), + ActorVersion::V13 => register_cron_version!(registry, cid, fil_actor_cron_state::v13), + ActorVersion::V14 => register_cron_version!(registry, cid, fil_actor_cron_state::v14), + ActorVersion::V15 => register_cron_version!(registry, cid, fil_actor_cron_state::v15), + ActorVersion::V16 => register_cron_version!(registry, cid, fil_actor_cron_state::v16), + ActorVersion::V17 => register_cron_version!(registry, cid, fil_actor_cron_state::v17), } } diff --git a/src/rpc/registry/actors/datacap.rs b/src/rpc/registry/actors/datacap.rs index d21bd4b22bed..7a50653ea169 100644 --- a/src/rpc/registry/actors/datacap.rs +++ b/src/rpc/registry/actors/datacap.rs @@ -5,6 +5,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::address::Address; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_datacap_v9 { ($registry:expr, $code_cid:expr) => {{ @@ -125,17 +126,18 @@ macro_rules! register_datacap_version { pub(crate) fn register_datacap_actor_methods( registry: &mut MethodRegistry, cid: Cid, - version: u64, + version: ActorVersion, ) { match version { - 9 => register_datacap_v9!(registry, cid), - 10 => register_datacap_v10!(registry, cid), - 11 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v11), - 12 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v12), - 13 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v13), - 14 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v14), - 15 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v15), - 16 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v16), - _ => {} + ActorVersion::V8 => {} + ActorVersion::V9 => register_datacap_v9!(registry, cid), + ActorVersion::V10 => register_datacap_v10!(registry, cid), + ActorVersion::V11 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v11), + ActorVersion::V12 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v12), + ActorVersion::V13 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v13), + ActorVersion::V14 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v14), + ActorVersion::V15 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v15), + ActorVersion::V16 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v16), + ActorVersion::V17 => register_datacap_version!(registry, cid, fil_actor_datacap_state::v17), } } diff --git a/src/rpc/registry/actors/eam.rs b/src/rpc/registry/actors/eam.rs index a02bd8b9e80f..d2e6b3b9bef7 100644 --- a/src/rpc/registry/actors/eam.rs +++ b/src/rpc/registry/actors/eam.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_eam_reg_version { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -24,15 +25,22 @@ macro_rules! register_eam_reg_version { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 10 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v10), - 11 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v11), - 12 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v12), - 13 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v13), - 14 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v14), - 15 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v15), - 16 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v16), - _ => {} + ActorVersion::V8 | ActorVersion::V9 => { + // EAM actor was introduced in V10, so V8 and V9 don't have EAM actors + } + ActorVersion::V10 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v10), + ActorVersion::V11 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v11), + ActorVersion::V12 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v12), + ActorVersion::V13 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v13), + ActorVersion::V14 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v14), + ActorVersion::V15 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v15), + ActorVersion::V16 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v16), + ActorVersion::V17 => register_eam_reg_version!(registry, cid, fil_actor_eam_state::v17), } } diff --git a/src/rpc/registry/actors/eth_account.rs b/src/rpc/registry/actors/eth_account.rs index 86749e8c5acb..c48fb501ffe2 100644 --- a/src/rpc/registry/actors/eth_account.rs +++ b/src/rpc/registry/actors/eth_account.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_eth_account_reg_version { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -14,15 +15,36 @@ macro_rules! register_eth_account_reg_version { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 10 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v10), - 11 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v11), - 12 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v12), - 13 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v13), - 14 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v14), - 15 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v15), - 16 => register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v16), - _ => {} + ActorVersion::V8 | ActorVersion::V9 => {} + ActorVersion::V10 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v10) + } + ActorVersion::V11 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v11) + } + ActorVersion::V12 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v12) + } + ActorVersion::V13 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v13) + } + ActorVersion::V14 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v14) + } + ActorVersion::V15 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v15) + } + ActorVersion::V16 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v16) + } + ActorVersion::V17 => { + register_eth_account_reg_version!(registry, cid, fil_actor_ethaccount_state::v17) + } } } diff --git a/src/rpc/registry/actors/evm.rs b/src/rpc/registry/actors/evm.rs index d2536d18fc38..069e6efa63f8 100644 --- a/src/rpc/registry/actors/evm.rs +++ b/src/rpc/registry/actors/evm.rs @@ -5,6 +5,7 @@ use crate::rpc::eth::types::GetStorageAtParams; use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; use fvm_ipld_encoding::RawBytes; macro_rules! register_evm_version { @@ -39,15 +40,20 @@ macro_rules! register_evm_version { }}; } -pub(crate) fn register_evm_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_evm_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 10 => register_evm_version!(registry, cid, fil_actor_evm_state::v10), - 11 => register_evm_version!(registry, cid, fil_actor_evm_state::v11), - 12 => register_evm_version!(registry, cid, fil_actor_evm_state::v12), - 13 => register_evm_version!(registry, cid, fil_actor_evm_state::v13), - 14 => register_evm_version!(registry, cid, fil_actor_evm_state::v14), - 15 => register_evm_version!(registry, cid, fil_actor_evm_state::v15), - 16 => register_evm_version!(registry, cid, fil_actor_evm_state::v16), - _ => {} + ActorVersion::V8 | ActorVersion::V9 => {} + ActorVersion::V10 => register_evm_version!(registry, cid, fil_actor_evm_state::v10), + ActorVersion::V11 => register_evm_version!(registry, cid, fil_actor_evm_state::v11), + ActorVersion::V12 => register_evm_version!(registry, cid, fil_actor_evm_state::v12), + ActorVersion::V13 => register_evm_version!(registry, cid, fil_actor_evm_state::v13), + ActorVersion::V14 => register_evm_version!(registry, cid, fil_actor_evm_state::v14), + ActorVersion::V15 => register_evm_version!(registry, cid, fil_actor_evm_state::v15), + ActorVersion::V16 => register_evm_version!(registry, cid, fil_actor_evm_state::v16), + ActorVersion::V17 => register_evm_version!(registry, cid, fil_actor_evm_state::v17), } } diff --git a/src/rpc/registry/actors/init.rs b/src/rpc/registry/actors/init.rs index af06ef04c449..17cba4de35d6 100644 --- a/src/rpc/registry/actors/init.rs +++ b/src/rpc/registry/actors/init.rs @@ -4,9 +4,10 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; -// Macro for versions 8-10 that only have Exec method -macro_rules! register_init_versions_8_to_10 { +// Macro for versions 8-9 that only have Exec method +macro_rules! register_init_versions_8_to_9 { ($registry:expr, $code_cid:expr, $state_version:path) => {{ use $state_version::{ConstructorParams, ExecParams, Method}; @@ -21,8 +22,8 @@ macro_rules! register_init_versions_8_to_10 { }}; } -// Macro for versions 11-16 that have Exec4 -macro_rules! register_init_versions_11_to_16 { +// Macro for versions 10 onwards that have Exec4 +macro_rules! register_init_versions_10_onwards { ($registry:expr, $code_cid:expr, $state_version:path) => {{ use $state_version::{ConstructorParams, Exec4Params, ExecParams, Method}; @@ -38,17 +39,41 @@ macro_rules! register_init_versions_11_to_16 { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_init_versions_8_to_10!(registry, cid, fil_actor_init_state::v8), - 9 => register_init_versions_8_to_10!(registry, cid, fil_actor_init_state::v9), - 10 => register_init_versions_8_to_10!(registry, cid, fil_actor_init_state::v10), - 11 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v11), - 12 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v12), - 13 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v13), - 14 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v14), - 15 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v15), - 16 => register_init_versions_11_to_16!(registry, cid, fil_actor_init_state::v16), - _ => {} + ActorVersion::V8 => { + register_init_versions_8_to_9!(registry, cid, fil_actor_init_state::v8) + } + ActorVersion::V9 => { + register_init_versions_8_to_9!(registry, cid, fil_actor_init_state::v9) + } + ActorVersion::V10 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v10) + } + ActorVersion::V11 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v11) + } + ActorVersion::V12 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v12) + } + ActorVersion::V13 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v13) + } + ActorVersion::V14 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v14) + } + ActorVersion::V15 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v15) + } + ActorVersion::V16 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v16) + } + ActorVersion::V17 => { + register_init_versions_10_onwards!(registry, cid, fil_actor_init_state::v17) + } } } diff --git a/src/rpc/registry/actors/market.rs b/src/rpc/registry/actors/market.rs index 3a752849d525..9a811feed5ee 100644 --- a/src/rpc/registry/actors/market.rs +++ b/src/rpc/registry/actors/market.rs @@ -5,6 +5,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::address::Address; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_market_basic_methods { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -174,18 +175,41 @@ macro_rules! register_market_versions_onwards { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_market_versions_8_to_9!(registry, cid, fil_actor_market_state::v8), - 9 => register_market_versions_8_to_9!(registry, cid, fil_actor_market_state::v9), - 10 => register_market_versions_10_to_11!(registry, cid, fil_actor_market_state::v10), - 11 => register_market_versions_10_to_11!(registry, cid, fil_actor_market_state::v11), - 12 => register_market_versions_12!(registry, cid, fil_actor_market_state::v12), - 13 => register_market_versions_onwards!(registry, cid, fil_actor_market_state::v13), - 14 => register_market_versions_onwards!(registry, cid, fil_actor_market_state::v14), - 15 => register_market_versions_onwards!(registry, cid, fil_actor_market_state::v15), - 16 => register_market_versions_onwards!(registry, cid, fil_actor_market_state::v16), - 17 => register_market_versions_onwards!(registry, cid, fil_actor_market_state::v17), - _ => {} + ActorVersion::V8 => { + register_market_versions_8_to_9!(registry, cid, fil_actor_market_state::v8) + } + ActorVersion::V9 => { + register_market_versions_8_to_9!(registry, cid, fil_actor_market_state::v9) + } + ActorVersion::V10 => { + register_market_versions_10_to_11!(registry, cid, fil_actor_market_state::v10) + } + ActorVersion::V11 => { + register_market_versions_10_to_11!(registry, cid, fil_actor_market_state::v11) + } + ActorVersion::V12 => { + register_market_versions_12!(registry, cid, fil_actor_market_state::v12) + } + ActorVersion::V13 => { + register_market_versions_onwards!(registry, cid, fil_actor_market_state::v13) + } + ActorVersion::V14 => { + register_market_versions_onwards!(registry, cid, fil_actor_market_state::v14) + } + ActorVersion::V15 => { + register_market_versions_onwards!(registry, cid, fil_actor_market_state::v15) + } + ActorVersion::V16 => { + register_market_versions_onwards!(registry, cid, fil_actor_market_state::v16) + } + ActorVersion::V17 => { + register_market_versions_onwards!(registry, cid, fil_actor_market_state::v17) + } } } diff --git a/src/rpc/registry/actors/miner.rs b/src/rpc/registry/actors/miner.rs index 89ee822f4830..5a37067f5b98 100644 --- a/src/rpc/registry/actors/miner.rs +++ b/src/rpc/registry/actors/miner.rs @@ -5,6 +5,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::address::Address; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_miner_basic_methods { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -12,8 +13,7 @@ macro_rules! register_miner_basic_methods { ApplyRewardParams, ChangeMultiaddrsParams, ChangePeerIDParams, ChangeWorkerAddressParams, CheckSectorProvenParams, CompactPartitionsParams, CompactSectorNumbersParams, DeclareFaultsParams, DeclareFaultsRecoveredParams, - DeferredCronEventParams, DisputeWindowedPoStParams, ExtendSectorExpirationParams, - Method, MinerConstructorParams, ProveCommitAggregateParams, ProveReplicaUpdatesParams, + DeferredCronEventParams, DisputeWindowedPoStParams, Method, MinerConstructorParams, ReportConsensusFaultParams, SubmitWindowedPoStParams, TerminateSectorsParams, WithdrawBalanceParams, }; @@ -26,7 +26,6 @@ macro_rules! register_miner_basic_methods { (Method::ChangeWorkerAddress, ChangeWorkerAddressParams), (Method::ChangePeerID, ChangePeerIDParams), (Method::SubmitWindowedPoSt, SubmitWindowedPoStParams), - (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::TerminateSectors, TerminateSectorsParams), (Method::DeclareFaults, DeclareFaultsParams), (Method::DeclareFaultsRecovered, DeclareFaultsRecoveredParams), @@ -39,8 +38,6 @@ macro_rules! register_miner_basic_methods { (Method::CompactPartitions, CompactPartitionsParams), (Method::CompactSectorNumbers, CompactSectorNumbersParams), (Method::DisputeWindowedPoSt, DisputeWindowedPoStParams), - (Method::ProveCommitAggregate, ProveCommitAggregateParams), - (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); @@ -136,12 +133,30 @@ macro_rules! register_miner_common_method_v14_onwards { }}; } +macro_rules! register_miner_common_method_v16_onwards { + ($registry:expr, $code_cid:expr, $state_version:path) => {{ + use $state_version::{MaxTerminationFeeParams, Method}; + register_actor_methods!( + $registry, + $code_cid, + [(Method::MaxTerminationFeeExported, MaxTerminationFeeParams),] + ); + + register_actor_methods!( + $registry, + $code_cid, + [(Method::InitialPledgeExported, empty)] + ); + }}; +} + fn register_miner_version_8(registry: &mut MethodRegistry, cid: Cid) { register_miner_basic_methods!(registry, cid, fil_actor_miner_state::v8); use fil_actor_miner_state::v8::{ - ConfirmSectorProofsParams, Method, PreCommitSectorBatchParams, PreCommitSectorParams, - ProveCommitSectorParams, + ConfirmSectorProofsParams, ExtendSectorExpirationParams, Method, + PreCommitSectorBatchParams, PreCommitSectorParams, ProveCommitAggregateParams, + ProveCommitSectorParams, ProveReplicaUpdatesParams, }; register_actor_methods!( @@ -151,8 +166,11 @@ fn register_miner_version_8(registry: &mut MethodRegistry, cid: Cid) { (Method::ChangeOwnerAddress, Address), (Method::PreCommitSector, PreCommitSectorParams), (Method::ProveCommitSector, ProveCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::PreCommitSectorBatch, PreCommitSectorBatchParams), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); @@ -163,9 +181,10 @@ fn register_miner_version_9(registry: &mut MethodRegistry, cid: Cid) { register_miner_basic_methods!(registry, cid, fil_actor_miner_state::v9); use fil_actor_miner_state::v9::{ - ChangeBeneficiaryParams, ConfirmSectorProofsParams, ExtendSectorExpiration2Params, Method, - PreCommitSectorBatchParams, PreCommitSectorBatchParams2, PreCommitSectorParams, - ProveCommitSectorParams, ProveReplicaUpdatesParams2, + ChangeBeneficiaryParams, ConfirmSectorProofsParams, ExtendSectorExpiration2Params, + ExtendSectorExpirationParams, Method, PreCommitSectorBatchParams, + PreCommitSectorBatchParams2, PreCommitSectorParams, ProveCommitAggregateParams, + ProveCommitSectorParams, ProveReplicaUpdatesParams, ProveReplicaUpdatesParams2, }; register_actor_methods!( @@ -174,6 +193,7 @@ fn register_miner_version_9(registry: &mut MethodRegistry, cid: Cid) { [ (Method::PreCommitSector, PreCommitSectorParams), (Method::ProveCommitSector, ProveCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::PreCommitSectorBatch, PreCommitSectorBatchParams), (Method::PreCommitSectorBatch2, PreCommitSectorBatchParams2), (Method::ChangeOwnerAddress, Address), @@ -184,6 +204,8 @@ fn register_miner_version_9(registry: &mut MethodRegistry, cid: Cid) { ExtendSectorExpiration2Params ), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); @@ -201,9 +223,9 @@ fn register_miner_version_10(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v10); use fil_actor_miner_state::v10::{ - ConfirmSectorProofsParams, ExtendSectorExpiration2Params, Method, - PreCommitSectorBatchParams, PreCommitSectorParams, ProveCommitSectorParams, - ProveReplicaUpdatesParams2, + ConfirmSectorProofsParams, ExtendSectorExpiration2Params, ExtendSectorExpirationParams, + Method, PreCommitSectorBatchParams, PreCommitSectorParams, ProveCommitAggregateParams, + ProveCommitSectorParams, ProveReplicaUpdatesParams, ProveReplicaUpdatesParams2, }; register_actor_methods!( @@ -211,6 +233,7 @@ fn register_miner_version_10(registry: &mut MethodRegistry, cid: Cid) { cid, [ (Method::PreCommitSector, PreCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::ProveReplicaUpdates2, ProveReplicaUpdatesParams2), (Method::ProveCommitSector, ProveCommitSectorParams), (Method::PreCommitSectorBatch, PreCommitSectorBatchParams), @@ -221,6 +244,8 @@ fn register_miner_version_10(registry: &mut MethodRegistry, cid: Cid) { (Method::ChangeOwnerAddress, Address), (Method::ChangeOwnerAddressExported, Address), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); } @@ -229,8 +254,9 @@ fn register_miner_version_11(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v11); use fil_actor_miner_state::v11::{ - ChangeOwnerAddressParams, ConfirmSectorProofsParams, ExtendSectorExpiration2Params, Method, - PreCommitSectorBatchParams, PreCommitSectorParams, ProveCommitSectorParams, + ChangeOwnerAddressParams, ConfirmSectorProofsParams, ExtendSectorExpiration2Params, + ExtendSectorExpirationParams, Method, PreCommitSectorBatchParams, PreCommitSectorParams, + ProveCommitAggregateParams, ProveCommitSectorParams, ProveReplicaUpdatesParams, ProveReplicaUpdatesParams2, }; @@ -239,6 +265,7 @@ fn register_miner_version_11(registry: &mut MethodRegistry, cid: Cid) { cid, [ (Method::PreCommitSector, PreCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::ProveReplicaUpdates2, ProveReplicaUpdatesParams2), (Method::ProveCommitSector, ProveCommitSectorParams), (Method::PreCommitSectorBatch, PreCommitSectorBatchParams), @@ -249,6 +276,8 @@ fn register_miner_version_11(registry: &mut MethodRegistry, cid: Cid) { (Method::ChangeOwnerAddress, ChangeOwnerAddressParams), (Method::ChangeOwnerAddressExported, ChangeOwnerAddressParams), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); } @@ -257,8 +286,9 @@ fn register_miner_version_12(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v12); use fil_actor_miner_state::v12::{ - ChangeOwnerAddressParams, ConfirmSectorProofsParams, Method, PreCommitSectorBatchParams, - PreCommitSectorParams, ProveCommitSectorParams, ProveReplicaUpdatesParams2, + ChangeOwnerAddressParams, ConfirmSectorProofsParams, ExtendSectorExpirationParams, Method, + PreCommitSectorBatchParams, PreCommitSectorParams, ProveCommitAggregateParams, + ProveCommitSectorParams, ProveReplicaUpdatesParams, ProveReplicaUpdatesParams2, }; register_actor_methods!( registry, @@ -267,10 +297,13 @@ fn register_miner_version_12(registry: &mut MethodRegistry, cid: Cid) { (Method::PreCommitSector, PreCommitSectorParams), (Method::ProveReplicaUpdates2, ProveReplicaUpdatesParams2), (Method::ProveCommitSector, ProveCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::PreCommitSectorBatch, PreCommitSectorBatchParams), (Method::ChangeOwnerAddress, ChangeOwnerAddressParams), (Method::ChangeOwnerAddressExported, ChangeOwnerAddressParams), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); } @@ -279,18 +312,22 @@ fn register_miner_version_13(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v13); use fil_actor_miner_state::v13::{ - ChangeOwnerAddressParams, ConfirmSectorProofsParams, Method, ProveCommitSectorParams, - ProveCommitSectors3Params, + ChangeOwnerAddressParams, ConfirmSectorProofsParams, ExtendSectorExpirationParams, Method, + ProveCommitAggregateParams, ProveCommitSectorParams, ProveCommitSectors3Params, + ProveReplicaUpdatesParams, }; register_actor_methods!( registry, cid, [ (Method::ProveCommitSector, ProveCommitSectorParams), + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), (Method::ProveCommitSectors3, ProveCommitSectors3Params), (Method::ChangeOwnerAddress, ChangeOwnerAddressParams), (Method::ChangeOwnerAddressExported, ChangeOwnerAddressParams), (Method::ConfirmSectorProofsValid, ConfirmSectorProofsParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), ] ); } @@ -298,38 +335,77 @@ fn register_miner_version_13(registry: &mut MethodRegistry, cid: Cid) { fn register_miner_versions_14(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v14); register_miner_common_method_v14_onwards!(registry, cid, fil_actor_miner_state::v14); + use fil_actor_miner_state::v14::{ + ExtendSectorExpirationParams, Method, ProveCommitAggregateParams, ProveReplicaUpdatesParams, + }; + register_actor_methods!( + registry, + cid, + [ + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), + ] + ); } fn register_miner_version_15(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v15); register_miner_common_method_v14_onwards!(registry, cid, fil_actor_miner_state::v15); + use fil_actor_miner_state::v15::{ + ExtendSectorExpirationParams, Method, ProveCommitAggregateParams, ProveReplicaUpdatesParams, + }; + register_actor_methods!( + registry, + cid, + [ + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), + ] + ); } fn register_miner_version_16(registry: &mut MethodRegistry, cid: Cid) { register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v16); register_miner_common_method_v14_onwards!(registry, cid, fil_actor_miner_state::v16); + register_miner_common_method_v16_onwards!(registry, cid, fil_actor_miner_state::v16); - use fil_actor_miner_state::v16::{MaxTerminationFeeParams, Method}; + use fil_actor_miner_state::v16::{ + ExtendSectorExpirationParams, Method, ProveCommitAggregateParams, ProveReplicaUpdatesParams, + }; register_actor_methods!( registry, cid, - [(Method::MaxTerminationFeeExported, MaxTerminationFeeParams),] + [ + (Method::ExtendSectorExpiration, ExtendSectorExpirationParams), + (Method::ProveCommitAggregate, ProveCommitAggregateParams), + (Method::ProveReplicaUpdates, ProveReplicaUpdatesParams), + ] ); +} - register_actor_methods!(registry, cid, [(Method::InitialPledgeExported, empty)]); +fn register_miner_version_17(registry: &mut MethodRegistry, cid: Cid) { + register_miner_common_methods_v10_onwards!(registry, cid, fil_actor_miner_state::v17); + register_miner_common_method_v14_onwards!(registry, cid, fil_actor_miner_state::v17); + register_miner_common_method_v16_onwards!(registry, cid, fil_actor_miner_state::v17); } -pub(crate) fn register_miner_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_miner_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_miner_version_8(registry, cid), - 9 => register_miner_version_9(registry, cid), - 10 => register_miner_version_10(registry, cid), - 11 => register_miner_version_11(registry, cid), - 12 => register_miner_version_12(registry, cid), - 13 => register_miner_version_13(registry, cid), - 14 => register_miner_versions_14(registry, cid), - 15 => register_miner_version_15(registry, cid), - 16 => register_miner_version_16(registry, cid), - _ => {} + ActorVersion::V8 => register_miner_version_8(registry, cid), + ActorVersion::V9 => register_miner_version_9(registry, cid), + ActorVersion::V10 => register_miner_version_10(registry, cid), + ActorVersion::V11 => register_miner_version_11(registry, cid), + ActorVersion::V12 => register_miner_version_12(registry, cid), + ActorVersion::V13 => register_miner_version_13(registry, cid), + ActorVersion::V14 => register_miner_versions_14(registry, cid), + ActorVersion::V15 => register_miner_version_15(registry, cid), + ActorVersion::V16 => register_miner_version_16(registry, cid), + ActorVersion::V17 => register_miner_version_17(registry, cid), } } diff --git a/src/rpc/registry/actors/multisig.rs b/src/rpc/registry/actors/multisig.rs index b7b6c689ce6a..7e56c1170dae 100644 --- a/src/rpc/registry/actors/multisig.rs +++ b/src/rpc/registry/actors/multisig.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; // Macro for version 8 that doesn't have UniversalReceiverHook macro_rules! register_multisig_v8 { @@ -72,17 +73,37 @@ macro_rules! register_multisig_v9_plus { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_multisig_v8!(registry, cid, fil_actor_multisig_state::v8), - 9 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v9), - 10 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v10), - 11 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v11), - 12 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v12), - 13 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v13), - 14 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v14), - 15 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v15), - 16 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v16), - _ => {} + ActorVersion::V8 => register_multisig_v8!(registry, cid, fil_actor_multisig_state::v8), + ActorVersion::V9 => register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v9), + ActorVersion::V10 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v10) + } + ActorVersion::V11 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v11) + } + ActorVersion::V12 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v12) + } + ActorVersion::V13 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v13) + } + ActorVersion::V14 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v14) + } + ActorVersion::V15 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v15) + } + ActorVersion::V16 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v16) + } + ActorVersion::V17 => { + register_multisig_v9_plus!(registry, cid, fil_actor_multisig_state::v17) + } } } diff --git a/src/rpc/registry/actors/payment_channel.rs b/src/rpc/registry/actors/payment_channel.rs index 7176c4484d60..9d49c0ce4604 100644 --- a/src/rpc/registry/actors/payment_channel.rs +++ b/src/rpc/registry/actors/payment_channel.rs @@ -4,12 +4,12 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; -macro_rules! register_payment_channel_reg_versions { - ($registry:expr, $code_cid:expr, $version:literal) => {{ - paste::paste!{ - use fil_actor_paych_state::[]::{ConstructorParams, Method, UpdateChannelStateParams}; - } +// Payment channel methods are consistent across all versions V8-V16 +macro_rules! register_payment_channel_methods { + ($registry:expr, $code_cid:expr, $state_version:path) => {{ + use $state_version::{ConstructorParams, Method, UpdateChannelStateParams}; // Register methods with parameters register_actor_methods!( @@ -30,16 +30,41 @@ macro_rules! register_payment_channel_reg_versions { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { - macro_rules! register_versions { - ($($version:literal),+) => {{ - match version { - $( - $version => register_payment_channel_reg_versions!(registry, cid, $version), - )+ - _ => {} - } - }}; +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { + match version { + ActorVersion::V8 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v8) + } + ActorVersion::V9 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v9) + } + ActorVersion::V10 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v10) + } + ActorVersion::V11 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v11) + } + ActorVersion::V12 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v12) + } + ActorVersion::V13 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v13) + } + ActorVersion::V14 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v14) + } + ActorVersion::V15 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v15) + } + ActorVersion::V16 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v16) + } + ActorVersion::V17 => { + register_payment_channel_methods!(registry, cid, fil_actor_paych_state::v17) + } } - register_versions!(8, 9, 10, 11, 12, 13, 14, 15, 16) } diff --git a/src/rpc/registry/actors/power.rs b/src/rpc/registry/actors/power.rs index 50b0a1b06472..461f5e8c34bf 100644 --- a/src/rpc/registry/actors/power.rs +++ b/src/rpc/registry/actors/power.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; // Macro for versions 8-9 that have limited methods macro_rules! register_power_versions_8_to_9 { @@ -75,7 +76,7 @@ macro_rules! register_power_versions_10_to_15 { } // Macro for version 16 that has all methods -macro_rules! register_power_version_16 { +macro_rules! register_power_version_16_onwards { ($registry:expr, $code_cid:expr, $state_version:path) => {{ use $state_version::{ CreateMinerParams, EnrollCronEventParams, Method, MinerPowerParams, @@ -113,17 +114,41 @@ macro_rules! register_power_version_16 { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_power_versions_8_to_9!(registry, cid, fil_actor_power_state::v8), - 9 => register_power_versions_8_to_9!(registry, cid, fil_actor_power_state::v9), - 10 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v10), - 11 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v11), - 12 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v12), - 13 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v13), - 14 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v14), - 15 => register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v15), - 16 => register_power_version_16!(registry, cid, fil_actor_power_state::v16), - _ => {} + ActorVersion::V8 => { + register_power_versions_8_to_9!(registry, cid, fil_actor_power_state::v8) + } + ActorVersion::V9 => { + register_power_versions_8_to_9!(registry, cid, fil_actor_power_state::v9) + } + ActorVersion::V10 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v10) + } + ActorVersion::V11 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v11) + } + ActorVersion::V12 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v12) + } + ActorVersion::V13 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v13) + } + ActorVersion::V14 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v14) + } + ActorVersion::V15 => { + register_power_versions_10_to_15!(registry, cid, fil_actor_power_state::v15) + } + ActorVersion::V16 => { + register_power_version_16_onwards!(registry, cid, fil_actor_power_state::v16) + } + ActorVersion::V17 => { + register_power_version_16_onwards!(registry, cid, fil_actor_power_state::v17) + } } } diff --git a/src/rpc/registry/actors/reward.rs b/src/rpc/registry/actors/reward.rs index 344459dc94d0..bc9f6f41b69b 100644 --- a/src/rpc/registry/actors/reward.rs +++ b/src/rpc/registry/actors/reward.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_reward_version_11_to_16 { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -46,15 +47,19 @@ macro_rules! register_reward_version_8_to_10 { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => { + ActorVersion::V8 => { register_reward_version_8_to_10!(registry, cid, fil_actor_reward_state::v8, fvm_shared2) } - 9 => { + ActorVersion::V9 => { register_reward_version_8_to_10!(registry, cid, fil_actor_reward_state::v9, fvm_shared2) } - 10 => { + ActorVersion::V10 => { register_reward_version_8_to_10!( registry, cid, @@ -62,12 +67,26 @@ pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, ve fvm_shared3 ) } - 11 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v11), - 12 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v12), - 13 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v13), - 14 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v14), - 15 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v15), - 16 => register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v16), - _ => {} + ActorVersion::V11 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v11) + } + ActorVersion::V12 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v12) + } + ActorVersion::V13 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v13) + } + ActorVersion::V14 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v14) + } + ActorVersion::V15 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v15) + } + ActorVersion::V16 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v16) + } + ActorVersion::V17 => { + register_reward_version_11_to_16!(registry, cid, fil_actor_reward_state::v17) + } } } diff --git a/src/rpc/registry/actors/system.rs b/src/rpc/registry/actors/system.rs index 2cf78002c41f..e6573d17fc1c 100644 --- a/src/rpc/registry/actors/system.rs +++ b/src/rpc/registry/actors/system.rs @@ -4,6 +4,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; macro_rules! register_system_version { ($registry:expr, $code_cid:expr, $state_version:path) => {{ @@ -19,17 +20,21 @@ macro_rules! register_system_version { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_system_version!(registry, cid, fil_actor_system_state::v8), - 9 => register_system_version!(registry, cid, fil_actor_system_state::v9), - 10 => register_system_version!(registry, cid, fil_actor_system_state::v10), - 11 => register_system_version!(registry, cid, fil_actor_system_state::v11), - 12 => register_system_version!(registry, cid, fil_actor_system_state::v12), - 13 => register_system_version!(registry, cid, fil_actor_system_state::v13), - 14 => register_system_version!(registry, cid, fil_actor_system_state::v14), - 15 => register_system_version!(registry, cid, fil_actor_system_state::v15), - 16 => register_system_version!(registry, cid, fil_actor_system_state::v16), - _ => {} + ActorVersion::V8 => register_system_version!(registry, cid, fil_actor_system_state::v8), + ActorVersion::V9 => register_system_version!(registry, cid, fil_actor_system_state::v9), + ActorVersion::V10 => register_system_version!(registry, cid, fil_actor_system_state::v10), + ActorVersion::V11 => register_system_version!(registry, cid, fil_actor_system_state::v11), + ActorVersion::V12 => register_system_version!(registry, cid, fil_actor_system_state::v12), + ActorVersion::V13 => register_system_version!(registry, cid, fil_actor_system_state::v13), + ActorVersion::V14 => register_system_version!(registry, cid, fil_actor_system_state::v14), + ActorVersion::V15 => register_system_version!(registry, cid, fil_actor_system_state::v15), + ActorVersion::V16 => register_system_version!(registry, cid, fil_actor_system_state::v16), + ActorVersion::V17 => register_system_version!(registry, cid, fil_actor_system_state::v17), } } diff --git a/src/rpc/registry/actors/verified_reg.rs b/src/rpc/registry/actors/verified_reg.rs index 719b789fad62..ee71ed12a681 100644 --- a/src/rpc/registry/actors/verified_reg.rs +++ b/src/rpc/registry/actors/verified_reg.rs @@ -5,6 +5,7 @@ use crate::rpc::registry::methods_reg::{MethodRegistry, register_actor_methods}; use crate::shim::address::Address; use crate::shim::message::MethodNum; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; use paste::paste; // Core methods present in all versions @@ -235,17 +236,33 @@ macro_rules! register_verified_reg_v12_plus { }}; } -pub(crate) fn register_actor_methods(registry: &mut MethodRegistry, cid: Cid, version: u64) { +pub(crate) fn register_actor_methods( + registry: &mut MethodRegistry, + cid: Cid, + version: ActorVersion, +) { match version { - 8 => register_verified_reg_v8(registry, cid), - 9 => register_verified_reg_v9(registry, cid), - 10 => register_verified_reg_v10(registry, cid), - 11 => register_verified_reg_v11(registry, cid), - 12 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v12, v12), - 13 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v13, v13), - 14 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v14, v14), - 15 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v15, v15), - 16 => register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v16, v16), - _ => {} + ActorVersion::V8 => register_verified_reg_v8(registry, cid), + ActorVersion::V9 => register_verified_reg_v9(registry, cid), + ActorVersion::V10 => register_verified_reg_v10(registry, cid), + ActorVersion::V11 => register_verified_reg_v11(registry, cid), + ActorVersion::V12 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v12, v12) + } + ActorVersion::V13 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v13, v13) + } + ActorVersion::V14 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v14, v14) + } + ActorVersion::V15 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v15, v15) + } + ActorVersion::V16 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v16, v16) + } + ActorVersion::V17 => { + register_verified_reg_v12_plus!(registry, cid, fil_actor_verifreg_state::v17, v17) + } } } diff --git a/src/rpc/registry/actors_reg.rs b/src/rpc/registry/actors_reg.rs index 83225e76b472..f990a51d4764 100644 --- a/src/rpc/registry/actors_reg.rs +++ b/src/rpc/registry/actors_reg.rs @@ -13,20 +13,23 @@ use crate::shim::machine::BuiltinActor; use ahash::{HashMap, HashMapExt}; use anyhow::{Context, Result, anyhow}; use cid::Cid; +use fil_actors_shared::actor_versions::ActorVersion; use fvm_ipld_blockstore::Blockstore; use serde_json::Value; use std::sync::LazyLock; #[derive(Debug)] pub struct ActorRegistry { - map: HashMap, + map: HashMap, } impl ActorRegistry { fn new() -> Self { let mut map = HashMap::new(); for ((_, _), metadata) in ACTOR_BUNDLES_METADATA.iter() { - if let Ok(version) = metadata.actor_major_version() { + if let Ok(version_u64) = metadata.actor_major_version() + && let Some(version) = ActorVersion::from_repr(version_u64 as u8) + { for (actor_type, cid) in metadata.manifest.builtin_actors() { map.insert(cid, (actor_type, version)); } @@ -35,7 +38,7 @@ impl ActorRegistry { Self { map } } - pub fn get_actor_details_from_code(code_cid: &Cid) -> Result<(BuiltinActor, u64)> { + pub fn get_actor_details_from_code(code_cid: &Cid) -> Result<(BuiltinActor, ActorVersion)> { ACTOR_REGISTRY .map .get(code_cid) @@ -43,7 +46,7 @@ impl ActorRegistry { .ok_or_else(|| anyhow!("Unknown actor code CID: {}", code_cid)) } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator { self.map.iter() } } diff --git a/src/rpc/registry/methods_reg.rs b/src/rpc/registry/methods_reg.rs index f2587346db43..ff90f37bd0ae 100644 --- a/src/rpc/registry/methods_reg.rs +++ b/src/rpc/registry/methods_reg.rs @@ -8,6 +8,7 @@ use crate::shim::message::MethodNum; use ahash::{HashMap, HashMapExt}; use anyhow::{Context, Result, bail}; use cid::Cid; +use fil_actors_shared::v11::runtime::builtins::Type; use serde::de::DeserializeOwned; use serde_json::Value; use std::sync::LazyLock; @@ -65,10 +66,7 @@ impl MethodRegistry { let (actor_type, version) = ActorRegistry::get_actor_details_from_code(code_cid)?; bail!( - "No deserializer registered for actor type {:?} (v{}), method {}", - actor_type, - version, - method_num + "No deserializer registered for actor type {actor_type:?} ({version}), method {method_num}" ); } @@ -103,7 +101,7 @@ impl MethodRegistry { payment_channel::register_actor_methods(self, cid, version) } BuiltinActor::EAM => eam::register_actor_methods(self, cid, version), - _ => {} + Type::Placeholder => {} } } } @@ -158,12 +156,12 @@ mod test { use super::*; use crate::lotus_json::HasLotusJson; use crate::utils::multihash::MultihashCode; + use fil_actors_shared::actor_versions::ActorVersion; use fvm_ipld_encoding::{DAG_CBOR, to_vec}; use multihash_derive::MultihashDigest; use serde::{Deserialize, Serialize}; use serde_json::json; - const V16: u64 = 16; // Test parameter type for testing #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] struct TestParams { @@ -192,7 +190,7 @@ mod test { Cid::new_v1(DAG_CBOR, MultihashCode::Blake2b256.digest(data)) } - fn get_real_actor_cid(target_actor: BuiltinActor, target_version: u64) -> Option { + fn get_real_actor_cid(target_actor: BuiltinActor, target_version: ActorVersion) -> Option { ACTOR_REGISTRY .iter() .find_map(|(&cid, &(actor_type, version))| { @@ -252,7 +250,7 @@ mod test { #[test] fn test_deserialize_params_registered_actor_unregistered_method() { - if let Some(account_cid) = get_real_actor_cid(BuiltinActor::Account, V16) { + if let Some(account_cid) = get_real_actor_cid(BuiltinActor::Account, ActorVersion::V16) { let unregistered_method = 999; let result = deserialize_params(&account_cid, unregistered_method, &[]); @@ -277,7 +275,7 @@ mod test { ]; for actor_type in supported_actors { - let actor_cid = get_real_actor_cid(actor_type, V16).unwrap(); + let actor_cid = get_real_actor_cid(actor_type, ActorVersion::V16).unwrap(); // Test that the Constructor method (typically method 1) is registered let constructor_method = 1; @@ -325,7 +323,7 @@ mod test { #[test] fn test_system_actor_deserialize_params_cbor_null() { - let system_cid = get_real_actor_cid(BuiltinActor::System, V16) + let system_cid = get_real_actor_cid(BuiltinActor::System, ActorVersion::V16) .expect("Should have System actor CID in registry"); // Test with null data diff --git a/src/state_migration/nv27/mod.rs b/src/state_migration/nv27/mod.rs index 02b2c1c8d52a..52cded6a7efc 100644 --- a/src/state_migration/nv27/mod.rs +++ b/src/state_migration/nv27/mod.rs @@ -12,8 +12,7 @@ use crate::{define_system_states, impl_system, impl_verifier}; define_system_states!( fil_actor_system_state::v16::State, - // TODO(forest): https://github.com/ChainSafe/forest/issues/5985 - fil_actor_system_state::v16::State + fil_actor_system_state::v17::State ); impl_system!(); diff --git a/src/tool/subcommands/api_cmd.rs b/src/tool/subcommands/api_cmd.rs index fdebd3c4bfe9..7e193120eece 100644 --- a/src/tool/subcommands/api_cmd.rs +++ b/src/tool/subcommands/api_cmd.rs @@ -4,6 +4,7 @@ mod api_compare_tests; mod generate_test_snapshot; mod report; +mod state_decode_params_tests; mod stateful_tests; mod test_snapshot; diff --git a/src/tool/subcommands/api_cmd/api_compare_tests.rs b/src/tool/subcommands/api_cmd/api_compare_tests.rs index 31a39d1fcfee..99f93c90f89e 100644 --- a/src/tool/subcommands/api_cmd/api_compare_tests.rs +++ b/src/tool/subcommands/api_cmd/api_compare_tests.rs @@ -24,7 +24,7 @@ use crate::rpc::{Permission, prelude::*}; use crate::shim::actors::MarketActorStateLoad as _; use crate::shim::actors::market; use crate::shim::executor::Receipt; -use crate::shim::sector::{SectorSize, StoragePower}; +use crate::shim::sector::SectorSize; use crate::shim::{ address::{Address, Protocol}, crypto::Signature, @@ -36,10 +36,10 @@ use crate::state_manager::StateManager; use crate::tool::offline_server::server::handle_chain_config; use crate::tool::subcommands::api_cmd::NetworkChain; use crate::tool::subcommands::api_cmd::report::ReportBuilder; +use crate::tool::subcommands::api_cmd::state_decode_params_tests::create_all_state_decode_params_tests; use crate::utils::proofs_api::{self, ensure_proof_params_downloaded}; use crate::{Config, rpc}; use ahash::HashMap; -use base64::{Engine as _, prelude::BASE64_STANDARD}; use bls_signatures::Serialize as _; use chrono::Utc; use cid::Cid; @@ -48,13 +48,10 @@ use fil_actors_shared::v10::runtime::DomainSeparationTag; use futures::stream::FuturesUnordered; use futures::stream::StreamExt as _; use fvm_ipld_blockstore::Blockstore; -use fvm_ipld_encoding::{BytesDe, RawBytes, to_vec}; -use fvm_shared4::randomness::Randomness; use ipld_core::ipld::Ipld; use itertools::Itertools as _; use jsonrpsee::types::ErrorCode; use libp2p::PeerId; -use num_bigint::BigInt; use num_traits::Signed; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; @@ -330,7 +327,7 @@ impl RpcTest { } /// Check that an endpoint exists and that Forest returns exactly the same /// JSON as Lotus. - fn identity(request: rpc::Request) -> RpcTest { + pub(crate) fn identity(request: rpc::Request) -> RpcTest { Self::validate(request, |forest, lotus| forest == lotus) } @@ -855,7 +852,7 @@ fn state_tests_with_tipset( ]; tests.extend(read_state_api_tests(tipset)?); - tests.extend(state_decode_params_api_tests(tipset)?); + tests.extend(create_all_state_decode_params_tests(tipset)?); for &pending_deal_id in StateGetAllocationIdForPendingDeal::get_allocations_for_pending_deals(store, tipset)? @@ -1854,1763 +1851,6 @@ fn eth_tests_with_tipset(store: &Arc, shared_tipset: &Tipset tests } -fn state_decode_params_api_tests(tipset: &Tipset) -> anyhow::Result> { - // // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/396 - // // Enable this test when lotus supports it in go-state-types. - // let cron_constructor_params = fil_actor_cron_state::v16::ConstructorParams { - // entries: vec![fil_actor_cron_state::v16::Entry { - // receiver: Address::new_id(1000).into(), - // method_num: fil_actor_cron_state::v16::Method::EpochTick as u64, - // }], - // }; - let mut tests = vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::SYSTEM_ACTOR, - fil_actor_system_state::v16::Method::Constructor as u64, - vec![], - tipset.key().into(), - ))?), - // // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/396 - // Enable this test when lotus supports it in go-state-types. - // RpcTest::identity(StateDecodeParams::request(( - // Address::CRON_ACTOR, - // fil_actor_cron_state::v16::Method::Constructor as u64, - // to_vec(&cron_constructor_params)?, - // tipset.key().into(), - // ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::CRON_ACTOR, - fil_actor_cron_state::v16::Method::EpochTick as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_delegated(Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id()?, &[0; 20]) - .unwrap(), - fil_actor_ethaccount_state::v16::Method::Constructor as u64, - vec![], - tipset.key().into(), - ))?), - ]; - - tests.extend(miner_actor_state_decode_params_tests(tipset)?); - tests.extend(account_actor_state_decode_params_tests(tipset)?); - tests.extend(init_actor_state_decode_params_tests(tipset)?); - tests.extend(evm_actor_state_decode_params_tests(tipset)?); - tests.extend(reward_actor_state_decode_params_tests(tipset)?); - tests.extend(power_actor_state_decode_params_tests(tipset)?); - tests.extend(datacap_actor_state_decode_params_tests(tipset)?); - tests.extend(multisig_actor_state_decode_params_tests(tipset)?); - tests.extend(verified_reg_actor_state_decode_params_tests(tipset)?); - tests.extend(market_actor_state_decode_params_tests(tipset)?); - tests.extend(paych_actor_state_decode_params_tests(tipset)?); - tests.extend(eam_actor_state_decode_params_tests(tipset)?); - - Ok(tests) -} - -fn paych_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - // payment channel actor address `t066116` - // https://calibration.filscan.io/en/address/t066116/ - let paych_address = Address::new_id(66116); - - let constructor_params = fil_actor_paych_state::v16::ConstructorParams { - from: Address::new_id(1234).into(), - to: Address::new_id(8457).into(), - }; - - let update_channel_state = fil_actor_paych_state::v16::UpdateChannelStateParams { - sv: fil_actor_paych_state::v16::SignedVoucher { - channel_addr: Address::new_id(1000).into(), - time_lock_min: 21, - time_lock_max: 234, - secret_pre_image: vec![], - extra: Some(fil_actor_paych_state::v16::ModVerifyParams { - actor: Address::new_id(1234).into(), - method: 223, - data: Default::default(), - }), - lane: 234, - nonce: 231, - amount: Default::default(), - min_settle_height: 0, - merges: vec![], - signature: None, - }, - secret: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - paych_address, - fil_actor_paych_state::v16::Method::Constructor as u64, - to_vec(&constructor_params).unwrap(), - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - paych_address, - fil_actor_paych_state::v16::Method::UpdateChannelState as u64, - to_vec(&update_channel_state).unwrap(), - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - paych_address, - fil_actor_paych_state::v16::Method::Settle as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - paych_address, - fil_actor_paych_state::v16::Method::Collect as u64, - vec![], - tipset.key().into(), - ))?), - ]) -} - -fn eam_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let create_params = fil_actor_eam_state::v16::CreateParams { - initcode: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data - nonce: 2, - }; - - let create_params2 = fil_actor_eam_state::v16::Create2Params { - initcode: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data - salt: [0; 32], - }; - - let create_external_params = - fil_actor_eam_state::v16::CreateExternalParams(vec![0x11, 0x22, 0x33, 0x44, 0x55]); - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, - fil_actor_eam_state::v16::Method::Constructor as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, - fil_actor_eam_state::v16::Method::Create as u64, - to_vec(&create_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, - fil_actor_eam_state::v16::Method::Create2 as u64, - to_vec(&create_params2)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, - fil_actor_eam_state::v16::Method::CreateExternal as u64, - to_vec(&create_external_params)?, - tipset.key().into(), - ))?), - ]) -} - -fn evm_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let evm_constructor_params = fil_actor_evm_state::v16::ConstructorParams { - creator: fil_actor_evm_state::evm_shared::v16::address::EthAddress([0; 20]), - initcode: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode - }; - - let evm_invoke_contract_params = fil_actor_evm_state::v16::InvokeContractParams { - input_data: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy input data - }; - - let evm_delegate_call_params = fil_actor_evm_state::v16::DelegateCallParams { - code: Cid::default(), - input: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy input data - caller: fil_actor_evm_state::evm_shared::v16::address::EthAddress([0; 20]), - value: TokenAmount::default().into(), - }; - - let evm_get_storage_at_params = GetStorageAtParams::new(vec![0xa])?; - - let tests = vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::Constructor as u64, - to_vec(&evm_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::Resurrect as u64, - to_vec(&evm_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::GetBytecode as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::GetBytecodeHash as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::InvokeContract as u64, - to_vec(&evm_invoke_contract_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::InvokeContractDelegate as u64, - to_vec(&evm_delegate_call_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::from_str(EVM_ADDRESS).unwrap(), - fil_actor_evm_state::v16::Method::GetStorageAt as u64, - evm_get_storage_at_params.serialize_params()?, - tipset.key().into(), - ))?), - ]; - - Ok(tests) -} - -fn account_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let account_constructor_params = fil_actor_account_state::v16::types::ConstructorParams { - address: Address::new_id(1234).into(), - }; - - let account_auth_params = fil_actor_account_state::v16::types::AuthenticateMessageParams { - signature: vec![0x00; 32], // dummy signature - message: b"test message".to_vec(), - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - ACCOUNT_ADDRESS, - 1, - to_vec(&account_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - ACCOUNT_ADDRESS, - 2643134072, // frc42_dispatch::method_hash!("AuthenticateMessage"), - to_vec(&account_auth_params)?, - tipset.key().into(), - ))?), - ]) -} - -fn init_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let init_constructor_params = fil_actor_init_state::v16::ConstructorParams { - network_name: "calibnet".to_string(), - }; - - let init_exec4_params = fil_actor_init_state::v16::Exec4Params { - code_cid: Cid::default(), - constructor_params: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode - subaddress: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode - }; - - let init_exec_params = fil_actor_init_state::v16::ExecParams { - code_cid: Cid::default(), - constructor_params: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::INIT_ACTOR, - 1, - to_vec(&init_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::INIT_ACTOR, - 2, - to_vec(&init_exec_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::INIT_ACTOR, - 3, - to_vec(&init_exec4_params)?, - tipset.key().into(), - ))?), - ]) -} - -fn reward_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let reward_constructor_params = fil_actor_reward_state::v16::ConstructorParams { - power: Some(Default::default()), - }; - - let reward_award_block_reward_params = fil_actor_reward_state::v16::AwardBlockRewardParams { - miner: Address::new_id(1000).into(), - penalty: Default::default(), - gas_reward: Default::default(), - win_count: 0, - }; - - let reward_update_network_params = fil_actor_reward_state::v16::UpdateNetworkKPIParams { - curr_realized_power: Option::from(fvm_shared4::bigint::bigint_ser::BigIntDe(BigInt::from( - 111, - ))), - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::REWARD_ACTOR, - fil_actor_reward_state::v16::Method::Constructor as u64, - to_vec(&reward_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::REWARD_ACTOR, - fil_actor_reward_state::v16::Method::AwardBlockReward as u64, - to_vec(&reward_award_block_reward_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::REWARD_ACTOR, - fil_actor_reward_state::v16::Method::UpdateNetworkKPI as u64, - to_vec(&reward_update_network_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::REWARD_ACTOR, - fil_actor_reward_state::v16::Method::ThisEpochReward as u64, - vec![], - tipset.key().into(), - ))?), - ]) -} - -fn power_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let power_create_miner_params = fil_actor_power_state::v16::CreateMinerParams { - owner: Address::new_id(1000).into(), - worker: Address::new_id(1001).into(), - window_post_proof_type: fvm_shared4::sector::RegisteredPoStProof::StackedDRGWinning2KiBV1, - peer: b"miner".to_vec(), - multiaddrs: Default::default(), - }; - - // not supported by the lotus - // let _power_miner_power_exp_params = fil_actor_power_state::v16::MinerPowerParams{ - // miner: 1234, - // }; - - let power_update_claim_params = fil_actor_power_state::v16::UpdateClaimedPowerParams { - raw_byte_delta: StoragePower::from(1024u64), - quality_adjusted_delta: StoragePower::from(2048u64), - }; - - let power_enroll_event_params = fil_actor_power_state::v16::EnrollCronEventParams { - event_epoch: 123, - payload: Default::default(), - }; - - let power_update_pledge_ttl_params = fil_actor_power_state::v16::UpdatePledgeTotalParams { - pledge_delta: Default::default(), - }; - - let power_miner_raw_params = fil_actor_power_state::v16::MinerRawPowerParams { miner: 1234 }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::CreateMiner as u64, - to_vec(&power_create_miner_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::UpdateClaimedPower as u64, - to_vec(&power_update_claim_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::EnrollCronEvent as u64, - to_vec(&power_enroll_event_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::UpdatePledgeTotal as u64, - to_vec(&power_update_pledge_ttl_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::CreateMinerExported as u64, - to_vec(&power_create_miner_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::MinerRawPowerExported as u64, - to_vec(&power_miner_raw_params)?, - tipset.key().into(), - ))?), - // Not supported by the lotus, - // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/401 - // RpcTest::identity(StateDecodeParams::request(( - // Address::POWER_ACTOR, - // Method::MinerPowerExported as u64, - // to_vec(&power_miner_power_exp_params)?, - // tipset.key().into(), - // ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::Constructor as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::OnEpochTickEnd as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::CurrentTotalPower as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::NetworkRawPowerExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::MinerCountExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::POWER_ACTOR, - fil_actor_power_state::v16::Method::MinerConsensusCountExported as u64, - vec![], - tipset.key().into(), - ))?), - ]) -} - -fn datacap_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let datacap_constructor_params = fil_actor_datacap_state::v16::ConstructorParams { - governor: Address::new_id(3000).into(), - }; - - let datacap_mint_params = fil_actor_datacap_state::v16::MintParams { - to: Address::new_id(3001).into(), - amount: TokenAmount::default().into(), - operators: vec![Address::new_id(3002).into(), Address::new_id(3003).into()], - }; - - let datacap_destroy_params = fil_actor_datacap_state::v16::DestroyParams { - owner: Address::new_id(3004).into(), - amount: TokenAmount::default().into(), - }; - - let datacap_balance_params = fil_actor_datacap_state::v16::BalanceParams { - address: Address::new_id(3005).into(), - }; - - let datacap_transfer_params = fil_actors_shared::frc46_token::token::types::TransferParams { - to: Address::new_id(3006).into(), - amount: TokenAmount::default().into(), - operator_data: fvm_ipld_encoding::RawBytes::new(b"transfer test data".to_vec()), - }; - - let datacap_transfer_from_params = - fil_actors_shared::frc46_token::token::types::TransferFromParams { - from: Address::new_id(3007).into(), - to: Address::new_id(3008).into(), - amount: TokenAmount::default().into(), - operator_data: fvm_ipld_encoding::RawBytes::new(b"transfer_from test data".to_vec()), - }; - - let datacap_increase_allowance_params = - fil_actors_shared::frc46_token::token::types::IncreaseAllowanceParams { - operator: Address::new_id(3009).into(), - increase: TokenAmount::default().into(), - }; - - let datacap_decrease_allowance_params = - fil_actors_shared::frc46_token::token::types::DecreaseAllowanceParams { - operator: Address::new_id(3010).into(), - decrease: TokenAmount::default().into(), - }; - - let datacap_revoke_allowance_params = - fil_actors_shared::frc46_token::token::types::RevokeAllowanceParams { - operator: Address::new_id(3011).into(), - }; - - let datacap_burn_params = fil_actors_shared::frc46_token::token::types::BurnParams { - amount: TokenAmount::default().into(), - }; - - let datacap_burn_from_params = fil_actors_shared::frc46_token::token::types::BurnFromParams { - owner: Address::new_id(3012).into(), - amount: TokenAmount::default().into(), - }; - - let datacap_get_allowance_params = - fil_actors_shared::frc46_token::token::types::GetAllowanceParams { - owner: Address::new_id(3013).into(), - operator: Address::new_id(3014).into(), - }; - - let tests = vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::Constructor as u64, - to_vec(&datacap_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::MintExported as u64, - to_vec(&datacap_mint_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::DestroyExported as u64, - to_vec(&datacap_destroy_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::NameExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::SymbolExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::TotalSupplyExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::BalanceExported as u64, - to_vec(&datacap_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::GranularityExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::TransferExported as u64, - to_vec(&datacap_transfer_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::TransferFromExported as u64, - to_vec(&datacap_transfer_from_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::IncreaseAllowanceExported as u64, - to_vec(&datacap_increase_allowance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::DecreaseAllowanceExported as u64, - to_vec(&datacap_decrease_allowance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::RevokeAllowanceExported as u64, - to_vec(&datacap_revoke_allowance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::BurnExported as u64, - to_vec(&datacap_burn_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::BurnFromExported as u64, - to_vec(&datacap_burn_from_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::DATACAP_TOKEN_ACTOR, - fil_actor_datacap_state::v16::Method::AllowanceExported as u64, - to_vec(&datacap_get_allowance_params)?, - tipset.key().into(), - ))?), - ]; - - Ok(tests) -} - -fn miner_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let miner_constructor_params = fil_actor_miner_state::v16::MinerConstructorParams { - owner: Address::new_id(1000).into(), - worker: Address::new_id(1001).into(), - control_addresses: vec![Address::new_id(1002).into(), Address::new_id(1003).into()], - window_post_proof_type: fvm_shared4::sector::RegisteredPoStProof::StackedDRGWindow32GiBV1P1, - peer_id: b"miner".to_vec(), - multi_addresses: Default::default(), - }; - - let miner_change_worker_params = fil_actor_miner_state::v16::ChangeWorkerAddressParams { - new_worker: Address::new_id(2000).into(), - new_control_addresses: vec![Address::new_id(2001).into()], - }; - - let miner_change_peer_id_params = fil_actor_miner_state::v16::ChangePeerIDParams { - new_id: b"new_peer".to_vec(), - }; - - let miner_change_multiaddrs_params = fil_actor_miner_state::v16::ChangeMultiaddrsParams { - new_multi_addrs: vec![BytesDe(vec![1, 2, 3])], - }; - - let miner_change_owner_params = fil_actor_miner_state::v16::ChangeOwnerAddressParams { - new_owner: Address::new_id(3000).into(), - }; - - let miner_change_beneficiary_params = fil_actor_miner_state::v16::ChangeBeneficiaryParams { - new_beneficiary: Address::new_id(4000).into(), - new_quota: TokenAmount::from_atto(1000000000000000000u64).into(), - new_expiration: 1000, - }; - - let miner_withdraw_balance_params = fil_actor_miner_state::v16::WithdrawBalanceParams { - amount_requested: TokenAmount::from_atto(500000000000000000u64).into(), - }; - - let miner_submit_windowed_post_params = fil_actor_miner_state::v16::SubmitWindowedPoStParams { - deadline: 0, - partitions: vec![fil_actor_miner_state::v16::PoStPartition { - index: 0, - skipped: Default::default(), - }], - proofs: vec![], - chain_commit_epoch: 0, - chain_commit_rand: Randomness(vec![1, 22, 43]), - }; - - let miner_extend_sector_expiration_params = - fil_actor_miner_state::v16::ExtendSectorExpirationParams { - extensions: vec![fil_actor_miner_state::v16::ExpirationExtension { - deadline: 12, - partition: 123, - sectors: Default::default(), - new_expiration: 1000, - }], - }; - - let miner_terminate_sectors_params = fil_actor_miner_state::v16::TerminateSectorsParams { - terminations: vec![fil_actor_miner_state::v16::TerminationDeclaration { - deadline: 0, - partition: 0, - sectors: Default::default(), - }], - }; - - let miner_declare_faults_params = fil_actor_miner_state::v16::DeclareFaultsParams { - faults: vec![fil_actor_miner_state::v16::FaultDeclaration { - deadline: 0, - partition: 0, - sectors: Default::default(), - }], - }; - - let miner_declare_faults_recovered_params = - fil_actor_miner_state::v16::DeclareFaultsRecoveredParams { - recoveries: vec![fil_actor_miner_state::v16::RecoveryDeclaration { - deadline: 0, - partition: 0, - sectors: Default::default(), - }], - }; - - let miner_deferred_cron_event_params = fil_actor_miner_state::v16::DeferredCronEventParams { - event_payload: vec![], - reward_smoothed: fil_actors_shared::v16::reward::FilterEstimate { - position: Default::default(), - velocity: Default::default(), - }, - quality_adj_power_smoothed: fil_actors_shared::v16::reward::FilterEstimate { - position: Default::default(), - velocity: Default::default(), - }, - }; - - let miner_check_sector_proven_params = - fil_actor_miner_state::v16::CheckSectorProvenParams { sector_number: 0 }; - - let miner_apply_reward_params = fil_actor_miner_state::v16::ApplyRewardParams { - reward: TokenAmount::from_atto(1000000000000000000u64).into(), - penalty: TokenAmount::from_atto(0u64).into(), - }; - - let miner_report_consensus_fault_params = - fil_actor_miner_state::v16::ReportConsensusFaultParams { - header1: vec![], - header2: vec![], - header_extra: vec![], - }; - - let miner_compact_partitions_params = fil_actor_miner_state::v16::CompactPartitionsParams { - deadline: 0, - partitions: Default::default(), - }; - - let miner_compact_sector_numbers_params = - fil_actor_miner_state::v16::CompactSectorNumbersParams { - mask_sector_numbers: Default::default(), - }; - - let miner_dispute_windowed_post_params = - fil_actor_miner_state::v16::DisputeWindowedPoStParams { - deadline: 0, - post_index: 0, - }; - - let miner_prove_commit_aggregate_params = - fil_actor_miner_state::v16::ProveCommitAggregateParams { - sector_numbers: Default::default(), - aggregate_proof: RawBytes::new(vec![]), - }; - - let miner_prove_replica_updates_params = - fil_actor_miner_state::v16::ProveReplicaUpdatesParams { - updates: vec![fil_actor_miner_state::v16::ReplicaUpdate { - sector_number: 0, - deadline: 0, - partition: 0, - new_sealed_cid: Cid::default(), - deals: vec![], - update_proof_type: fvm_shared4::sector::RegisteredUpdateProof::StackedDRG2KiBV1, - replica_proof: RawBytes::new(vec![]), - }], - }; - - let miner_pre_commit_sector_batch2_params = - fil_actor_miner_state::v16::PreCommitSectorBatchParams2 { - sectors: vec![fil_actor_miner_state::v16::SectorPreCommitInfo { - seal_proof: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1P1, - sector_number: 0, - sealed_cid: Cid::default(), - seal_rand_epoch: 0, - deal_ids: vec![], - expiration: 1000, - unsealed_cid: fil_actor_miner_state::v16::CompactCommD(None), - }], - }; - - let miner_extend_sector_expiration2_params = - fil_actor_miner_state::v16::ExtendSectorExpiration2Params { - extensions: vec![fil_actor_miner_state::v16::ExpirationExtension2 { - deadline: 0, - partition: 0, - sectors: Default::default(), - sectors_with_claims: vec![], - new_expiration: 1000, - }], - }; - - let miner_is_controlling_address_param = - fil_actor_miner_state::v16::IsControllingAddressParam { - address: Address::new_id(5000).into(), - }; - - let miner_prove_commit_sectors3_params = - fil_actor_miner_state::v16::ProveCommitSectors3Params { - sector_activations: vec![fil_actor_miner_state::v16::SectorActivationManifest { - sector_number: 0, - pieces: vec![fil_actor_miner_state::v16::PieceActivationManifest { - cid: Cid::default(), - size: fvm_shared4::piece::PaddedPieceSize(23), - verified_allocation_key: None, - notify: vec![], - }], - }], - sector_proofs: vec![RawBytes::new(vec![])], - aggregate_proof: RawBytes::new(vec![]), - aggregate_proof_type: None, - require_activation_success: true, - require_notification_success: true, - }; - - let miner_prove_replica_updates3_params = - fil_actor_miner_state::v16::ProveReplicaUpdates3Params { - sector_updates: vec![fil_actor_miner_state::v16::SectorUpdateManifest { - sector: 0, - deadline: 0, - partition: 0, - new_sealed_cid: Cid::default(), - pieces: vec![fil_actor_miner_state::v16::PieceActivationManifest { - cid: Cid::default(), - size: fvm_shared4::piece::PaddedPieceSize(12), - verified_allocation_key: None, - notify: vec![], - }], - }], - sector_proofs: vec![RawBytes::new(vec![])], - aggregate_proof: RawBytes::new(vec![]), - update_proofs_type: fvm_shared4::sector::RegisteredUpdateProof::StackedDRG2KiBV1, - aggregate_proof_type: None, - require_activation_success: true, - require_notification_success: true, - }; - - let miner_prove_commit_sectors_ni_params = - fil_actor_miner_state::v16::ProveCommitSectorsNIParams { - sectors: vec![fil_actor_miner_state::v16::SectorNIActivationInfo { - sealing_number: 12, - sealer_id: 23343, - sealed_cid: Cid::default(), - sector_number: 2343, - seal_rand_epoch: 2343, - expiration: 1000, - }], - aggregate_proof: RawBytes::new(vec![23, 2, 23]), - seal_proof_type: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1P1, - aggregate_proof_type: fvm_shared4::sector::RegisteredAggregateProof::SnarkPackV1, - proving_deadline: 234, - require_activation_success: true, - }; - - let miner_internal_sector_setup_for_preseal_params = - fil_actor_miner_state::v16::InternalSectorSetupForPresealParams { - sectors: vec![0], - reward_smoothed: fil_actors_shared::v16::reward::FilterEstimate { - position: Default::default(), - velocity: Default::default(), - }, - reward_baseline_power: Default::default(), - quality_adj_power_smoothed: fil_actors_shared::v16::reward::FilterEstimate { - position: Default::default(), - velocity: Default::default(), - }, - }; - - // let miner_max_termination_fee_params = fil_actor_miner_state::v16::MaxTerminationFeeParams { - // power: Default::default(), - // initial_pledge: TokenAmount::from_atto(1000000000000000000u64).into(), - // }; - - use fil_actor_miner_state::v16::Method; - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::Constructor as u64, - to_vec(&miner_constructor_params)?, - tipset.key().into(), - ))?), - // Methods without parameters - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ControlAddresses as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeWorkerAddress as u64, - to_vec(&miner_change_worker_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangePeerID as u64, - to_vec(&miner_change_peer_id_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::SubmitWindowedPoSt as u64, - to_vec(&miner_submit_windowed_post_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ExtendSectorExpiration as u64, - to_vec(&miner_extend_sector_expiration_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::TerminateSectors as u64, - to_vec(&miner_terminate_sectors_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::DeclareFaults as u64, - to_vec(&miner_declare_faults_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::DeclareFaultsRecovered as u64, - to_vec(&miner_declare_faults_recovered_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::OnDeferredCronEvent as u64, - to_vec(&miner_deferred_cron_event_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::CheckSectorProven as u64, - to_vec(&miner_check_sector_proven_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ApplyRewards as u64, - to_vec(&miner_apply_reward_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ReportConsensusFault as u64, - to_vec(&miner_report_consensus_fault_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::WithdrawBalance as u64, - to_vec(&miner_withdraw_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::InternalSectorSetupForPreseal as u64, - to_vec(&miner_internal_sector_setup_for_preseal_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeMultiaddrs as u64, - to_vec(&miner_change_multiaddrs_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::CompactPartitions as u64, - to_vec(&miner_compact_partitions_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::CompactSectorNumbers as u64, - to_vec(&miner_compact_sector_numbers_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ConfirmChangeWorkerAddress as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::RepayDebt as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeOwnerAddress as u64, - to_vec(&miner_change_owner_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::DisputeWindowedPoSt as u64, - to_vec(&miner_dispute_windowed_post_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ProveCommitAggregate as u64, - to_vec(&miner_prove_commit_aggregate_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ProveReplicaUpdates as u64, - to_vec(&miner_prove_replica_updates_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::PreCommitSectorBatch2 as u64, - to_vec(&miner_pre_commit_sector_batch2_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeBeneficiary as u64, - to_vec(&miner_change_beneficiary_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetBeneficiary as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ExtendSectorExpiration2 as u64, - to_vec(&miner_extend_sector_expiration2_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ProveCommitSectors3 as u64, - to_vec(&miner_prove_commit_sectors3_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ProveReplicaUpdates3 as u64, - to_vec(&miner_prove_replica_updates3_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ProveCommitSectorsNI as u64, - to_vec(&miner_prove_commit_sectors_ni_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeWorkerAddressExported as u64, - to_vec(&miner_change_worker_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangePeerIDExported as u64, - to_vec(&miner_change_peer_id_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::WithdrawBalanceExported as u64, - to_vec(&miner_withdraw_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeMultiaddrsExported as u64, - to_vec(&miner_change_multiaddrs_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ConfirmChangeWorkerAddressExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::RepayDebtExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeOwnerAddressExported as u64, - to_vec(&miner_change_owner_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::ChangeBeneficiaryExported as u64, - to_vec(&miner_change_beneficiary_params)?, - tipset.key().into(), - ))?), - // Not supported by the lotus. - // RpcTest::identity(StateDecodeParams::request(( - // MINER_ADDRESS, - // Method::GetBeneficiaryExported as u64, - // vec![], - // tipset.key().into(), - // ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetOwnerExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::IsControllingAddressExported as u64, - to_vec(&miner_is_controlling_address_param)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetSectorSizeExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetAvailableBalanceExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetVestingFundsExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetPeerIDExported as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - MINER_ADDRESS, - Method::GetMultiaddrsExported as u64, - vec![], - tipset.key().into(), - ))?), - // Not supported by the lotus. - // RpcTest::identity(StateDecodeParams::request(( - // MINER_ADDRESS, - // Method::MaxTerminationFeeExported as u64, - // to_vec(&miner_max_termination_fee_params)?, - // tipset.key().into(), - // ))?), - // RpcTest::identity(StateDecodeParams::request(( - // MINER_ADDRESS, - // Method::InitialPledgeExported as u64, - // vec![], - // tipset.key().into(), - // ))?), - ]) -} - -fn multisig_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let multisig_constructor_params = fil_actor_multisig_state::v16::ConstructorParams { - signers: vec![Address::new_id(1000).into(), Address::new_id(1001).into()], - num_approvals_threshold: Default::default(), - unlock_duration: Default::default(), - start_epoch: Default::default(), - }; - - let multisig_propose_params = fil_actor_multisig_state::v16::ProposeParams { - to: Address::new_id(1000).into(), - value: Default::default(), - method: 0, - params: Default::default(), - }; - - let multisig_tx_id_params = fil_actor_multisig_state::v16::TxnIDParams { - id: Default::default(), - proposal_hash: vec![Default::default()], - }; - - let multisig_add_signer_params = fil_actor_multisig_state::v16::AddSignerParams { - signer: Address::new_id(1012).into(), - increase: false, - }; - - let multisig_remove_signer_params = fil_actor_multisig_state::v16::RemoveSignerParams { - signer: Address::new_id(1012).into(), - decrease: false, - }; - - let multisig_swap_signer_params = fil_actor_multisig_state::v16::SwapSignerParams { - from: Address::new_id(122).into(), - to: Address::new_id(1234).into(), - }; - - let multisig_change_num_app_params = - fil_actor_multisig_state::v16::ChangeNumApprovalsThresholdParams { new_threshold: 2 }; - - let multisig_lock_bal_params = fil_actor_multisig_state::v16::LockBalanceParams { - start_epoch: 22, - unlock_duration: 12, - amount: Default::default(), - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::Constructor as u64, - to_vec(&multisig_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::Propose as u64, - to_vec(&multisig_propose_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::Approve as u64, - to_vec(&multisig_tx_id_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::Cancel as u64, - to_vec(&multisig_tx_id_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::AddSigner as u64, - to_vec(&multisig_add_signer_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::RemoveSigner as u64, - to_vec(&multisig_remove_signer_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::SwapSigner as u64, - to_vec(&multisig_swap_signer_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::ChangeNumApprovalsThreshold as u64, - to_vec(&multisig_change_num_app_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::LockBalance as u64, - to_vec(&multisig_lock_bal_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::LockBalance as u64, - to_vec(&multisig_lock_bal_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, - fil_actor_multisig_state::v16::Method::UniversalReceiverHook as u64, - BASE64_STANDARD.decode("ghgqRBI0Vng=").unwrap(), - tipset.key().into(), - ))?), - ]) -} - -fn verified_reg_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - let verified_reg_constructor_params = fil_actor_verifreg_state::v16::ConstructorParams { - root_key: Address::new_id(1000).into(), - }; - - let verified_reg_add_verifier_params = fil_actor_verifreg_state::v16::AddVerifierParams { - address: Address::new_id(1234).into(), - allowance: StoragePower::from(1048576u64), // 1MB - }; - - let verified_reg_remove_verifier_params = fil_actor_verifreg_state::v16::RemoveVerifierParams { - verifier: Address::new_id(1234).into(), - }; - - let verified_reg_add_verified_client_params = - fil_actor_verifreg_state::v16::AddVerifiedClientParams { - address: Address::new_id(1235).into(), - allowance: fil_actor_verifreg_state::v16::types::DataCap::from(2097152u64), // 2MB - }; - - let verified_reg_remove_data_cap_params = fil_actor_verifreg_state::v16::RemoveDataCapParams { - verified_client_to_remove: Address::new_id(1236).into(), - data_cap_amount_to_remove: fil_actor_verifreg_state::v16::types::DataCap::from(1048576u64), - verifier_request_1: fil_actor_verifreg_state::v16::RemoveDataCapRequest { - verifier: Address::new_id(1237).into(), - signature: fvm_shared4::crypto::signature::Signature::new_bls( - b"test_signature_1".to_vec(), - ), - }, - verifier_request_2: fil_actor_verifreg_state::v16::RemoveDataCapRequest { - verifier: Address::new_id(1238).into(), - signature: fvm_shared4::crypto::signature::Signature::new_secp256k1( - b"test_signature_2".to_vec(), - ), - }, - }; - - let verified_reg_remove_expired_allocations_params = - fil_actor_verifreg_state::v16::RemoveExpiredAllocationsParams { - client: 1239, - allocation_ids: vec![1001, 1002, 1003], - }; - - let verified_reg_claim_allocations_params = - fil_actor_verifreg_state::v16::ClaimAllocationsParams { - sectors: vec![fil_actor_verifreg_state::v16::SectorAllocationClaims { - sector: 42, - expiry: 2000000, - claims: vec![ - fil_actor_verifreg_state::v16::AllocationClaim { - client: 1240, - allocation_id: 2001, - data: Cid::default(), - size: fvm_shared4::piece::PaddedPieceSize(1024), - }, - fil_actor_verifreg_state::v16::AllocationClaim { - client: 1241, - allocation_id: 2002, - data: Cid::default(), - size: fvm_shared4::piece::PaddedPieceSize(2048), - }, - ], - }], - all_or_nothing: false, - }; - - let verified_reg_get_claims_params = fil_actor_verifreg_state::v16::GetClaimsParams { - provider: 1242, - claim_ids: vec![3001, 3002, 3003], - }; - - let verified_reg_extend_claim_terms_params = - fil_actor_verifreg_state::v16::ExtendClaimTermsParams { - terms: vec![fil_actor_verifreg_state::v16::ClaimTerm { - provider: 12, - claim_id: 12, - term_max: 123, - }], - }; - - let verified_reg_remove_expired_claims_params = - fil_actor_verifreg_state::v16::RemoveExpiredClaimsParams { - provider: 1243, - claim_ids: vec![4001, 4002, 4003], - }; - - let verified_reg_universal_receiver_params = - fvm_actor_utils::receiver::UniversalReceiverParams { - type_: 42, - payload: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56, 0x78]), - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::Constructor as u64, - to_vec(&verified_reg_constructor_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::AddVerifier as u64, - to_vec(&verified_reg_add_verifier_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveVerifier as u64, - to_vec(&verified_reg_remove_verifier_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::AddVerifiedClient as u64, - to_vec(&verified_reg_add_verified_client_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveVerifiedClientDataCap as u64, - to_vec(&verified_reg_remove_data_cap_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveExpiredAllocations as u64, - to_vec(&verified_reg_remove_expired_allocations_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::ClaimAllocations as u64, - to_vec(&verified_reg_claim_allocations_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::GetClaims as u64, - to_vec(&verified_reg_get_claims_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::ExtendClaimTerms as u64, - to_vec(&verified_reg_extend_claim_terms_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveExpiredClaims as u64, - to_vec(&verified_reg_remove_expired_claims_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::AddVerifiedClientExported as u64, - to_vec(&verified_reg_add_verified_client_params)?, // reuse same params - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveExpiredAllocationsExported as u64, - to_vec(&verified_reg_remove_expired_allocations_params)?, // reuse same params - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::GetClaimsExported as u64, - to_vec(&verified_reg_get_claims_params)?, // reuse same params - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::ExtendClaimTermsExported as u64, - to_vec(&verified_reg_extend_claim_terms_params)?, // reuse same params - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::RemoveExpiredClaimsExported as u64, - to_vec(&verified_reg_remove_expired_claims_params)?, // reuse same params - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::VERIFIED_REGISTRY_ACTOR, - fil_actor_verifreg_state::v16::Method::UniversalReceiverHook as u64, - to_vec(&verified_reg_universal_receiver_params)?, - tipset.key().into(), - ))?), - ]) -} - -fn market_actor_state_decode_params_tests(tipset: &Tipset) -> anyhow::Result> { - fn create_deal_proposal( - client: fvm_shared4::address::Address, - provider: fvm_shared4::address::Address, - client_collateral: fvm_shared4::econ::TokenAmount, - provider_collateral: fvm_shared4::econ::TokenAmount, - start_epoch: fvm_shared4::clock::ChainEpoch, - end_epoch: fvm_shared4::clock::ChainEpoch, - ) -> fil_actor_market_state::v16::DealProposal { - let piece_cid = Cid::default(); - let piece_size = fvm_shared4::piece::PaddedPieceSize(2048); - let storage_price_per_epoch = fvm_shared4::econ::TokenAmount::from_atto(10u8); - - fil_actor_market_state::v16::DealProposal { - piece_cid, - piece_size, - verified_deal: false, - client, - provider, - label: fil_actor_market_state::v16::Label::String("label".to_string()), - start_epoch, - end_epoch, - storage_price_per_epoch, - provider_collateral, - client_collateral, - } - } - - fn create_client_deal_proposal() -> fil_actor_market_state::v16::ClientDealProposal { - let proposal = create_deal_proposal( - fvm_shared4::address::Address::new_id(1000), - fvm_shared4::address::Address::new_id(1000), - fvm_shared4::econ::TokenAmount::from_atto(10u8), - fvm_shared4::econ::TokenAmount::from_atto(10u8), - 0, - 10, - ); - fil_actor_market_state::v16::ClientDealProposal { - proposal, - client_signature: fvm_shared4::crypto::signature::Signature::new_bls( - b"test_signature".to_vec(), - ), - } - } - - fn create_sector_deals() -> fil_actor_market_state::v16::SectorDeals { - fil_actor_market_state::v16::SectorDeals { - sector_number: 42, - sector_type: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1, - sector_expiry: 100, - deal_ids: vec![0, 1], - } - } - - fn create_sector_changes() -> fil_actor_miner_state::v16::SectorChanges { - let piece_change = fil_actor_miner_state::v16::PieceChange { - data: Cid::default(), - size: fvm_shared4::piece::PaddedPieceSize(2048), - payload: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56, 0x78]), - }; - - fil_actor_miner_state::v16::SectorChanges { - sector: 2, - minimum_commitment_epoch: 0, - added: vec![piece_change], - } - } - - let market_actor_add_balance_params = fil_actor_market_state::v16::AddBalanceParams { - provider_or_client: fvm_shared4::address::Address::new_id(1000), - }; - let market_actor_withdraw_balance_params = fil_actor_market_state::v16::WithdrawBalanceParams { - provider_or_client: Address::new_id(1000).into(), - amount: TokenAmount::default().into(), - }; - - let market_actor_publish_storage_deals_params = - fil_actor_market_state::v16::PublishStorageDealsParams { - deals: vec![create_client_deal_proposal()], - }; - - let _market_actor_verify_deals_for_activation_params = - fil_actor_market_state::v16::VerifyDealsForActivationParams { - sectors: vec![create_sector_deals()], - }; - - let _market_actor_batch_activate_deals_params = - fil_actor_market_state::v16::BatchActivateDealsParams { - sectors: vec![create_sector_deals()], - compute_cid: true, - }; - - let _market_actor_on_miner_sectors_terminate_params = - fil_actor_market_state::v16::OnMinerSectorsTerminateParams { - epoch: 123, - sectors: { - let mut bf = BitField::new(); - bf.set(3); - bf - }, - }; - - let market_actor_get_balance_exported_params = Address::new_id(1000); - - let market_actor_settle_deal_payments_params = - fil_actor_market_state::v16::SettleDealPaymentsParams { - deal_ids: { - let mut bf = BitField::new(); - bf.set(42); - bf - }, - }; - - let market_actor_get_deal_data_commitment_params = - fil_actor_market_state::v16::DealQueryParams { id: 0 }; - - let _market_actor_sector_content_changed_params = { - fil_actor_miner_state::v16::SectorContentChangedParams { - sectors: vec![create_sector_changes()], - } - }; - - Ok(vec![ - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::AddBalance as u64, - to_vec(&market_actor_add_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::WithdrawBalance as u64, - to_vec(&market_actor_withdraw_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::PublishStorageDeals as u64, - to_vec(&market_actor_publish_storage_deals_params)?, - tipset.key().into(), - ))?), - // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/409 - // Enable this test when lotus supports this method - // RpcTest::identity(StateDecodeParams::request(( - // Address::MARKET_ACTOR, - // fil_actor_market_state::v16::Method::BatchActivateDeals as u64, - // to_vec(&market_actor_batch_activate_deals_params)?, - // tipset.key().into(), - // ))?), - // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/408 - // Enable this test once Lotus adds the `sector_number` field. - // RpcTest::identity(StateDecodeParams::request(( - // Address::MARKET_ACTOR, - // fil_actor_market_state::v16::Method::VerifyDealsForActivation as u64, - // to_vec(&market_actor_verify_deals_for_activation_params)?, - // tipset.key().into(), - // ))?), - // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/408 - // Enable this test when lotus supports correct types in go-state-types. - // RpcTest::identity(StateDecodeParams::request(( - // Address::MARKET_ACTOR, - // fil_actor_market_state::v16::Method::OnMinerSectorsTerminate as u64, - // to_vec(&market_actor_on_miner_sectors_terminate_params)?, - // tipset.key().into(), - // ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::Constructor as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::CronTick as u64, - vec![], - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::AddBalanceExported as u64, - to_vec(&market_actor_get_balance_exported_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::WithdrawBalanceExported as u64, - to_vec(&market_actor_withdraw_balance_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::PublishStorageDealsExported as u64, - to_vec(&market_actor_publish_storage_deals_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetBalanceExported as u64, - to_vec(&market_actor_get_balance_exported_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealDataCommitmentExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealClientExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealProviderExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealLabelExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealTermExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealTotalPriceExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealClientCollateralExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealProviderCollateralExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealVerifiedExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealActivationExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::GetDealSectorExported as u64, - to_vec(&market_actor_get_deal_data_commitment_params)?, - tipset.key().into(), - ))?), - RpcTest::identity(StateDecodeParams::request(( - Address::MARKET_ACTOR, - fil_actor_market_state::v16::Method::SettleDealPaymentsExported as u64, - to_vec(&market_actor_settle_deal_payments_params)?, - tipset.key().into(), - ))?), - // TODO(lotus): https://github.com/filecoin-project/lotus/issues/13329 - // Lotus panics while decoding this method. - // RpcTest::identity(StateDecodeParams::request(( - // Address::MARKET_ACTOR, - // fil_actor_market_state::v16::Method::SectorContentChangedExported as u64, - // to_vec(&market_actor_sector_content_changed_params)?, - // tipset.key().into(), - // ))?), - ]) -} - fn read_state_api_tests(tipset: &Tipset) -> anyhow::Result> { let tests = vec![ RpcTest::identity(StateReadState::request(( diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/account.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/account.rs new file mode 100644 index 000000000000..317afb03cbf0 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/account.rs @@ -0,0 +1,33 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_account_state::v17::*; + +/// Creates state decode params tests for the Account actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let account_constructor_params = types::ConstructorParams { + address: Address::new_id(1234).into(), + }; + + let account_auth_params = types::AuthenticateMessageParams { + signature: vec![0x00; 32], // dummy signature + message: b"test message".to_vec(), + }; + + const ACCOUNT_ADDRESS: Address = Address::new_id(1234); + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + ACCOUNT_ADDRESS, + Method::Constructor as u64, + to_vec(&account_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + ACCOUNT_ADDRESS, + Method::AuthenticateMessageExported as u64, + to_vec(&account_auth_params)?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/cron.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/cron.rs new file mode 100644 index 000000000000..a8aacb4b0338 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/cron.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_cron_state::v17::*; + +/// Creates state decode params tests for the Cron actor. +pub fn create_tests(tipset: &Tipset) -> anyhow::Result> { + // let cron_constructor_params = ConstructorParams { + // entries: vec![Entry { + // receiver: Address::new_id(1000).into(), + // method_num: EpochTick as u64, + // }], + // }; + + Ok(vec![ + // // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/396 + // Enable this test when lotus supports it in go-state-types. + // RpcTest::identity(StateDecodeParams::request(( + // Address::CRON_ACTOR, + // Constructor as u64, + // to_vec(&cron_constructor_params)?, + // tipset.key().into(), + // ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::CRON_ACTOR, + Method::EpochTick as u64, + vec![], + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/datacap.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/datacap.rs new file mode 100644 index 000000000000..02865b577b64 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/datacap.rs @@ -0,0 +1,172 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_datacap_state::v17::*; + +/// Creates state decode params tests for the Datacap actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let datacap_constructor_params = ConstructorParams { + governor: Address::new_id(3000).into(), + }; + + let datacap_mint_params = MintParams { + to: Address::new_id(3001).into(), + amount: TokenAmount::default().into(), + operators: vec![Address::new_id(3002).into(), Address::new_id(3003).into()], + }; + + let datacap_destroy_params = DestroyParams { + owner: Address::new_id(3004).into(), + amount: TokenAmount::default().into(), + }; + + let datacap_balance_params = BalanceParams { + address: Address::new_id(3005).into(), + }; + + let datacap_transfer_params = fil_actors_shared::frc46_token::token::types::TransferParams { + to: Address::new_id(3006).into(), + amount: TokenAmount::default().into(), + operator_data: fvm_ipld_encoding::RawBytes::new(b"transfer test data".to_vec()), + }; + + let datacap_transfer_from_params = + fil_actors_shared::frc46_token::token::types::TransferFromParams { + from: Address::new_id(3007).into(), + to: Address::new_id(3008).into(), + amount: TokenAmount::default().into(), + operator_data: fvm_ipld_encoding::RawBytes::new(b"transfer_from test data".to_vec()), + }; + + let datacap_increase_allowance_params = + fil_actors_shared::frc46_token::token::types::IncreaseAllowanceParams { + operator: Address::new_id(3009).into(), + increase: TokenAmount::default().into(), + }; + + let datacap_decrease_allowance_params = + fil_actors_shared::frc46_token::token::types::DecreaseAllowanceParams { + operator: Address::new_id(3010).into(), + decrease: TokenAmount::default().into(), + }; + + let datacap_revoke_allowance_params = + fil_actors_shared::frc46_token::token::types::RevokeAllowanceParams { + operator: Address::new_id(3011).into(), + }; + + let datacap_burn_params = fil_actors_shared::frc46_token::token::types::BurnParams { + amount: TokenAmount::default().into(), + }; + + let datacap_burn_from_params = fil_actors_shared::frc46_token::token::types::BurnFromParams { + owner: Address::new_id(3012).into(), + amount: TokenAmount::default().into(), + }; + + let datacap_get_allowance_params = + fil_actors_shared::frc46_token::token::types::GetAllowanceParams { + owner: Address::new_id(3013).into(), + operator: Address::new_id(3014).into(), + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::Constructor as u64, + to_vec(&datacap_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::MintExported as u64, + to_vec(&datacap_mint_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::DestroyExported as u64, + to_vec(&datacap_destroy_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::NameExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::SymbolExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::TotalSupplyExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::BalanceExported as u64, + to_vec(&datacap_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::GranularityExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::TransferExported as u64, + to_vec(&datacap_transfer_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::TransferFromExported as u64, + to_vec(&datacap_transfer_from_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::IncreaseAllowanceExported as u64, + to_vec(&datacap_increase_allowance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::DecreaseAllowanceExported as u64, + to_vec(&datacap_decrease_allowance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::RevokeAllowanceExported as u64, + to_vec(&datacap_revoke_allowance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::BurnExported as u64, + to_vec(&datacap_burn_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::BurnFromExported as u64, + to_vec(&datacap_burn_from_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::DATACAP_TOKEN_ACTOR, + Method::AllowanceExported as u64, + to_vec(&datacap_get_allowance_params)?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/eam.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/eam.rs new file mode 100644 index 000000000000..9ebd75ec914c --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/eam.rs @@ -0,0 +1,47 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_eam_state::v17::*; + +/// Creates state decode params tests for the EAM actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let create_params = CreateParams { + initcode: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data + nonce: 2, + }; + + let create_params2 = Create2Params { + initcode: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data + salt: [0; 32], + }; + + let create_external_params = CreateExternalParams(vec![0x11, 0x22, 0x33, 0x44, 0x55]); + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, + Method::Constructor as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, + Method::Create as u64, + to_vec(&create_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, + Method::Create2 as u64, + to_vec(&create_params2)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR, + Method::CreateExternal as u64, + to_vec(&create_external_params)?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/ethaccount.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/ethaccount.rs new file mode 100644 index 000000000000..f38d5f11e2ab --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/ethaccount.rs @@ -0,0 +1,15 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_ethaccount_state::v17::*; + +/// Creates state decode params tests for the EthAccount actor. +pub fn create_tests(tipset: &Tipset) -> anyhow::Result> { + Ok(vec![RpcTest::identity(StateDecodeParams::request(( + Address::new_delegated(Address::ETHEREUM_ACCOUNT_MANAGER_ACTOR.id()?, &[0; 20])?, + Method::Constructor as u64, + vec![], + tipset.key().into(), + ))?)]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/evm.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/evm.rs new file mode 100644 index 000000000000..8ca0acc16a13 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/evm.rs @@ -0,0 +1,76 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use crate::rpc::eth::types::GetStorageAtParams; +use fil_actor_evm_state::evm_shared::v17::address::EthAddress; +use fil_actor_evm_state::v17::*; +use std::str::FromStr; + +const EVM_ADDRESS: &str = "t410fbqoynu2oi2lxam43knqt6ordiowm2ywlml27z4i"; + +/// Creates state decode params tests for the EVM actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let evm_constructor_params = ConstructorParams { + creator: EthAddress([0; 20]), + initcode: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode + }; + + let evm_invoke_contract_params = InvokeContractParams { + input_data: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy input data + }; + + let evm_delegate_call_params = DelegateCallParams { + code: Cid::default(), + input: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy input data + caller: EthAddress([0; 20]), + value: TokenAmount::default().into(), + }; + + let evm_get_storage_at_params = GetStorageAtParams::new(vec![0xa])?; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::Constructor as u64, + to_vec(&evm_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::Resurrect as u64, + to_vec(&evm_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::GetBytecode as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::GetBytecodeHash as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::InvokeContract as u64, + to_vec(&evm_invoke_contract_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::InvokeContractDelegate as u64, + to_vec(&evm_delegate_call_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::from_str(EVM_ADDRESS)?, + Method::GetStorageAt as u64, + evm_get_storage_at_params.serialize_params()?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/init.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/init.rs new file mode 100644 index 000000000000..c4ab84135310 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/init.rs @@ -0,0 +1,44 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_init_state::v17::*; + +/// Creates state decode params tests for the Init actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let init_constructor_params = ConstructorParams { + network_name: "calibnet".to_string(), + }; + + let init_exec4_params = Exec4Params { + code_cid: Cid::default(), + constructor_params: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode + subaddress: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode + }; + + let init_exec_params = ExecParams { + code_cid: Cid::default(), + constructor_params: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56]), // dummy bytecode + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::INIT_ACTOR, + Method::Constructor as u64, + to_vec(&init_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::INIT_ACTOR, + Method::Exec as u64, + to_vec(&init_exec_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::INIT_ACTOR, + Method::Exec4 as u64, + to_vec(&init_exec4_params)?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/market.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/market.rs new file mode 100644 index 000000000000..9ce5b55708be --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/market.rs @@ -0,0 +1,285 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_market_state::v17::*; +use fil_actors_shared::fvm_ipld_bitfield::BitField; + +/// Creates state decode params tests for the Market actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + fn create_deal_proposal( + client: fvm_shared4::address::Address, + provider: fvm_shared4::address::Address, + client_collateral: fvm_shared4::econ::TokenAmount, + provider_collateral: fvm_shared4::econ::TokenAmount, + start_epoch: fvm_shared4::clock::ChainEpoch, + end_epoch: fvm_shared4::clock::ChainEpoch, + ) -> DealProposal { + let piece_cid = Cid::default(); + let piece_size = fvm_shared4::piece::PaddedPieceSize(2048); + let storage_price_per_epoch = fvm_shared4::econ::TokenAmount::from_atto(10u8); + + DealProposal { + piece_cid, + piece_size, + verified_deal: false, + client, + provider, + label: Label::String("label".to_string()), + start_epoch, + end_epoch, + storage_price_per_epoch, + provider_collateral, + client_collateral, + } + } + + fn create_client_deal_proposal() -> ClientDealProposal { + let proposal = create_deal_proposal( + fvm_shared4::address::Address::new_id(1000), + fvm_shared4::address::Address::new_id(1000), + fvm_shared4::econ::TokenAmount::from_atto(10u8), + fvm_shared4::econ::TokenAmount::from_atto(10u8), + 0, + 10, + ); + ClientDealProposal { + proposal, + client_signature: fvm_shared4::crypto::signature::Signature::new_bls( + b"test_signature".to_vec(), + ), + } + } + + fn create_sector_deals() -> SectorDeals { + SectorDeals { + sector_number: 42, + sector_type: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1, + sector_expiry: 100, + deal_ids: vec![0, 1], + } + } + + fn create_sector_changes() -> ext::miner::SectorChanges { + let piece_change = ext::miner::PieceChange { + data: Cid::default(), + size: fvm_shared4::piece::PaddedPieceSize(2048), + payload: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56, 0x78]), + }; + + ext::miner::SectorChanges { + sector: 2, + minimum_commitment_epoch: 0, + added: vec![piece_change], + } + } + + let market_actor_add_balance_params = AddBalanceParams { + provider_or_client: fvm_shared4::address::Address::new_id(1000), + }; + let market_actor_withdraw_balance_params = WithdrawBalanceParams { + provider_or_client: Address::new_id(1000).into(), + amount: TokenAmount::default().into(), + }; + + let market_actor_publish_storage_deals_params = PublishStorageDealsParams { + deals: vec![create_client_deal_proposal()], + }; + + let _market_actor_verify_deals_for_activation_params = VerifyDealsForActivationParams { + sectors: vec![create_sector_deals()], + }; + + let _market_actor_batch_activate_deals_params = BatchActivateDealsParams { + sectors: vec![create_sector_deals()], + compute_cid: true, + }; + + let _market_actor_on_miner_sectors_terminate_params = OnMinerSectorsTerminateParams { + epoch: 123, + sectors: { + let mut bf = BitField::new(); + bf.set(3); + bf + }, + }; + + let market_actor_get_balance_exported_params = Address::new_id(1000); + + let market_actor_settle_deal_payments_params = SettleDealPaymentsParams { + deal_ids: { + let mut bf = BitField::new(); + bf.set(42); + bf + }, + }; + + let market_actor_get_deal_data_commitment_params = DealQueryParams { id: 0 }; + + let _market_actor_sector_content_changed_params = { + ext::miner::SectorContentChangedParams { + sectors: vec![create_sector_changes()], + } + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::AddBalance as u64, + to_vec(&market_actor_add_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::WithdrawBalance as u64, + to_vec(&market_actor_withdraw_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::PublishStorageDeals as u64, + to_vec(&market_actor_publish_storage_deals_params)?, + tipset.key().into(), + ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/409 + // Enable this test when lotus supports this method + // RpcTest::identity(StateDecodeParams::request(( + // Address::MARKET_ACTOR, + // Method::BatchActivateDeals as u64, + // to_vec(&market_actor_batch_activate_deals_params)?, + // tipset.key().into(), + // ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/408 + // Enable this test once Lotus adds the `sector_number` field. + // RpcTest::identity(StateDecodeParams::request(( + // Address::MARKET_ACTOR, + // Method::VerifyDealsForActivation as u64, + // to_vec(&market_actor_verify_deals_for_activation_params)?, + // tipset.key().into(), + // ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/408 + // Enable this test when lotus supports correct types in go-state-types. + // RpcTest::identity(StateDecodeParams::request(( + // Address::MARKET_ACTOR, + // Method::OnMinerSectorsTerminate as u64, + // to_vec(&market_actor_on_miner_sectors_terminate_params)?, + // tipset.key().into(), + // ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::Constructor as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::CronTick as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::AddBalanceExported as u64, + to_vec(&market_actor_get_balance_exported_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::WithdrawBalanceExported as u64, + to_vec(&market_actor_withdraw_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::PublishStorageDealsExported as u64, + to_vec(&market_actor_publish_storage_deals_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetBalanceExported as u64, + to_vec(&market_actor_get_balance_exported_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealDataCommitmentExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealClientExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealProviderExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealLabelExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealTermExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealTotalPriceExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealClientCollateralExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealProviderCollateralExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealVerifiedExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealActivationExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::GetDealSectorExported as u64, + to_vec(&market_actor_get_deal_data_commitment_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::MARKET_ACTOR, + Method::SettleDealPaymentsExported as u64, + to_vec(&market_actor_settle_deal_payments_params)?, + tipset.key().into(), + ))?), + // TODO(lotus): https://github.com/filecoin-project/lotus/issues/13329 + // Lotus panics while decoding this method. + // RpcTest::identity(StateDecodeParams::request(( + // Address::MARKET_ACTOR, + // Method::SectorContentChangedExported as u64, + // to_vec(&market_actor_sector_content_changed_params)?, + // tipset.key().into(), + // ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/miner.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/miner.rs new file mode 100644 index 000000000000..45097f346df1 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/miner.rs @@ -0,0 +1,506 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_miner_state::v17::*; +use fil_actors_shared::v17::reward::FilterEstimate; +use fvm_ipld_encoding::{BytesDe, RawBytes}; +use fvm_shared4::randomness::Randomness; + +/// Creates state decode params tests for the Miner actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let miner_constructor_params = MinerConstructorParams { + owner: Address::new_id(1000).into(), + worker: Address::new_id(1001).into(), + control_addresses: vec![Address::new_id(1002).into(), Address::new_id(1003).into()], + window_post_proof_type: fvm_shared4::sector::RegisteredPoStProof::StackedDRGWindow32GiBV1P1, + peer_id: b"miner".to_vec(), + multi_addresses: Default::default(), + }; + + let miner_change_worker_params = ChangeWorkerAddressParams { + new_worker: Address::new_id(2000).into(), + new_control_addresses: vec![Address::new_id(2001).into()], + }; + + let miner_change_peer_id_params = ChangePeerIDParams { + new_id: b"new_peer".to_vec(), + }; + + let miner_change_multiaddrs_params = ChangeMultiaddrsParams { + new_multi_addrs: vec![BytesDe(vec![1, 2, 3])], + }; + + let miner_change_owner_params = ChangeOwnerAddressParams { + new_owner: Address::new_id(3000).into(), + }; + + let miner_change_beneficiary_params = ChangeBeneficiaryParams { + new_beneficiary: Address::new_id(4000).into(), + new_quota: TokenAmount::from_atto(1000000000000000000u64).into(), + new_expiration: 1000, + }; + + let miner_withdraw_balance_params = WithdrawBalanceParams { + amount_requested: TokenAmount::from_atto(500000000000000000u64).into(), + }; + + let miner_submit_windowed_post_params = SubmitWindowedPoStParams { + deadline: 0, + partitions: vec![PoStPartition { + index: 0, + skipped: Default::default(), + }], + proofs: vec![], + chain_commit_epoch: 0, + chain_commit_rand: Randomness(vec![1, 22, 43]), + }; + + let miner_terminate_sectors_params = TerminateSectorsParams { + terminations: vec![TerminationDeclaration { + deadline: 0, + partition: 0, + sectors: Default::default(), + }], + }; + + let miner_declare_faults_params = DeclareFaultsParams { + faults: vec![FaultDeclaration { + deadline: 0, + partition: 0, + sectors: Default::default(), + }], + }; + + let miner_declare_faults_recovered_params = DeclareFaultsRecoveredParams { + recoveries: vec![RecoveryDeclaration { + deadline: 0, + partition: 0, + sectors: Default::default(), + }], + }; + + let miner_deferred_cron_event_params = DeferredCronEventParams { + event_payload: vec![], + reward_smoothed: FilterEstimate { + position: Default::default(), + velocity: Default::default(), + }, + quality_adj_power_smoothed: FilterEstimate { + position: Default::default(), + velocity: Default::default(), + }, + }; + + let miner_check_sector_proven_params = CheckSectorProvenParams { sector_number: 0 }; + + let miner_apply_reward_params = ApplyRewardParams { + reward: TokenAmount::from_atto(1000000000000000000u64).into(), + penalty: TokenAmount::from_atto(0u64).into(), + }; + + let miner_report_consensus_fault_params = ReportConsensusFaultParams { + header1: vec![], + header2: vec![], + header_extra: vec![], + }; + + let miner_compact_partitions_params = CompactPartitionsParams { + deadline: 0, + partitions: Default::default(), + }; + + let miner_compact_sector_numbers_params = CompactSectorNumbersParams { + mask_sector_numbers: Default::default(), + }; + + let miner_dispute_windowed_post_params = DisputeWindowedPoStParams { + deadline: 0, + post_index: 0, + }; + + let miner_pre_commit_sector_batch2_params = PreCommitSectorBatchParams2 { + sectors: vec![SectorPreCommitInfo { + seal_proof: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1P1, + sector_number: 0, + sealed_cid: Cid::default(), + seal_rand_epoch: 0, + deal_ids: vec![], + expiration: 1000, + unsealed_cid: CompactCommD(None), + }], + }; + + let miner_extend_sector_expiration2_params = ExtendSectorExpiration2Params { + extensions: vec![ExpirationExtension2 { + deadline: 0, + partition: 0, + sectors: Default::default(), + sectors_with_claims: vec![], + new_expiration: 1000, + }], + }; + + let miner_is_controlling_address_param = IsControllingAddressParam { + address: Address::new_id(5000).into(), + }; + + let miner_prove_commit_sectors3_params = ProveCommitSectors3Params { + sector_activations: vec![SectorActivationManifest { + sector_number: 0, + pieces: vec![PieceActivationManifest { + cid: Cid::default(), + size: fvm_shared4::piece::PaddedPieceSize(23), + verified_allocation_key: None, + notify: vec![], + }], + }], + sector_proofs: vec![RawBytes::new(vec![])], + aggregate_proof: RawBytes::new(vec![]), + aggregate_proof_type: None, + require_activation_success: true, + require_notification_success: true, + }; + + let miner_prove_replica_updates3_params = ProveReplicaUpdates3Params { + sector_updates: vec![SectorUpdateManifest { + sector: 0, + deadline: 0, + partition: 0, + new_sealed_cid: Cid::default(), + pieces: vec![PieceActivationManifest { + cid: Cid::default(), + size: fvm_shared4::piece::PaddedPieceSize(12), + verified_allocation_key: None, + notify: vec![], + }], + }], + sector_proofs: vec![RawBytes::new(vec![])], + aggregate_proof: RawBytes::new(vec![]), + update_proofs_type: fvm_shared4::sector::RegisteredUpdateProof::StackedDRG2KiBV1, + aggregate_proof_type: None, + require_activation_success: true, + require_notification_success: true, + }; + + let miner_prove_commit_sectors_ni_params = ProveCommitSectorsNIParams { + sectors: vec![SectorNIActivationInfo { + sealing_number: 12, + sealer_id: 23343, + sealed_cid: Cid::default(), + sector_number: 2343, + seal_rand_epoch: 2343, + expiration: 1000, + }], + aggregate_proof: RawBytes::new(vec![23, 2, 23]), + seal_proof_type: fvm_shared4::sector::RegisteredSealProof::StackedDRG2KiBV1P1, + aggregate_proof_type: fvm_shared4::sector::RegisteredAggregateProof::SnarkPackV1, + proving_deadline: 234, + require_activation_success: true, + }; + + let miner_internal_sector_setup_for_preseal_params = InternalSectorSetupForPresealParams { + sectors: vec![0], + reward_smoothed: FilterEstimate { + position: Default::default(), + velocity: Default::default(), + }, + reward_baseline_power: Default::default(), + quality_adj_power_smoothed: FilterEstimate { + position: Default::default(), + velocity: Default::default(), + }, + }; + + // let miner_max_termination_fee_params = MaxTerminationFeeParams { + // power: Default::default(), + // initial_pledge: TokenAmount::from_atto(1000000000000000000u64).into(), + // }; + + const MINER_ADDRESS: Address = Address::new_id(78216); + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::Constructor as u64, + to_vec(&miner_constructor_params)?, + tipset.key().into(), + ))?), + // Methods without parameters + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ControlAddresses as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeWorkerAddress as u64, + to_vec(&miner_change_worker_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangePeerID as u64, + to_vec(&miner_change_peer_id_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::SubmitWindowedPoSt as u64, + to_vec(&miner_submit_windowed_post_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::TerminateSectors as u64, + to_vec(&miner_terminate_sectors_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::DeclareFaults as u64, + to_vec(&miner_declare_faults_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::DeclareFaultsRecovered as u64, + to_vec(&miner_declare_faults_recovered_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::OnDeferredCronEvent as u64, + to_vec(&miner_deferred_cron_event_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::CheckSectorProven as u64, + to_vec(&miner_check_sector_proven_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ApplyRewards as u64, + to_vec(&miner_apply_reward_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ReportConsensusFault as u64, + to_vec(&miner_report_consensus_fault_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::WithdrawBalance as u64, + to_vec(&miner_withdraw_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::InternalSectorSetupForPreseal as u64, + to_vec(&miner_internal_sector_setup_for_preseal_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeMultiaddrs as u64, + to_vec(&miner_change_multiaddrs_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::CompactPartitions as u64, + to_vec(&miner_compact_partitions_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::CompactSectorNumbers as u64, + to_vec(&miner_compact_sector_numbers_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ConfirmChangeWorkerAddress as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::RepayDebt as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeOwnerAddress as u64, + to_vec(&miner_change_owner_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::DisputeWindowedPoSt as u64, + to_vec(&miner_dispute_windowed_post_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::PreCommitSectorBatch2 as u64, + to_vec(&miner_pre_commit_sector_batch2_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeBeneficiary as u64, + to_vec(&miner_change_beneficiary_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetBeneficiary as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ExtendSectorExpiration2 as u64, + to_vec(&miner_extend_sector_expiration2_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ProveCommitSectors3 as u64, + to_vec(&miner_prove_commit_sectors3_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ProveReplicaUpdates3 as u64, + to_vec(&miner_prove_replica_updates3_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ProveCommitSectorsNI as u64, + to_vec(&miner_prove_commit_sectors_ni_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeWorkerAddressExported as u64, + to_vec(&miner_change_worker_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangePeerIDExported as u64, + to_vec(&miner_change_peer_id_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::WithdrawBalanceExported as u64, + to_vec(&miner_withdraw_balance_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeMultiaddrsExported as u64, + to_vec(&miner_change_multiaddrs_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ConfirmChangeWorkerAddressExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::RepayDebtExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeOwnerAddressExported as u64, + to_vec(&miner_change_owner_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::ChangeBeneficiaryExported as u64, + to_vec(&miner_change_beneficiary_params)?, + tipset.key().into(), + ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/403 + // Enable this test once lotus starts supporting this. + // RpcTest::identity(StateDecodeParams::request(( + // MINER_ADDRESS, + // Method::GetBeneficiaryExported as u64, + // vec![], + // tipset.key().into(), + // ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetOwnerExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::IsControllingAddressExported as u64, + to_vec(&miner_is_controlling_address_param)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetSectorSizeExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetAvailableBalanceExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetVestingFundsExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetPeerIDExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + MINER_ADDRESS, + Method::GetMultiaddrsExported as u64, + vec![], + tipset.key().into(), + ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/403 + // Enable this test once lotus starts supporting this. + // RpcTest::identity(StateDecodeParams::request(( + // MINER_ADDRESS, + // Method::MaxTerminationFeeExported as u64, + // to_vec(&miner_max_termination_fee_params)?, + // tipset.key().into(), + // ))?), + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/403 + // Enable this test once lotus starts supporting this. + // RpcTest::identity(StateDecodeParams::request(( + // MINER_ADDRESS, + // Method::InitialPledgeExported as u64, + // vec![], + // tipset.key().into(), + // ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/mod.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/mod.rs new file mode 100644 index 000000000000..41ea269d16f6 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/mod.rs @@ -0,0 +1,51 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use crate::blocks::Tipset; +use crate::rpc::RpcMethodExt; +use crate::rpc::prelude::StateDecodeParams; +use crate::shim::address::Address; +use crate::shim::econ::TokenAmount; +use crate::tool::subcommands::api_cmd::api_compare_tests::RpcTest; +use anyhow::Result; +use cid::Cid; +use fvm_ipld_encoding::to_vec; + +mod account; +mod cron; +mod datacap; +mod eam; +mod ethaccount; +mod evm; +mod init; +mod market; +mod miner; +mod multisig; +mod paych; +mod power; +mod reward; +mod system; +mod verified_reg; + +/// Creates all state decode params tests for all supported actors. +pub fn create_all_state_decode_params_tests(tipset: &Tipset) -> Result> { + let mut tests = Vec::new(); + + tests.extend(account::create_tests(tipset)?); + tests.extend(datacap::create_tests(tipset)?); + tests.extend(eam::create_tests(tipset)?); + tests.extend(evm::create_tests(tipset)?); + tests.extend(init::create_tests(tipset)?); + tests.extend(market::create_tests(tipset)?); + tests.extend(miner::create_tests(tipset)?); + tests.extend(multisig::create_tests(tipset)?); + tests.extend(paych::create_tests(tipset)?); + tests.extend(power::create_tests(tipset)?); + tests.extend(reward::create_tests(tipset)?); + tests.extend(verified_reg::create_tests(tipset)?); + tests.extend(cron::create_tests(tipset)?); + tests.extend(ethaccount::create_tests(tipset)?); + tests.extend(system::create_tests(tipset)?); + + Ok(tests) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/multisig.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/multisig.rs new file mode 100644 index 000000000000..37fb2e1187bb --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/multisig.rs @@ -0,0 +1,120 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use base64::{Engine, prelude::BASE64_STANDARD}; +use fil_actor_multisig_state::v17::*; + +/// Creates state decode params tests for the Multisig actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let multisig_constructor_params = ConstructorParams { + signers: vec![Address::new_id(1000).into(), Address::new_id(1001).into()], + num_approvals_threshold: Default::default(), + unlock_duration: Default::default(), + start_epoch: Default::default(), + }; + + let multisig_propose_params = ProposeParams { + to: Address::new_id(1000).into(), + value: Default::default(), + method: 0, + params: Default::default(), + }; + + let multisig_tx_id_params = TxnIDParams { + id: Default::default(), + proposal_hash: vec![Default::default()], + }; + + let multisig_add_signer_params = AddSignerParams { + signer: Address::new_id(1012).into(), + increase: false, + }; + + let multisig_remove_signer_params = RemoveSignerParams { + signer: Address::new_id(1012).into(), + decrease: false, + }; + + let multisig_swap_signer_params = SwapSignerParams { + from: Address::new_id(122).into(), + to: Address::new_id(1234).into(), + }; + + let multisig_change_num_app_params = ChangeNumApprovalsThresholdParams { new_threshold: 2 }; + + let multisig_lock_bal_params = LockBalanceParams { + start_epoch: 22, + unlock_duration: 12, + amount: Default::default(), + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::Constructor as u64, + to_vec(&multisig_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::Propose as u64, + to_vec(&multisig_propose_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::Approve as u64, + to_vec(&multisig_tx_id_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::Cancel as u64, + to_vec(&multisig_tx_id_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::AddSigner as u64, + to_vec(&multisig_add_signer_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::RemoveSigner as u64, + to_vec(&multisig_remove_signer_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::SwapSigner as u64, + to_vec(&multisig_swap_signer_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::ChangeNumApprovalsThreshold as u64, + to_vec(&multisig_change_num_app_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::LockBalance as u64, + to_vec(&multisig_lock_bal_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::LockBalance as u64, + to_vec(&multisig_lock_bal_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::new_id(18101), // https://calibration.filscan.io/en/address/t018101/, + Method::UniversalReceiverHook as u64, + BASE64_STANDARD.decode("ghgqRBI0Vng=")?, + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/paych.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/paych.rs new file mode 100644 index 000000000000..ff31ca0ba650 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/paych.rs @@ -0,0 +1,65 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_paych_state::v17::*; + +/// Creates state decode params tests for the Payment Channel actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + // payment channel actor address `t066116` + // https://calibration.filscan.io/en/address/t066116/ + let paych_address = Address::new_id(66116); + + let constructor_params = ConstructorParams { + from: Address::new_id(1234).into(), + to: Address::new_id(8457).into(), + }; + + let update_channel_state = UpdateChannelStateParams { + sv: SignedVoucher { + channel_addr: Address::new_id(1000).into(), + time_lock_min: 21, + time_lock_max: 234, + secret_pre_image: vec![], + extra: Some(ModVerifyParams { + actor: Address::new_id(1234).into(), + method: 223, + data: Default::default(), + }), + lane: 234, + nonce: 231, + amount: Default::default(), + min_settle_height: 0, + merges: vec![], + signature: None, + }, + secret: vec![0x11, 0x22, 0x33, 0x44, 0x55], // dummy data + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + paych_address, + Method::Constructor as u64, + to_vec(&constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + paych_address, + Method::UpdateChannelState as u64, + to_vec(&update_channel_state)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + paych_address, + Method::Settle as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + paych_address, + Method::Collect as u64, + vec![], + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/power.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/power.rs new file mode 100644 index 000000000000..cd2260ae9054 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/power.rs @@ -0,0 +1,121 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use crate::shim::sector::StoragePower; +use fil_actor_power_state::v17::*; + +/// Creates state decode params tests for the Storage Power actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let power_create_miner_params = CreateMinerParams { + owner: Address::new_id(1000).into(), + worker: Address::new_id(1001).into(), + window_post_proof_type: fvm_shared4::sector::RegisteredPoStProof::StackedDRGWindow32GiBV1P1, + peer: b"miner".to_vec(), + multiaddrs: Default::default(), + }; + + // not supported by the lotus + // let _power_miner_power_exp_params = MinerPowerParams{ + // miner: 1234, + // }; + + let power_update_claim_params = UpdateClaimedPowerParams { + raw_byte_delta: StoragePower::from(1024u64), + quality_adjusted_delta: StoragePower::from(2048u64), + }; + + let power_enroll_event_params = EnrollCronEventParams { + event_epoch: 123, + payload: Default::default(), + }; + + let power_update_pledge_ttl_params = UpdatePledgeTotalParams { + pledge_delta: Default::default(), + }; + + let power_miner_raw_params = MinerRawPowerParams { miner: 1234 }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::CreateMiner as u64, + to_vec(&power_create_miner_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::UpdateClaimedPower as u64, + to_vec(&power_update_claim_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::EnrollCronEvent as u64, + to_vec(&power_enroll_event_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::UpdatePledgeTotal as u64, + to_vec(&power_update_pledge_ttl_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::CreateMinerExported as u64, + to_vec(&power_create_miner_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::MinerRawPowerExported as u64, + to_vec(&power_miner_raw_params)?, + tipset.key().into(), + ))?), + // Not supported by the lotus, + // TODO(go-state-types): https://github.com/filecoin-project/go-state-types/issues/401 + // RpcTest::identity(StateDecodeParams::request(( + // Address::POWER_ACTOR, + // Method::MinerPowerExported as u64, + // to_vec(&power_miner_power_exp_params)?, + // tipset.key().into(), + // ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::Constructor as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::OnEpochTickEnd as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::CurrentTotalPower as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::NetworkRawPowerExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::MinerCountExported as u64, + vec![], + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::POWER_ACTOR, + Method::MinerConsensusCountExported as u64, + vec![], + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/reward.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/reward.rs new file mode 100644 index 000000000000..bdc463e041d0 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/reward.rs @@ -0,0 +1,53 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_reward_state::v17::*; +use num_bigint::BigInt; + +/// Creates state decode params tests for the Reward actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let reward_constructor_params = ConstructorParams { + power: Some(Default::default()), + }; + + let reward_award_block_reward_params = AwardBlockRewardParams { + miner: Address::new_id(1000).into(), + penalty: Default::default(), + gas_reward: Default::default(), + win_count: 0, + }; + + let reward_update_network_params = UpdateNetworkKPIParams { + curr_realized_power: Option::from(fvm_shared4::bigint::bigint_ser::BigIntDe(BigInt::from( + 111, + ))), + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::REWARD_ACTOR, + Method::Constructor as u64, + to_vec(&reward_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::REWARD_ACTOR, + Method::AwardBlockReward as u64, + to_vec(&reward_award_block_reward_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::REWARD_ACTOR, + Method::UpdateNetworkKPI as u64, + to_vec(&reward_update_network_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::REWARD_ACTOR, + Method::ThisEpochReward as u64, + vec![], + tipset.key().into(), + ))?), + ]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/system.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/system.rs new file mode 100644 index 000000000000..49e178cfc7ed --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/system.rs @@ -0,0 +1,15 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use fil_actor_system_state::v17::*; + +/// Creates state decode params tests for the System actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + Ok(vec![RpcTest::identity(StateDecodeParams::request(( + Address::SYSTEM_ACTOR, + Method::Constructor as u64, + vec![], + tipset.key().into(), + ))?)]) +} diff --git a/src/tool/subcommands/api_cmd/state_decode_params_tests/verified_reg.rs b/src/tool/subcommands/api_cmd/state_decode_params_tests/verified_reg.rs new file mode 100644 index 000000000000..ed143f85e941 --- /dev/null +++ b/src/tool/subcommands/api_cmd/state_decode_params_tests/verified_reg.rs @@ -0,0 +1,194 @@ +// Copyright 2019-2025 ChainSafe Systems +// SPDX-License-Identifier: Apache-2.0, MIT + +use super::*; +use crate::shim::sector::StoragePower; +use fil_actor_verifreg_state::v17::*; + +/// Creates state decode params tests for the Verified Registry actor. +pub fn create_tests(tipset: &Tipset) -> Result> { + let verified_reg_constructor_params = ConstructorParams { + root_key: Address::new_id(1000).into(), + }; + + let verified_reg_add_verifier_params = AddVerifierParams { + address: Address::new_id(1234).into(), + allowance: StoragePower::from(1048576u64), // 1MB + }; + + let verified_reg_remove_verifier_params = RemoveVerifierParams { + verifier: Address::new_id(1234).into(), + }; + + let verified_reg_add_verified_client_params = AddVerifiedClientParams { + address: Address::new_id(1235).into(), + allowance: types::DataCap::from(2097152u64), // 2MB + }; + + let verified_reg_remove_data_cap_params = RemoveDataCapParams { + verified_client_to_remove: Address::new_id(1236).into(), + data_cap_amount_to_remove: types::DataCap::from(1048576u64), + verifier_request_1: RemoveDataCapRequest { + verifier: Address::new_id(1237).into(), + signature: fvm_shared4::crypto::signature::Signature::new_bls( + b"test_signature_1".to_vec(), + ), + }, + verifier_request_2: RemoveDataCapRequest { + verifier: Address::new_id(1238).into(), + signature: fvm_shared4::crypto::signature::Signature::new_secp256k1( + b"test_signature_2".to_vec(), + ), + }, + }; + + let verified_reg_remove_expired_allocations_params = RemoveExpiredAllocationsParams { + client: 1239, + allocation_ids: vec![1001, 1002, 1003], + }; + + let verified_reg_claim_allocations_params = ClaimAllocationsParams { + sectors: vec![SectorAllocationClaims { + sector: 42, + expiry: 2000000, + claims: vec![ + AllocationClaim { + client: 1240, + allocation_id: 2001, + data: Cid::default(), + size: fvm_shared4::piece::PaddedPieceSize(1024), + }, + AllocationClaim { + client: 1241, + allocation_id: 2002, + data: Cid::default(), + size: fvm_shared4::piece::PaddedPieceSize(2048), + }, + ], + }], + all_or_nothing: false, + }; + + let verified_reg_get_claims_params = GetClaimsParams { + provider: 1242, + claim_ids: vec![3001, 3002, 3003], + }; + + let verified_reg_extend_claim_terms_params = ExtendClaimTermsParams { + terms: vec![ClaimTerm { + provider: 12, + claim_id: 12, + term_max: 123, + }], + }; + + let verified_reg_remove_expired_claims_params = RemoveExpiredClaimsParams { + provider: 1243, + claim_ids: vec![4001, 4002, 4003], + }; + + let verified_reg_universal_receiver_params = + fvm_actor_utils::receiver::UniversalReceiverParams { + type_: 42, + payload: fvm_ipld_encoding::RawBytes::new(vec![0x12, 0x34, 0x56, 0x78]), + }; + + Ok(vec![ + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::Constructor as u64, + to_vec(&verified_reg_constructor_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::AddVerifier as u64, + to_vec(&verified_reg_add_verifier_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveVerifier as u64, + to_vec(&verified_reg_remove_verifier_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::AddVerifiedClient as u64, + to_vec(&verified_reg_add_verified_client_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveVerifiedClientDataCap as u64, + to_vec(&verified_reg_remove_data_cap_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveExpiredAllocations as u64, + to_vec(&verified_reg_remove_expired_allocations_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::ClaimAllocations as u64, + to_vec(&verified_reg_claim_allocations_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::GetClaims as u64, + to_vec(&verified_reg_get_claims_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::ExtendClaimTerms as u64, + to_vec(&verified_reg_extend_claim_terms_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveExpiredClaims as u64, + to_vec(&verified_reg_remove_expired_claims_params)?, + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::AddVerifiedClientExported as u64, + to_vec(&verified_reg_add_verified_client_params)?, // reuse same params + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveExpiredAllocationsExported as u64, + to_vec(&verified_reg_remove_expired_allocations_params)?, // reuse same params + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::GetClaimsExported as u64, + to_vec(&verified_reg_get_claims_params)?, // reuse same params + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::ExtendClaimTermsExported as u64, + to_vec(&verified_reg_extend_claim_terms_params)?, // reuse same params + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::RemoveExpiredClaimsExported as u64, + to_vec(&verified_reg_remove_expired_claims_params)?, // reuse same params + tipset.key().into(), + ))?), + RpcTest::identity(StateDecodeParams::request(( + Address::VERIFIED_REGISTRY_ACTOR, + Method::UniversalReceiverHook as u64, + to_vec(&verified_reg_universal_receiver_params)?, + tipset.key().into(), + ))?), + ]) +} From 1cf372f5581b8b83cba1fb710836eedb25c29bbf Mon Sep 17 00:00:00 2001 From: "leshyatwork[bot]" <217592034+leshyatwork[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 08:56:48 +0530 Subject: [PATCH 12/34] [automated] Update Lotus version in API tests (#6072) Co-authored-by: leshyatwork[bot] <217592034+leshyatwork[bot]@users.noreply.github.com> --- scripts/tests/api_compare/.env | 2 +- scripts/tests/bootstrapper/.env | 2 +- scripts/tests/snapshot_parity/.env | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tests/api_compare/.env b/scripts/tests/api_compare/.env index 3add2c737401..9baf6b902ece 100644 --- a/scripts/tests/api_compare/.env +++ b/scripts/tests/api_compare/.env @@ -1,6 +1,6 @@ # Note: this should be a `fat` image so that it contains the pre-downloaded filecoin proof parameters FOREST_IMAGE=ghcr.io/chainsafe/forest:edge-fat -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-rc2-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 diff --git a/scripts/tests/bootstrapper/.env b/scripts/tests/bootstrapper/.env index c12219706d3c..a35c4e295fe5 100644 --- a/scripts/tests/bootstrapper/.env +++ b/scripts/tests/bootstrapper/.env @@ -1,5 +1,5 @@ # Note: this should be a `fat` image so that it contains the pre-downloaded filecoin proof parameters -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-rc2-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 diff --git a/scripts/tests/snapshot_parity/.env b/scripts/tests/snapshot_parity/.env index f60209aff7dd..db97512f1fd5 100644 --- a/scripts/tests/snapshot_parity/.env +++ b/scripts/tests/snapshot_parity/.env @@ -1,4 +1,4 @@ -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-rc2-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.0-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 From 1b07ff2a5f9b9015a3bf97d18fafbbb06e4826cc Mon Sep 17 00:00:00 2001 From: signor1 Date: Tue, 16 Sep 2025 13:11:31 +0100 Subject: [PATCH 13/34] feat: updated forest.dic --- .config/forest.dic | 90 +++++++++++----------------------- scripts/devnet-curio/README.md | 2 +- scripts/devnet/README.md | 2 +- 3 files changed, 30 insertions(+), 64 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 1a6a76c82fb8..4d26230e0e62 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,28 +1,18 @@ 73 -0s -1h -100GiB -14GiB -51ms -60GiB -7GiB -2k Abell abi -addr -addrs ActorID ActorState +addr/S algo Algorand/M allocator Ameen Ansermino -API/M -Api +API/S APIs -API-V1-compatible api +API-V1-compatible approx_cmp Archlinux args @@ -104,7 +94,6 @@ ChainNotify ChainSafe ChainSafe/M chainsafe -ChainSafe's ChainStore chainstore ChainSync @@ -112,7 +101,7 @@ chainsync ChainSyncer changelog chrono -CID/SM +CID/S CIDs cid circ @@ -132,8 +121,7 @@ codeowners commcid computing Config -config -configs +config/S Connor cov creativ @@ -145,6 +133,7 @@ crypto cryptographic ctrl ctrl-c +CurrentEpoch daemon daemonize DAGJson @@ -157,20 +146,17 @@ de DealProposal Denethor Denethor/M -Denethor's dep deps deserialisation/M Deserialization deserialization -deserialize deserialize/D deserializing destructuring dev_comments -devnet +devnet/S Devnet -devnets Devops Devs DHT @@ -193,9 +179,8 @@ Elmattic empty_params Env env -enum +enum/S Enum -enums EOF Etaoin Etaoin/M @@ -203,7 +188,6 @@ eth Eth EthCallMessage Ethereum -everything EVM exa expirations @@ -243,9 +227,8 @@ Filfox Filops FilOz filesystem -FIP +FIP/S FIP-0085 -FIPs fmt fn Foldesi @@ -272,6 +255,7 @@ gitignore GossipSub Gossipsub gossipsub +Grafana GraphQL GraphSync Guillaume @@ -281,7 +265,6 @@ Hamt hamt HAMT hardcoded -hardlink hardlink/S hasher healthcheck @@ -294,10 +277,7 @@ i64 IaC Ijon Ijon/M -impl -impls -Implementers -implementers +impl/S implementor/SM indexmap Init @@ -305,10 +285,9 @@ init InitActor InternalServerError Interop -interop +interop/S interopnet Interopnet -interops invariants io ip @@ -323,9 +302,8 @@ JSON Json json JSON-RPC -JWT +JWT/S jwt -JWTs Kad Kademlia keypair @@ -342,8 +320,7 @@ libp2p LibP2P Libp2p libsecp256k1 -Linters -linters +linter/S Linux liveness Liveness @@ -368,6 +345,7 @@ MdBook mdbook MDNS mdns +MDX mempool Mempool Merkle @@ -382,8 +360,7 @@ MethodParams mh MiB middleware -migrator -migrators +migrator/S milliGas Mische Mishra @@ -393,8 +370,7 @@ Mojica MPool Mpool mpool -MsgPool -msgs +msg/S Mullett multiaddr/SM multiaddress @@ -436,10 +412,10 @@ nv17 nv24 nvXX NVMe +Ok Olivero onwards -OOMs -Ok +OOM/S Open OpenRPC orchestrator @@ -454,7 +430,6 @@ Parallelize Parametrize param/SM param -params ParityDB ParityDb parsable @@ -476,12 +451,12 @@ pre-made pre-migrations preload preloaded +PR/S progressbar prometheus proofs-api protobuf protoc -PRs pubsub Q4 R2 @@ -494,13 +469,13 @@ readme ref-fvm reflow ReportConsensusFault -repo -repos +repo/S ResponseManager retag Reth Reth-like rle +RLP RNG Roadmap roadmap @@ -525,8 +500,8 @@ RUSTSEC-2022-0009 S3-compatible Sampanthan sccache -schema/SM -schemas +Schema/S +schema/S schemars/M Schoe SECP @@ -555,8 +530,7 @@ Songthaew Sqlx Stackoverflow standardised -statediff -statediffs +statediff/S stateful Stateful StateManager @@ -571,11 +545,9 @@ StoragePower struct/SM struct structops -structs Styleguides styleguides -subcommand -subcommands +subcommand/S submitwindowedpost/M summarization swappiness @@ -586,7 +558,6 @@ SyncManager SyncStateMachine Syncer syscall/S -syscalls TabItem Taggart TBD @@ -606,7 +577,6 @@ tipset/SM tipsetconversions TipsetKeys tipsetkey/S -tipsets ToCid TokenAmount tokio @@ -620,6 +590,7 @@ TukTuk TxnIdParams txn_id ubuntu +UI unbanned uncompress unencrypted @@ -674,9 +645,4 @@ yaml yml YugabyteDB Ziegelmayer -zstd -CurrentEpoch -RLP -Grafana -UI -MDX \ No newline at end of file +zstd \ No newline at end of file diff --git a/scripts/devnet-curio/README.md b/scripts/devnet-curio/README.md index 963afc19a111..d14e2623b2e3 100644 --- a/scripts/devnet-curio/README.md +++ b/scripts/devnet-curio/README.md @@ -29,7 +29,7 @@ docker compose up --build This will build the local Forest (using the Dockerfile in the project's root) image, tagged Lotus and setup the devnet. Initial setup may be slow due to -fetching params and setting everyting up. Consecutive starts will be quick. +fetching params and setting everything up. Consecutive starts will be quick. Stop the devnet with: diff --git a/scripts/devnet/README.md b/scripts/devnet/README.md index 0dc7418a4409..e6985a049500 100644 --- a/scripts/devnet/README.md +++ b/scripts/devnet/README.md @@ -24,7 +24,7 @@ docker compose up --build This will build the local Forest (using the Dockerfile in the project's root) image, tagged Lotus and setup the devnet. Initial setup may be slow due to -fetching params and setting everyting up. Consecutive starts will be quick. +fetching params and setting everything up. Consecutive starts will be quick. Stop the devnet with: From 5d5449d482001b01440436616e34428d66bdd7b8 Mon Sep 17 00:00:00 2001 From: signor1 Date: Tue, 16 Sep 2025 14:28:46 +0100 Subject: [PATCH 14/34] feat: updated forest.dic --- .config/forest.dic | 121 ++++----------------------------------------- 1 file changed, 10 insertions(+), 111 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 4d26230e0e62..fa5151ed8960 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -9,18 +9,15 @@ Algorand/M allocator Ameen Ansermino -API/S APIs api API-V1-compatible approx_cmp Archlinux args -arities -arity +arity/S arm64 async -Async async-std async_std asyncverification @@ -28,8 +25,7 @@ asynchronous_codec attoFIL Ayush B4 -backend -backend. +backend/ backfilling backport bajillion @@ -41,24 +37,14 @@ benchmarking BigInt BigUint bitfield -BitField -Bitfield -bitswap -Bitswap -bitswap. +bitswap/M bitvec BLAKE2b BlockHeader -Blockheader -BlockSync -Blocksync blocksync blockchain/M -blockstore -Blockstore blockstore/SM bls -BLS bls_signatures blst bootnodes @@ -68,11 +54,9 @@ BufferedBlockstore bugfix BuildKit butterflynet -Butterflynet C1 calc calibnet -Calibnet calibnet-related calldata callee @@ -84,33 +68,24 @@ CAR/SM cardinality CARv1/SM CARv2/SM -CBOR -Cbor cbor cfg ChainEpoch ChainExchange ChainNotify -ChainSafe ChainSafe/M -chainsafe -ChainStore chainstore -ChainSync chainsync ChainSyncer changelog chrono -CID/S CIDs cid circ CircleCI CircSupply -CLI cli clippy -Clippy clonable Cloudflare codebase @@ -120,13 +95,10 @@ CodeID codeowners commcid computing -Config config/S Connor cov -creativ creativcoder -Cron cron CronEvents crypto @@ -139,35 +111,26 @@ daemonize DAGJson DagCBOR Dagny -Datacap datacap DB/S de DealProposal -Denethor Denethor/M -dep -deps +dep/S deserialisation/M -Deserialization -deserialization deserialize/D deserializing destructuring dev_comments devnet/S -Devnet Devops Devs DHT Diátaxis DigitalOcean DNS -Dockerfile -dockerfile -dockerfiles +dockerfile/S Docusaurus -Drand drand durations dutter @@ -177,15 +140,11 @@ EIP EIP155 Elmattic empty_params -Env env enum/S -Enum EOF -Etaoin Etaoin/M eth -Eth EthCallMessage Ethereum EVM @@ -213,14 +172,11 @@ F27 F28 fetch-params FFI -FIL fil fil-actor-interface fil-actor-states fil-proofs -Filecoin Filecoin/M -filecoin filecoin-project filecoin-proofs-api/M Filfox @@ -249,68 +205,50 @@ gh gh-pages Gianmarco GiB -GitHub github gitignore -GossipSub Gossipsub -gossipsub Grafana GraphQL GraphSync Guillaume -Hakuna Hakuna/M -Hamt hamt -HAMT hardcoded hardlink/S hasher healthcheck -Homebrew homebrew hotfix http-client i.e. i64 IaC -Ijon Ijon/M impl/S implementor/SM indexmap Init -init InitActor InternalServerError -Interop interop/S interopnet -Interopnet invariants io ip IPFS -IPLD -Ipld ipld Jaden -Jemalloc jemalloc JSON -Json -json JSON-RPC -JWT/S jwt +JWT/S Kad Kademlia keypair KeyStore -Keystore Kubernetes -kubernetes lazycell len LesnyRumcajs @@ -323,31 +261,23 @@ libsecp256k1 linter/S Linux liveness -Liveness -localhost -localhost's +localhost/M lockfile -lookups +lookup/S loopback LRU M1 M2 -MacOS macOS mainnet -Mainnet Makefile -makefile Markou Matata Matata/M -MdBook mdbook -MDNS mdns MDX mempool -Mempool Merkle messagepool MessageInfo @@ -368,22 +298,17 @@ MissingMethod MockRuntime Mojica MPool -Mpool -mpool msg/S Mullett multiaddr/SM -multiaddress -multiaddresses +multiaddress/S multibase multihash multimap multisig -Multisig mut mutex namespace -nata nata/M Natanael Neo4j @@ -406,10 +331,6 @@ NV23 NV24 NV25 NV27 -nv15 -nv16 -nv17 -nv24 nvXX NVMe Ok @@ -420,7 +341,6 @@ Open OpenRPC orchestrator Organisation -organisation os overriden overallocation @@ -429,13 +349,10 @@ p2p Parallelize Parametrize param/SM -param ParityDB -ParityDb parsable PathBuf Paych -paych peerid peerstores perf @@ -464,8 +381,6 @@ Raj Rajarupan reachability/M README -Readme -readme ref-fvm reflow ReportConsensusFault @@ -478,14 +393,8 @@ rle RLP RNG Roadmap -roadmap RocksDB -RocksDb -Rocksdb -rocksdb RPC -Rpc -rpc RPC-JSON/M Rupan Rusqlite @@ -522,7 +431,6 @@ sha256 shellcheck shrdlu Sig -sig sighup sigterm skippable @@ -532,20 +440,16 @@ Stackoverflow standardised statediff/S stateful -Stateful StateManager -StateTree statetree -stateroots +stateroot/S statrs stderr stdout Stmgr StoragePower struct/SM -struct structops -Styleguides styleguides subcommand/S submitwindowedpost/M @@ -571,11 +475,8 @@ tide-websockets tide-websockets-sink TiB TipIndex -Tipset -tipset tipset/SM tipsetconversions -TipsetKeys tipsetkey/S ToCid TokenAmount @@ -622,14 +523,12 @@ v14 validator/S varint vec -Verifier verifier verifreg Vermeulen virtualized VM/SM Vm -vm Volker VPS VRF From 0dd50d1e83dc8d96d65088bec17756a7f5512e83 Mon Sep 17 00:00:00 2001 From: signor1 Date: Tue, 16 Sep 2025 14:54:35 +0100 Subject: [PATCH 15/34] feat: updated forest.dic & spelling correction --- .cargo/config.toml | 2 +- .config/forest.dic | 28 ++++--------------- CHANGELOG.md | 4 +-- README.md | 2 +- .../chain_index_spike.md | 2 +- documentation/src/trouble_shooting.md | 2 +- 6 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index abb445a64c5c..452a53d2fe39 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -10,7 +10,7 @@ incremental = true # TODO(aatifsyed): remove - this can be pushed out to readme # In all cases, pass --cfg=tokio_unstable for tokio console integration # See (https://github.com/ChainSafe/forest/pull/2245) -# Note that this may be overriden by user configuration at ~/.cargo/config.toml +# Note that this may be overridden by user configuration at ~/.cargo/config.toml rustflags = ["--cfg=tokio_unstable"] [net] diff --git a/.config/forest.dic b/.config/forest.dic index fa5151ed8960..e8537d04e2ed 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,4 +1,4 @@ -73 +530 Abell abi ActorID @@ -13,7 +13,6 @@ APIs api API-V1-compatible approx_cmp -Archlinux args arity/S arm64 @@ -25,7 +24,7 @@ asynchronous_codec attoFIL Ayush B4 -backend/ +backend/M backfilling backport bajillion @@ -152,10 +151,8 @@ exa expirations ExitCode f3 -F3 F3-sidecar f4 -F4 F9 F10 F11 @@ -221,7 +218,7 @@ healthcheck homebrew hotfix http-client -i.e. +i.e i64 IaC Ijon/M @@ -255,8 +252,6 @@ LesnyRumcajs LetsEncrypt libs libp2p -LibP2P -Libp2p libsecp256k1 linter/S Linux @@ -282,7 +277,6 @@ Merkle messagepool MessageInfo MessageParams -MessagePool messageReceipt MethodNum MethodParameter @@ -331,9 +325,9 @@ NV23 NV24 NV25 NV27 -nvXX +NVXX NVMe -Ok +OK Olivero onwards OOM/S @@ -342,7 +336,6 @@ OpenRPC orchestrator Organisation os -overriden overallocation P2P p2p @@ -410,12 +403,10 @@ S3-compatible Sampanthan sccache Schema/S -schema/S schemars/M Schoe SECP -SECP256k1 -SecP256k1 +secp256k1 secio seekable semver @@ -435,8 +426,6 @@ sighup sigterm skippable Songthaew -Sqlx -Stackoverflow standardised statediff/S stateful @@ -502,16 +491,11 @@ URL utf8 utils UUID -V0 v0 -V1 v1 -V2 v2 -V3 v3 v4 -V5 v5 V7 v6 diff --git a/CHANGELOG.md b/CHANGELOG.md index edefb5144c92..09edd06bed13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -275,7 +275,7 @@ This is a mandatory release for calibnet node operators. It includes the revised ### Added -- [#5375](https://github.com/ChainSafe/forest/issues/5375) Add an RNG wrapper that that can be overriden by a reproducible seeded RNG. +- [#5375](https://github.com/ChainSafe/forest/issues/5375) Add an RNG wrapper that that can be overridden by a reproducible seeded RNG. - [#5386](https://github.com/ChainSafe/forest/pull/5386) Add support for the `Filecoin.EthTraceTransaction` RPC method. @@ -3342,7 +3342,7 @@ All initial change sets: ([#229](https://github.com/ChainSafe/forest/pull/229)) (Eric Tu) - `47dfb47c` Update multibase dependency for lowercase base32 support ([#239](https://github.com/ChainSafe/forest/pull/239)) (Austin Abell) -- `39a8d88e` Allow Address network prefix to be overriden for printing +- `39a8d88e` Allow Address network prefix to be overridden for printing ([#233](https://github.com/ChainSafe/forest/pull/233)) (Austin Abell) - `faa71386` Refactor SyncManager to have ownership over tipsets ([#238](https://github.com/ChainSafe/forest/pull/238)) (Austin Abell) diff --git a/README.md b/README.md index d16c5dfd017a..5695390b13cc 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Install [Go](https://go.dev/doc/install) sudo apt install build-essential clang ``` -### Archlinux +### Arch Linux ``` sudo pacman -S base-devel clang diff --git a/documentation/src/developer_documentation/chain_index_spike.md b/documentation/src/developer_documentation/chain_index_spike.md index f868861b799f..30f0f165c523 100644 --- a/documentation/src/developer_documentation/chain_index_spike.md +++ b/documentation/src/developer_documentation/chain_index_spike.md @@ -84,7 +84,7 @@ on how much historical state is indexed. **Question:** What are our options for Rust in this context? 1. **Rusqlite**? -2. **Sqlx** crate? In case of abstraction of the backend DB: +2. **SQLx** crate? In case of abstraction of the backend DB: - **PostgreSQL** - **SQLite** - Other options diff --git a/documentation/src/trouble_shooting.md b/documentation/src/trouble_shooting.md index d3731703de0f..9ef7196f01ca 100644 --- a/documentation/src/trouble_shooting.md +++ b/documentation/src/trouble_shooting.md @@ -9,7 +9,7 @@ problems running or compiling Forest, use this checklist: 1. Make sure you are using an arm64 version of homebrew; this could be a problem one inherits when migrating from an Intel Mac to Apple Silicon: - [Stackoverflow example](https://stackoverflow.com/a/68443301). + [Stack Overflow example](https://stackoverflow.com/a/68443301). 2. Make sure your default host is set to `aarch64-apple-darwin` via `rustup set default-host aarch64-apple-darwin`. 3. This could result in various errors related to the fact that you still have From 52d678675d11c1062e4dfe32ea855f08fdf9a798 Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 19 Sep 2025 09:03:43 +0100 Subject: [PATCH 16/34] chore: fixing spellcheck & documentation exclusion --- .config/forest.dic | 448 +----- .github/workflows/docs-auto-update.yml | 8 +- .github/workflows/forest.yml | 4 +- CHANGELOG.md | 88 +- Makefile | 2 +- README.md | 12 +- build.rs | 2 +- build/bootstrap/butterflynet | 2 +- build/manifest.json | 2 +- docs/README.md | 4 +- docs/dictionary.txt | 8 +- .../developers/guides/network_upgrades.md | 4 +- docs/docs/users/getting_started/install.md | 2 +- docs/docs/users/guides/advanced/backups.md | 4 +- .../guides/advanced/generating_snapshots.md | 4 +- docs/docs/users/introduction.md | 2 +- docs/docs/users/knowledge_base/docker_tips.md | 2 +- .../docs/users/knowledge_base/jwt_handling.md | 2 +- .../users/knowledge_base/snapshot_service.md | 2 +- docs/docs/users/openrpc.json | 1368 +++++++++++++---- docs/docs/users/reference/cli.md | 70 +- docs/docs/users/reference/env_variables.md | 22 +- docs/docs/users/reference/generate_cli_md.sh | 2 +- .../docs/users/reference/json_rpc_overview.md | 4 +- docs/docs/users/reference/metrics.md | 112 +- .../developer_documentation/local_actions.md | 56 +- f3-sidecar/README.md | 18 +- f3-sidecar/api.go | 24 +- f3-sidecar/ec.go | 6 +- f3-sidecar/ffi_gen.go | 16 +- f3-sidecar/ffi_impl.go | 4 +- f3-sidecar/go.sum | 24 +- f3-sidecar/import.go | 6 +- f3-sidecar/main.go | 4 +- f3-sidecar/manifest.go | 14 +- f3-sidecar/p2p.go | 2 +- f3-sidecar/run.go | 10 +- f3-sidecar/utils.go | 2 +- interop-tests/src/tests/go_app/go.sum | 20 +- scripts/devnet-curio/.env | 4 +- scripts/devnet-curio/README.md | 2 +- scripts/devnet-curio/docker-compose.yml | 8 +- scripts/devnet-curio/run_curio.sh | 2 +- scripts/devnet/.env | 4 +- scripts/devnet/README.md | 2 +- scripts/devnet/check.sh | 4 +- scripts/devnet/docker-compose.yml | 8 +- scripts/tests/api_compare/docker-compose.yml | 2 +- scripts/tests/api_compare/filter-list | 2 +- scripts/tests/api_compare/filter-list-offline | 18 +- scripts/tests/calibnet_eth_mapping_check.sh | 2 +- scripts/tests/calibnet_export_check.sh | 6 +- scripts/tests/calibnet_export_f3_check.sh | 8 +- scripts/tests/calibnet_kademlia_check.sh | 4 +- scripts/tests/calibnet_no_discovery_check.sh | 14 +- scripts/tests/calibnet_other_check.sh | 34 +- .../tests/calibnet_stateless_mode_check.sh | 2 +- scripts/tests/harness.sh | 24 +- .../serialization-vectors/block_headers.json | 2 +- src/blocks/tipset.rs | 6 +- src/chain/mod.rs | 4 +- src/chain/snapshot_format.rs | 4 +- src/chain/store/chain_store.rs | 4 +- src/chain_sync/validation.rs | 2 +- src/cid_collections/mod.rs | 6 +- src/cid_collections/small_cid_vec.rs | 4 +- src/cli/main.rs | 2 +- src/cli/subcommands/chain_cmd.rs | 2 +- src/cli/subcommands/f3_cmd.rs | 152 +- src/cli/subcommands/f3_cmd/tests.rs | 8 +- src/cli/subcommands/mod.rs | 8 +- src/cli/subcommands/mpool_cmd.rs | 2 +- src/cli_shared/cli/client.rs | 2 +- src/cli_shared/cli/completion_cmd.rs | 2 +- src/cli_shared/cli/mod.rs | 4 +- src/cli_shared/snapshot.rs | 2 +- src/daemon/bundle.rs | 2 +- src/daemon/db_util.rs | 4 +- src/daemon/main.rs | 2 +- src/daemon/mod.rs | 12 +- src/db/car/forest.rs | 8 +- src/db/car/forest/index/mod.rs | 2 +- src/db/car/mod.rs | 2 +- src/db/car/plain.rs | 2 +- src/db/mod.rs | 2 +- src/documentation.rs | 2 +- src/f3/go_ffi.rs | 2 +- src/f3/mod.rs | 60 +- src/f3/snapshot.rs | 18 +- src/f3/snapshot/tests.rs | 6 +- src/health/endpoints.rs | 6 +- src/interpreter/fvm2.rs | 2 +- src/interpreter/fvm3.rs | 2 +- src/interpreter/fvm4.rs | 2 +- src/ipld/util.rs | 4 +- src/libp2p/discovery.rs | 4 +- src/message_pool/msgpool/selection.rs | 2 +- src/message_pool/msgpool/test_provider.rs | 2 +- src/networks/mod.rs | 2 +- src/rpc/filter_list.rs | 12 +- src/rpc/methods/chain.rs | 6 +- src/rpc/methods/f3.rs | 214 +-- src/rpc/methods/f3/types.rs | 128 +- src/rpc/methods/f3/util.rs | 22 +- src/rpc/methods/mpool.rs | 4 +- src/rpc/methods/state.rs | 10 +- src/rpc/mod.rs | 28 +- src/rpc/reflect/mod.rs | 4 +- src/rpc/registry/actors_reg.rs | 2 +- src/rpc/types/mod.rs | 2 +- src/shim/actors/builtin/miner/mod.rs | 2 +- src/shim/machine/manifest.rs | 2 +- src/shim/state_tree.rs | 2 +- src/tool/subcommands/api_cmd.rs | 2 +- .../subcommands/api_cmd/api_compare_tests.rs | 26 +- .../api_cmd/test_snapshots_ignored.txt | 44 +- src/tool/subcommands/archive_cmd.rs | 32 +- src/tool/subcommands/shed_cmd.rs | 2 +- src/utils/db/car_stream.rs | 2 +- src/utils/db/mod.rs | 6 +- src/utils/encoding/cid_de_cbor.rs | 6 +- .../encoding/fallback_de_ipld_dagcbor.rs | 6 +- src/utils/net.rs | 4 +- 123 files changed, 1920 insertions(+), 1550 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index e8537d04e2ed..3387270c42d6 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,531 +1,137 @@ -530 -Abell -abi -ActorID -ActorState -addr/S -algo +136 Algorand/M -allocator -Ameen -Ansermino -APIs -api -API-V1-compatible -approx_cmp +API/SM args -arity/S -arm64 +arity async -async-std -async_std -asyncverification -asynchronous_codec attoFIL -Ayush -B4 -backend/M -backfilling -backport -bajillion -Base-Devel -Base64 -base32 benchmark/GD -benchmarking -BigInt -BigUint bitfield -bitswap/M -bitvec +bitswap BLAKE2b -BlockHeader -blocksync blockchain/M blockstore/SM -bls -bls_signatures -blst -bootnodes -bootstrapper -Brickwood -BufferedBlockstore -bugfix -BuildKit +BLS butterflynet -C1 -calc -calibnet -calibnet-related calldata callee -camelCase -cancelation -cancelled +calibnet canonicalization CAR/SM -cardinality CARv1/SM CARv2/SM -cbor -cfg -ChainEpoch -ChainExchange -ChainNotify +CBOR ChainSafe/M -chainstore -chainsync -ChainSyncer -changelog -chrono -CIDs -cid -circ -CircleCI -CircSupply -cli -clippy +CID/SM clonable Cloudflare codebase codec -codecov -CodeID -codeowners -commcid -computing -config/S -Connor -cov -creativcoder cron -CronEvents crypto -cryptographic -ctrl -ctrl-c CurrentEpoch daemon daemonize -DAGJson -DagCBOR -Dagny -datacap -DB/S -de -DealProposal -Denethor/M -dep/S -deserialisation/M +Datacap deserialize/D -deserializing destructuring -dev_comments -devnet/S -Devops -Devs -DHT -Diátaxis -DigitalOcean +devnet +DevOps DNS -dockerfile/S -Docusaurus -drand -durations -dutter -ecrecover -eg EIP EIP155 -Elmattic -empty_params -env -enum/S +enum EOF -Etaoin/M eth -EthCallMessage Ethereum EVM exa -expirations -ExitCode -f3 -F3-sidecar +F3 f4 -F9 -F10 -F11 -F12 -F13 -F15 -F17 -F18 -F19 -F21 -F24 -F25 -F27 -F28 -fetch-params FFI -fil -fil-actor-interface -fil-actor-states -fil-proofs +FIL Filecoin/M -filecoin-project -filecoin-proofs-api/M -Filfox Filops -FilOz -filesystem -FIP/S -FIP-0085 -fmt -fn -Foldesi -forest-cli -ForestCAR -formatter -Fraccaroli -François -Friedel -FULLNODE_API_INFO -futures_cbor_codec -fuzzer +FIP FVM -Garillot GC -GetMarketState -gh -gh-pages -Gianmarco GiB -github -gitignore -Gossipsub -Grafana -GraphQL -GraphSync -Guillaume -Hakuna/M -hamt -hardcoded -hardlink/S +HAMT hasher healthcheck -homebrew -hotfix -http-client -i.e -i64 -IaC -Ijon/M -impl/S implementor/SM -indexmap -Init -InitActor -InternalServerError -interop/S -interopnet -invariants -io -ip +IP IPFS -ipld -Jaden -jemalloc +IPLD JSON -JSON-RPC -jwt -JWT/S -Kad +JWT Kademlia -keypair -KeyStore Kubernetes -lazycell -len -LesnyRumcajs -LetsEncrypt -libs libp2p -libsecp256k1 -linter/S -Linux liveness -localhost/M -lockfile -lookup/S -loopback -LRU -M1 -M2 -macOS +localhost +localhost's mainnet -Makefile -Markou -Matata -Matata/M -mdbook -mdns -MDX +MDNS mempool Merkle -messagepool -MessageInfo -MessageParams -messageReceipt -MethodNum -MethodParameter -MethodParams -mh MiB middleware -migrator/S milliGas -Mische -Mishra -MissingMethod -MockRuntime -Mojica -MPool -msg/S -Mullett multiaddr/SM -multiaddress/S -multibase multihash -multimap multisig -mut mutex -namespace -nata/M -Natanael -Neo4j -NetworkEvents -NetworkVersion -nextest -non-ascii -non-filecoin -nlprules -Nullable -NV15 -NV16 -NV17 -NV18 -NV19 -NV20 -NV21 -NV22 -NV23 -NV24 -NV25 -NV27 -NVXX -NVMe -OK -Olivero -onwards -OOM/S -Open OpenRPC -orchestrator -Organisation -os overallocation P2P -p2p -Parallelize -Parametrize param/SM +ParityDb ParityDB parsable -PathBuf -Paych -peerid -peerstores -perf performant -Pinecone -pointer/SM PoC +pointer/SM PoSt -Pre pre-commit -pre-compiled -pre-made -pre-migrations -preload -preloaded -PR/S -progressbar -prometheus -proofs-api -protobuf -protoc -pubsub -Q4 R2 -Raj -Rajarupan -reachability/M -README -ref-fvm -reflow -ReportConsensusFault -repo/S -ResponseManager -retag -Reth -Reth-like -rle RLP -RNG -Roadmap -RocksDB RPC -RPC-JSON/M -Rupan -Rusqlite -rust-toolchain -rustc -rustfmt -rustup -RUSTSEC-2020-0071 -RUSTSEC-2020-0159 -RUSTSEC-2021-0130 -RUSTSEC-2022-0009 -S3-compatible -Sampanthan -sccache -Schema/S -schemars/M -Schoe +schema/SM SECP -secp256k1 -secio +SECP256k1 seekable -semver -serde -serde_bytes -serde_cbor -serde_generic_array serializable serializer/SM -serverless -SetMultimap -sha256 -shellcheck -shrdlu -Sig -sighup -sigterm skippable -Songthaew -standardised -statediff/S +statediff stateful -StateManager -statetree -stateroot/S -statrs stderr stdout -Stmgr -StoragePower struct/SM -structops -styleguides -subcommand/S -submitwindowedpost/M -summarization -swappiness -symlinked synchronizer -SyncBucket -SyncManager -SyncStateMachine -Syncer syscall/S -TabItem -Taggart -TBD TCP -Teardown -Teep/M -Terraform testnet -Tichy -tide-websockets -tide-websockets-sink -TiB -TipIndex tipset/SM -tipsetconversions tipsetkey/S -ToCid -TokenAmount -tokio TOML -toolchain trie truthy TTY -Tuk -TukTuk -TxnIdParams -txn_id -ubuntu -UI -unbanned uncompress -unencrypted unrepresentable untrusted -unvested URL -utf8 -utils UUID -v0 -v1 -v2 -v3 -v4 -v5 -V7 -v6 -v9 -v10 -v11 -v12 -v14 validator/S varint -vec verifier verifreg -Vermeulen -virtualized VM/SM -Vm -Volker -VPS VRF -WIP wasm wasmtime -WatermelonFix/M -webapp WebSocket -ws WPoStProvingPeriodDeadlines -yaml -yml -YugabyteDB -Ziegelmayer zstd \ No newline at end of file diff --git a/.github/workflows/docs-auto-update.yml b/.github/workflows/docs-auto-update.yml index 7243fa1a58bd..16bba87f815f 100644 --- a/.github/workflows/docs-auto-update.yml +++ b/.github/workflows/docs-auto-update.yml @@ -1,4 +1,4 @@ -# This workflows, run daily, updates the Forest CLI usage docs, and submits a PR with the changes. +# This workflows, run daily, updates the Forest `CLI` usage docs, and submits a PR with the changes. name: Update Forest usage docs on: @@ -33,9 +33,9 @@ jobs: base: main branch: leshy/update-forest-docs token: ${{ steps.generate-token.outputs.token }} - commit-message: Update Forest CLI docs + commit-message: Update Forest `CLI` docs sign-commits: true - title: "[automated] Update Forest CLI docs" + title: "[automated] Update Forest `CLI` docs" body: | ### Changes - - Updates Forest CLI docs to the latest commit in the `main` branch. + - Updates Forest `CLI` docs to the latest commit in the `main` branch. diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index b311bad430c9..f7c452178119 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -113,7 +113,7 @@ jobs: forest-cli-check: needs: - build-ubuntu - name: Forest CLI checks + name: Forest `CLI` checks runs-on: ubuntu-24.04 steps: - run: lscpu @@ -287,7 +287,7 @@ jobs: calibnet-export-check-v2: needs: - build-ubuntu - name: Snapshot export checks v2 with F3 data + name: Snapshot export checks v2 with `F3` data runs-on: ubuntu-24.04 steps: - run: lscpu diff --git a/CHANGELOG.md b/CHANGELOG.md index 09edd06bed13..1a570fc24a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ ### Added -- [#6057](https://github.com/ChainSafe/forest/issues/6057) Added `--no-progress-timeout` to `forest-cli f3 ready` subcommand to exit when F3 is stuck for the given timeout. +- [#6057](https://github.com/ChainSafe/forest/issues/6057) Added `--no-progress-timeout` to `forest-cli f3 ready` subcommand to exit when `F3` is stuck for the given timeout. - [#6000](https://github.com/ChainSafe/forest/pull/6000) Add support for the `Filecoin.StateDecodeParams` API methods to enable decoding actors method params. ### Changed @@ -78,13 +78,13 @@ Non-mandatory release. It introduces a couple of features around snapshot genera - [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `--format` flag to the `forest-cli snapshot export` subcommand. This allows exporting a Filecoin snapshot in v2 format(FRC-0108). -- [#5956](https://github.com/ChainSafe/forest/pull/5956) Add `forest-tool archive f3-header` subcommand for inspecting the header of a standalone F3 snapshot(FRC-0108). +- [#5956](https://github.com/ChainSafe/forest/pull/5956) Add `forest-tool archive f3-header` subcommand for inspecting the header of a standalone `F3` snapshot(FRC-0108). - [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `forest-tool archive metadata` subcommand for inspecting snapshot metadata of a Filecoin snapshot in v2 format(FRC-0108). - [#5859](https://github.com/ChainSafe/forest/pull/5859) Added size metrics for zstd frame cache and made max size configurable via `FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE` environment variable. -- [#5963](https://github.com/ChainSafe/forest/pull/5963) Added `forest-cli f3 ready` command for checking whether F3 is in sync. +- [#5963](https://github.com/ChainSafe/forest/pull/5963) Added `forest-cli f3 ready` command for checking whether `F3` is in sync. - [#5867](https://github.com/ChainSafe/forest/pull/5867) Added `--unordered` to `forest-cli snapshot export` for exporting `CAR` blocks in non-deterministic order for better performance with more parallelization. @@ -92,7 +92,7 @@ Non-mandatory release. It introduces a couple of features around snapshot genera - [#5946](https://github.com/ChainSafe/forest/pull/5946) Added `--verbose` to `forest-cli state compute` for printing epochs and tipset keys along with state roots. -- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a v1 Filecoin snapshot and an F3 snapshot into a v2 Filecoin snapshot. +- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a v1 Filecoin snapshot and an `F3` snapshot into a v2 Filecoin snapshot. - [#4976](https://github.com/ChainSafe/forest/issues/4976) Add support for the `Filecoin.EthSubscribe` and `Filecoin.EthUnsubscribe` API methods to enable subscriptions to Ethereum event types: `heads` and `logs`. @@ -100,7 +100,7 @@ Non-mandatory release. It introduces a couple of features around snapshot genera ### Changed -- [#5886](https://github.com/ChainSafe/forest/issues/5886) Updated `forest-tool archive metadata` to print F3 snapshot header info when applicable. +- [#5886](https://github.com/ChainSafe/forest/issues/5886) Updated `forest-tool archive metadata` to print `F3` snapshot header info when applicable. - [#5869](https://github.com/ChainSafe/forest/pull/5869) Updated `forest-cli snapshot export` to print average speed. @@ -192,7 +192,7 @@ important bug fixes. It also contains a breaking change regarding the `detach` m ## Forest v0.26.1 "Ijon Tichy" -This is a non-mandatory release for all node operators. It includes a fix for the F3 on mainnet and a few other improvements. It also sets the initial power table CID for F3 on mainnet. +This is a non-mandatory release for all node operators. It includes a fix for the `F3` on mainnet and a few other improvements. It also sets the initial power table CID for `F3` on mainnet. ### Breaking @@ -210,7 +210,7 @@ This is a non-mandatory release for all node operators. It includes a fix for th ### Fixed -- [#5609](https://github.com/ChainSafe/forest/pull/5609) Fixed an issue with F3 on mainnet where the node would not join the KAD network. +- [#5609](https://github.com/ChainSafe/forest/pull/5609) Fixed an issue with `F3` on mainnet where the node would not join the KAD network. ## Forest v0.25.3 "Sméagol" @@ -367,7 +367,7 @@ Non-mandatory release without network upgrades. It includes a number of potentia ### Fixed -- [#5111](https://github.com/ChainSafe/forest/issues/5111) Make F3 work when the node Kademlia is disabled. +- [#5111](https://github.com/ChainSafe/forest/issues/5111) Make `F3` work when the node Kademlia is disabled. - [#5122](https://github.com/ChainSafe/forest/issues/5122) Fix a bug in database garbage collection flow. @@ -436,16 +436,16 @@ methods, fixes (notably to the garbage collection), and other improvements. ### Added - [#5010](https://github.com/ChainSafe/forest/pull/5010) Added - `forest-cli f3 certs list` CLI command. + `forest-cli f3 certs list` `CLI` command. - [#4995](https://github.com/ChainSafe/forest/pull/4995) Added - `forest-cli f3 powertable get` CLI command. + `forest-cli f3 powertable get` `CLI` command. - [#5028](https://github.com/ChainSafe/forest/pull/5028) Added - `forest-cli f3 powertable get-proportion` CLI command. + `forest-cli f3 powertable get-proportion` `CLI` command. - [#5054](https://github.com/ChainSafe/forest/pull/5054) Added `--dump-dir` - option to `forest-tool api compare` CLI command. + option to `forest-tool api compare` `CLI` command. - [#4704](https://github.com/ChainSafe/forest/issues/4704) Add support for the `Filecoin.EthGetTransactionReceiptLimited` RPC method. @@ -479,7 +479,7 @@ methods, fixes (notably to the garbage collection), and other improvements. Mandatory release for mainnet node operators. It sets the upgrade epoch for the NV24 _Tuk Tuk_ upgrade to `4_461_240` which corresponds to -`Wed 20 Nov 23:00:00 UTC 2024`. No F3 support is planned for the NV24, see +`Wed 20 Nov 23:00:00 UTC 2024`. No `F3` support is planned for the NV24, see [this post](https://github.com/filecoin-project/core-devs/discussions/150#discussioncomment-11164504) for more details. @@ -493,13 +493,13 @@ for more details. ### Added - [#4937](https://github.com/ChainSafe/forest/pull/4937) Added - `forest-cli f3 manifest` CLI command. + `forest-cli f3 manifest` `CLI` command. - [#4949](https://github.com/ChainSafe/forest/pull/4949) Added - `forest-cli f3 status` CLI command. + `forest-cli f3 status` `CLI` command. - [#4949](https://github.com/ChainSafe/forest/pull/4949) Added - `forest-cli f3 certs get` CLI command. + `forest-cli f3 certs get` `CLI` command. - [#4706](https://github.com/ChainSafe/forest/issues/4706) Add support for the `Filecoin.EthSendRawTransaction` RPC method. @@ -520,20 +520,20 @@ for more details. ## Forest 0.21.1 "Songthaew Plus" This is an optional release for calibration network node operators. It enables -F3 by default and includes initial power table CID on calibration network. +`F3` by default and includes initial power table CID on calibration network. ### Breaking ### Added - [#4910](https://github.com/ChainSafe/forest/issues/4910) Add support for the - `Filecoin.F3ListParticipants` RPC method. + `Filecoin.`F3`ListParticipants` RPC method. - [#4920](https://github.com/ChainSafe/forest/issues/4920) Add support for the - `Filecoin.F3GetOrRenewParticipationTicket` RPC method. + `Filecoin.`F3`GetOrRenewParticipationTicket` RPC method. - [#4924](https://github.com/ChainSafe/forest/issues/4924) Add support for the - `Filecoin.F3GetManifest` RPC method. + `Filecoin.`F3`GetManifest` RPC method. - [#4917](https://github.com/ChainSafe/forest/issues/4917) Support `dnsaddr` in the bootstrap list. @@ -544,10 +544,10 @@ F3 by default and includes initial power table CID on calibration network. ### Changed - [#4920](https://github.com/ChainSafe/forest/issues/4920) Update - `Filecoin.F3Participate` RPC method to align with the spec change. + `Filecoin.`F3`Participate` RPC method to align with the spec change. - [#4920](https://github.com/ChainSafe/forest/issues/4920) Update - `Filecoin.F3ListParticipants` RPC method to align with the spec change. + `Filecoin.`F3`ListParticipants` RPC method to align with the spec change. ### Removed @@ -560,7 +560,7 @@ F3 by default and includes initial power table CID on calibration network. This is a mandatory release for calibration network node operators. It includes state migration for the NV24 _TukTuk_ upgrade at epoch `2078794` -2024-10-23T13:30:00Z. It also includes a number of new RPC methods, fixes and F3 +2024-10-23T13:30:00Z. It also includes a number of new RPC methods, fixes and `F3` support. ### Breaking @@ -577,10 +577,10 @@ support. `Filecoin.NetProtectList` RPC method. - [#4865](https://github.com/ChainSafe/forest/issues/4865) Add support for the - `Filecoin.F3IsRunning` RPC method. + `Filecoin.`F3`IsRunning` RPC method. - [#4878](https://github.com/ChainSafe/forest/issues/4878) Add support for the - `Filecoin.F3GetProgress` RPC method. + `Filecoin.`F3`GetProgress` RPC method. - [#4857](https://github.com/ChainSafe/forest/pull/4857) Add support for nv24 (TukTuk). @@ -1550,9 +1550,9 @@ Notable updates: Notable updates: -- `--compressed` option removed from CLI, snapshots are now always compressed. +- `--compressed` option removed from `CLI`, snapshots are now always compressed. - The `dir`, `list`, `prune` and `remove` snapshot commands have been removed - from the CLI. + from the `CLI`. - Snapshots are fetched to current directory by default. - Added new subcommand `forest-cli info show`. - `Filecoin.ChainSetHead` RPC endpoint and `forest-cli chain set-head` @@ -1566,7 +1566,7 @@ Notable updates: ### Breaking - [#2873](https://github.com/ChainSafe/forest/issues/2873) - - remove `--compressed` from the CLI. Snapshots are now always compressed. + - remove `--compressed` from the `CLI`. Snapshots are now always compressed. - Remove snapshot ops - snapshots fetched to the current directory by default. ### Added @@ -1624,7 +1624,7 @@ Notable updates: - [#2796](https://github.com/ChainSafe/forest/pull/2796): Fix issue when running Forest on calibnet using a configuration file only. - [#2807](https://github.com/ChainSafe/forest/pull/2807): Fix issue with v11 - actor CIDs. + actor `CIDs`. - [#2804](https://github.com/ChainSafe/forest/pull/2804): Add work around for FVM bug that caused `forest-cli sync wait` to fail. @@ -1730,9 +1730,9 @@ Notable updates: [#2576](https://github.com/ChainSafe/forest/issues/2576) - Revised how balances are displayed, defaulting to: [#2323](https://github.com/ChainSafe/forest/issues/2323) - - adding metric prefix when it's required, consequently CLI flag + - adding metric prefix when it's required, consequently `CLI` flag `--fixed-unit` added to force to show in original `FIL` unit - - 4 significant digits, consequently CLI flag `--exact-balance` added to force + - 4 significant digits, consequently `CLI` flag `--exact-balance` added to force full accuracy. - `stats` and `compression` keys in `parity_db` section were renamed to `enable_statistics` and `compression_type` respectively. @@ -1759,7 +1759,7 @@ Notable updates: ### Removed - Removed `--halt-after-import` and `--auto-download-snapshot` from - configuration. They are now strictly a CLI option. + configuration. They are now strictly a `CLI` option. [#2528](https://github.com/ChainSafe/forest/issues/2528) [#2573](https://github.com/ChainSafe/forest/issues/2573) @@ -1914,7 +1914,7 @@ Notable updates: - Resolve two security concerns by removing legacy code (RUSTSEC-2020-0071 and RUSTSEC-2021-0130). - Fixed Docker image and released it to GH container registry. -- Network selection (i.e. mainnet vs testnet) moved to a CLI flag rather than a +- Network selection (i.e. mainnet vs testnet) moved to a `CLI` flag rather than a compile-time flag. ## Forest v0.2.2 _alpha_ (2022-04-06) @@ -2166,7 +2166,7 @@ All changes: ([#1295](https://github.com/ChainSafe/forest/pull/1295)) - Remove redundant validation code and update error message to be same as in spec actors ([#1294](https://github.com/ChainSafe/forest/pull/1294)) -- F3: fix logic to be the same as in the spec actors +- `F3`: fix logic to be the same as in the spec actors ([#1292](https://github.com/ChainSafe/forest/pull/1292)) - Attempt to improve gh actions time ([#1319](https://github.com/ChainSafe/forest/pull/1319)) @@ -2197,7 +2197,7 @@ implementation. - It implements all core systems of the Filecoin protocol specification exposed through a command-line interface. - The set of functionalities for this first alpha-release include: Message Pool, - State Manager, Chain and Wallet CLI functionality, Prometheus Metrics, and a + State Manager, Chain and Wallet `CLI` functionality, Prometheus Metrics, and a JSON-RPC Server. To compile release binaries, checkout the `v0.1.0` tag and build with the @@ -2228,7 +2228,7 @@ All initial change sets: ([#1245](https://github.com/ChainSafe/forest/pull/1245)) (Afr Schoe) - `d7e816a7` Update Libp2p to 0.40.0-RC.1 ([#1243](https://github.com/ChainSafe/forest/pull/1243)) (Eric Tu) -- `a33328c9` Mpool CLI Commands +- `a33328c9` Mpool `CLI` Commands ([#1203](https://github.com/ChainSafe/forest/pull/1203)) (Connor Mullett) - `9d4b5291` Create new_issue.md ([#1193](https://github.com/ChainSafe/forest/pull/1193)) (Lee Raj) @@ -2286,9 +2286,9 @@ All initial change sets: ([#1190](https://github.com/ChainSafe/forest/pull/1190)) (Eric Tu) - `d88ea8d1` Added the check for config file via Env Var ([#1197](https://github.com/ChainSafe/forest/pull/1197)) (Elvis) -- `d4a1d044` Chain Sync CLI Commands +- `d4a1d044` Chain Sync `CLI` Commands ([#1175](https://github.com/ChainSafe/forest/pull/1175)) (Connor Mullett) -- `698cf3c3` Additional Net RPC API & CLI Methods +- `698cf3c3` Additional Net RPC API & `CLI` Methods ([#1167](https://github.com/ChainSafe/forest/pull/1167)) (Hunter Trujillo) - `32656db9` `auth api-info` ([#1172](https://github.com/ChainSafe/forest/pull/1172)) (Connor Mullett) @@ -2314,7 +2314,7 @@ All initial change sets: ([#1162](https://github.com/ChainSafe/forest/pull/1162)) (detailyang) - `992e69e3` FOR-15 fix approx_cmp in msg_chain.rs ([#1160](https://github.com/ChainSafe/forest/pull/1160)) (creativcoder) -- `34799734` Wallet CLI Implementation +- `34799734` Wallet `CLI` Implementation ([#1128](https://github.com/ChainSafe/forest/pull/1128)) (Connor Mullett) - `f698ba88` [Audit fixes] FOR-02: Inconsistent Deserialization of Address ID ([#1149](https://github.com/ChainSafe/forest/pull/1149)) (Hunter Trujillo) @@ -2340,7 +2340,7 @@ All initial change sets: ([#1122](https://github.com/ChainSafe/forest/pull/1122)) (Hunter Trujillo) - `81080179` Import/Export StateTree for Testing ([#1114](https://github.com/ChainSafe/forest/pull/1114)) (Eric Tu) -- `b75a4f31` Improve CLI printing and RPC error handling. +- `b75a4f31` Improve `CLI` printing and RPC error handling. ([#1121](https://github.com/ChainSafe/forest/pull/1121)) (Hunter Trujillo) - `a8931e2a` Enable Gossip Scoring ([#1115](https://github.com/ChainSafe/forest/pull/1115)) (Eric Tu) @@ -2870,7 +2870,7 @@ All initial change sets: ([#697](https://github.com/ChainSafe/forest/pull/697)) (nannick) - `548a4645` Print out conformance results and add log for skips ([#695](https://github.com/ChainSafe/forest/pull/695)) (Austin Abell) -- `0d7b16cc` Add CLI command to add Genesis Miner to Genesis Template +- `0d7b16cc` Add `CLI` command to add Genesis Miner to Genesis Template ([#644](https://github.com/ChainSafe/forest/pull/644)) (Stepan) - `0be6b76a` Chain syncing verification fixes ([#503](https://github.com/ChainSafe/forest/pull/503)) (Eric Tu) @@ -2994,7 +2994,7 @@ All initial change sets: ([#591](https://github.com/ChainSafe/forest/pull/591)) (Eric Tu) - `4783a670` Update cron actor ([#588](https://github.com/ChainSafe/forest/pull/588)) (Austin Abell) -- `c642d9a9` JSON client setup and chain CLI commands +- `c642d9a9` JSON client setup and chain `CLI` commands ([#572](https://github.com/ChainSafe/forest/pull/572)) (Dustin Brickwood) - `f80cfab7` Update account actor and params defaults/checks ([#587](https://github.com/ChainSafe/forest/pull/587)) (Austin Abell) @@ -3050,7 +3050,7 @@ All initial change sets: ([#526](https://github.com/ChainSafe/forest/pull/526)) (Austin Abell) - `a2cab731` Implementing Market Balance ([#524](https://github.com/ChainSafe/forest/pull/524)) (nannick) -- `7143e42b` Refactor CLI and implement fetch-params +- `7143e42b` Refactor `CLI` and implement fetch-params ([#516](https://github.com/ChainSafe/forest/pull/516)) (Austin Abell) - `95a2fcc1` Update proofs-api to 4.0.1 ([#523](https://github.com/ChainSafe/forest/pull/523)) (Austin Abell) @@ -3512,7 +3512,7 @@ All initial change sets: ([#69](https://github.com/ChainSafe/forest/pull/69)) (Dustin Brickwood) - `054f25d4` InitActor framework ([#76](https://github.com/ChainSafe/forest/pull/76)) (Austin Abell) -- `d75c8f2e` CLI cleanup ([#70](https://github.com/ChainSafe/forest/pull/70)) +- `d75c8f2e` `CLI` cleanup ([#70](https://github.com/ChainSafe/forest/pull/70)) (Gregory Markou) - `bbea6130` Add config file parsing ([#60](https://github.com/ChainSafe/forest/pull/60)) (Gregory Markou) diff --git a/Makefile b/Makefile index 3cfd8ce2a2e8..ea9eff31584c 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ deny: spellcheck: cargo spellcheck --code 1 || (echo "See .config/spellcheck.md for tips"; false) - cargo spellcheck --code 1 --cfg .config/spellcheck.toml ./**/*.md || (echo "See .config/spellcheck.md for tips"; false) + find . \( -path "./documentation" -o -path "./node_modules" -o -path "./.git" -o -path "./target" \) -prune -o -name "*.md" -type f -print0 | xargs -0 -r cargo spellcheck --code 1 --cfg .config/spellcheck.toml || (echo "See .config/spellcheck.md for tips"; false) lint: license clean lint-clippy cargo fmt --all --check diff --git a/README.md b/README.md index 5695390b13cc..65a3ac0c56c9 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Docker - works on Linux, macOS and Windows. ❯ docker run --init -it --rm --entrypoint forest-cli ghcr.io/chainsafe/forest:latest --help ``` -Next, run a Forest node in a CLI window. E.g. +Next, run a Forest node in a `CLI` window. E.g. [Run calibration network](https://docs.forest.chainsafe.io/getting_started/syncing/#calibnet) Thereafter, in another terminal, you will be able to use the `forest-cli` binary @@ -57,7 +57,7 @@ tag. ## Dependencies - Rust (toolchain version is specified in `rust-toolchain.toml`) -- Go for building F3 sidecar module. (toolchain version is specified in +- Go for building `F3` sidecar module. (toolchain version is specified in `go.work`) Install [rustup](https://rustup.rs/) @@ -235,16 +235,16 @@ without any prompts. ./target/release/forest --chain calibnet --auto-download-snapshot ``` -### Interacting with Forest via CLI +### Interacting with Forest via `CLI` When the Forest daemon is started, an admin token will be displayed and saved to data directory by default. (alternatively, use `--save-token ` flag to save it on disk). You will need this for commands that require a higher level of authorization (like a password). Forest, as mentioned above, uses multiaddresses for networking. This -is no different in the CLI. To set the host and the port to use, if not using +is no different in the `CLI`. To set the host and the port to use, if not using the default port or using a remote host, set the `FULLNODE_API_INFO` environment variable. This is also where you can set a token for authentication. Note that the token is -automatically set for CLI if it is invoked on the same host of the daemon. +automatically set for `CLI` if it is invoked on the same host of the daemon. ``` FULLNODE_API_INFO=":/ip4//tcp//http @@ -253,7 +253,7 @@ FULLNODE_API_INFO=":/ip4//tcp//http Note that if a token is not present in the FULLNODE_API_INFO env variable, the colon is removed. -Forest developers will prepend this variable to CLI commands over using `export` +Forest developers will prepend this variable to `CLI` commands over using `export` on Linux or its equivalent on Windows. This will look like the following: ``` diff --git a/build.rs b/build.rs index f467e5f161d2..706d85115b23 100644 --- a/build.rs +++ b/build.rs @@ -14,7 +14,7 @@ fn main() { // Do not build f3-sidecar on docs.rs publishing // No proper version of Go compiler is available. - if !is_docs_rs() && !is_env_truthy("FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT") { + if !is_docs_rs() && !is_env_truthy("FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT") { println!("cargo:rustc-cfg=f3sidecar"); println!("cargo::rerun-if-changed=f3-sidecar"); unsafe { diff --git a/build/bootstrap/butterflynet b/build/bootstrap/butterflynet index 879c118f8e16..85316ed3a3f8 100644 --- a/build/bootstrap/butterflynet +++ b/build/bootstrap/butterflynet @@ -1,2 +1,2 @@ -/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKxHctsqQ41MZ64GYqz5r4DUF3Hkj9SMVEcHXdRqvWCAx +/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKxHctsqQ41MZ64GYqz5r4DU`F3`Hkj9SMVEcHXdRqvWCAx /dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWN69aMyMuf9VrsRir5gd3xkT5q5p9NGYLFSXBTn1xkVSN diff --git a/build/manifest.json b/build/manifest.json index 1f6591335155..15f7888b8db0 100644 --- a/build/manifest.json +++ b/build/manifest.json @@ -3051,4 +3051,4 @@ "actor_list_cid": "bafy2bzaceavbltrvpskmmc4lmy3ur7ymigxqtnesdx3lld576puv63uolufks" } } -] +] \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index bd5e963c1fb8..6e8b601d83b2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,9 +56,9 @@ Available at the root (`/`), default location for anyone visiting the documentat Follows the [Diátaxis](https://diataxis.fr/) framework for structuring documentation. The site is divided into four types of documentation: tutorials (Getting Started), how-to guides (Guides), explanations (Knowledge Base) and reference (Reference). -#### CLI Docs +#### `CLI` Docs -These docs are automatically generated from the Forest CLI. See [script](/docs/docs/users/reference/cli.sh). +These docs are automatically generated from the Forest `CLI`. See [script](/docs/docs/users/reference/cli.sh). #### JSON-RPC Docs diff --git a/docs/dictionary.txt b/docs/dictionary.txt index af92c614eaed..93cdc44b90a4 100644 --- a/docs/dictionary.txt +++ b/docs/dictionary.txt @@ -1,5 +1,5 @@ 2k -APIs +`APIs` backend benchmarking blockstore @@ -13,8 +13,8 @@ ChainSafe chainsafe ChainSafe's changelog -CIDs -CLI +`CIDs` +`CLI` cli Cloudflare codebase @@ -29,7 +29,7 @@ DigitalOcean Drand enums Ethereum -F3 +`F3` f3 f3-sidecar FFI diff --git a/docs/docs/developers/guides/network_upgrades.md b/docs/docs/developers/guides/network_upgrades.md index 1d042744f443..021be7ea2f0c 100644 --- a/docs/docs/developers/guides/network_upgrades.md +++ b/docs/docs/developers/guides/network_upgrades.md @@ -55,7 +55,7 @@ Both Forest and the `builtin-actors` repository depend on the FVM. The FVM is up #### `fil-actor-states` update and release -The `fil-actor-states` repository is updated to the latest bundle release. The changes are then released, and the Forest repository is updated to include the new release. Necessary CIDs are updated. The bundle release and the version to be used are coordinated across the Filecoin implementations. +The `fil-actor-states` repository is updated to the latest bundle release. The changes are then released, and the Forest repository is updated to include the new release. Necessary `CIDs` are updated. The bundle release and the version to be used are coordinated across the Filecoin implementations. #### Network-aware node changes @@ -89,7 +89,7 @@ The steps required to update the Builtin Actors in Forest are as follows: 2. Ensure that the changes are compatible with Forest. If not, prepare a PR ahead of time to address breaking changes. 3. Cut a new release of the `fil-actor-states`. 4. Update the `fil-actor-states` dependency in Forest. -5. Update the CIDs in the [bundle module](https://github.com/ChainSafe/forest/blob/main/src/networks/actors_bundle.rs) to include bundles for any networks that you want to support. +5. Update the `CIDs` in the [bundle module](https://github.com/ChainSafe/forest/blob/main/src/networks/actors_bundle.rs) to include bundles for any networks that you want to support. 6. Update the manifest with `forest-tool state-migration generate-actors-metadata > build/manifest.json`. This will add necessary entries to the manifest. Note that if there were no Rust interface changes, e.g., a re-tag, steps 1-4 can be skipped. diff --git a/docs/docs/users/getting_started/install.md b/docs/docs/users/getting_started/install.md index 09ac1184fae3..da5b3b9235bc 100644 --- a/docs/docs/users/getting_started/install.md +++ b/docs/docs/users/getting_started/install.md @@ -77,7 +77,7 @@ More information about Docker setup and usage can be found in the [Docker docume - Rust compiler (install via [rustup](https://rustup.rs/)) - OS `Base-Devel`/`Build-Essential` - Clang compiler -- Go for building F3 sidecar module +- Go for building `F3` sidecar module For Ubuntu, you can install the dependencies (excluding Rust) with: diff --git a/docs/docs/users/guides/advanced/backups.md b/docs/docs/users/guides/advanced/backups.md index f7b52bc566f8..86cbfe276e09 100644 --- a/docs/docs/users/guides/advanced/backups.md +++ b/docs/docs/users/guides/advanced/backups.md @@ -57,6 +57,6 @@ up the entire Forest data directory. Note that this includes the whole blockstore, which, for mainnet, can reach hundreds of gigabytes. It is not recommended outside development. -### CLI reference +### `CLI` reference -Details on the `forest-tool backup` command and its subcommands can be found at the [CLI reference](../../reference/cli.md#forest-tool-backup). +Details on the `forest-tool backup` command and its subcommands can be found at the [`CLI` reference](../../reference/cli.md#forest-tool-backup). diff --git a/docs/docs/users/guides/advanced/generating_snapshots.md b/docs/docs/users/guides/advanced/generating_snapshots.md index 931f63fc335f..bc6c4673718d 100644 --- a/docs/docs/users/guides/advanced/generating_snapshots.md +++ b/docs/docs/users/guides/advanced/generating_snapshots.md @@ -36,6 +36,6 @@ compressed. For mainnet, you should expect a file of over 70 GB. For calibnet, you should expect a file of over 5 GB. Note that the snapshot size grows over time. -### CLI reference +### `CLI` reference -Details on the `forest-cli snapshot export` command and its subcommands can be found at the [CLI reference](../../reference/cli.md#forest-cli-snapshot). +Details on the `forest-cli snapshot export` command and its subcommands can be found at the [`CLI` reference](../../reference/cli.md#forest-cli-snapshot). diff --git a/docs/docs/users/introduction.md b/docs/docs/users/introduction.md index a4f610ffc04b..f42b3e1bb5be 100644 --- a/docs/docs/users/introduction.md +++ b/docs/docs/users/introduction.md @@ -40,7 +40,7 @@ Forest consists of multiple binaries: - `forest-tool` - Utilities for maintaining and debugging Forest - `forest-wallet` - Manage the built-in wallet -Check out the [CLI docs](./reference/cli.md) for more details. +Check out the [`CLI` docs](./reference/cli.md) for more details. ## Roadmap Updates diff --git a/docs/docs/users/knowledge_base/docker_tips.md b/docs/docs/users/knowledge_base/docker_tips.md index 1d61ecd94152..125c6ba4e2b9 100644 --- a/docs/docs/users/knowledge_base/docker_tips.md +++ b/docs/docs/users/knowledge_base/docker_tips.md @@ -70,7 +70,7 @@ docker run --init -it --rm --entrypoint forest-tool ghcr.io/chainsafe/forest:lat docker run --init -it --rm --entrypoint forest-wallet ghcr.io/chainsafe/forest:latest --help ``` -Also see the [CLI documentation](../reference/cli.md) for more details about commands and +Also see the [`CLI` documentation](../reference/cli.md) for more details about commands and their usage. ### Run a Forest node with custom environment variables diff --git a/docs/docs/users/knowledge_base/jwt_handling.md b/docs/docs/users/knowledge_base/jwt_handling.md index 628656d6db86..3a51637303df 100644 --- a/docs/docs/users/knowledge_base/jwt_handling.md +++ b/docs/docs/users/knowledge_base/jwt_handling.md @@ -63,7 +63,7 @@ The admin token is assumed to be stored in `/tmp/token` for the following exampl ### via `forest-cli` -The most straightforward way to use tokens is to pass them to the `forest-cli` tool. This can be done either by passing it via the `--token` flag or by setting the `FULLNODE_API_INFO` environment variable. Note that the token is automatically set for CLI if it is invoked on the same host of the daemon. +The most straightforward way to use tokens is to pass them to the `forest-cli` tool. This can be done either by passing it via the `--token` flag or by setting the `FULLNODE_API_INFO` environment variable. Note that the token is automatically set for `CLI` if it is invoked on the same host of the daemon. ```bash forest-cli --token $(cat /tmp/token) shutdown diff --git a/docs/docs/users/knowledge_base/snapshot_service.md b/docs/docs/users/knowledge_base/snapshot_service.md index 447f2db70a0b..1dc0459cb055 100644 --- a/docs/docs/users/knowledge_base/snapshot_service.md +++ b/docs/docs/users/knowledge_base/snapshot_service.md @@ -36,7 +36,7 @@ Forest produces snapshots compatible with Lotus, with much faster generation tim This benchmark was performed on a bare metal server with the following specifications: -- `AMD EPYC 7F32 8-Core Processor` +- `AMD EPYC 7`F3`2 8-Core Processor` - `512 GiB RAM` - `4 TiB NVMe SSD` diff --git a/docs/docs/users/openrpc.json b/docs/docs/users/openrpc.json index 078328d8d62a..371c64fe1f9b 100644 --- a/docs/docs/users/openrpc.json +++ b/docs/docs/users/openrpc.json @@ -6,18 +6,18 @@ }, "methods": [ { - "name": "F3.Finalize", + "name": "`F3`.Finalize", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSetKey" + "$ref": "#/components/schemas/`F3`TipSetKey" } } ], "result": { - "name": "F3.Finalize.Result", + "name": "`F3`.Finalize.Result", "required": true, "schema": { "type": "null" @@ -26,45 +26,48 @@ "paramStructure": "by-position" }, { - "name": "F3.GetHead", + "name": "`F3`.GetHead", "params": [], "result": { - "name": "F3.GetHead.Result", + "name": "`F3`.GetHead.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSet" + "$ref": "#/components/schemas/`F3`TipSet" } }, "paramStructure": "by-position" }, { - "name": "F3.GetParent", + "name": "`F3`.GetParent", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSetKey" + "$ref": "#/components/schemas/`F3`TipSetKey" } } ], "result": { - "name": "F3.GetParent.Result", + "name": "`F3`.GetParent.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSet" + "$ref": "#/components/schemas/`F3`TipSet" } }, "paramStructure": "by-position" }, { - "name": "F3.GetParticipatingMinerIDs", + "name": "`F3`.GetParticipatingMinerIDs", "params": [], "result": { - "name": "F3.GetParticipatingMinerIDs.Result", + "name": "`F3`.GetParticipatingMinerIDs.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "integer", "format": "uint64", @@ -75,33 +78,36 @@ "paramStructure": "by-position" }, { - "name": "F3.GetPowerTable", + "name": "`F3`.GetPowerTable", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSetKey" + "$ref": "#/components/schemas/`F3`TipSetKey" } } ], "result": { - "name": "F3.GetPowerTable.Result", + "name": "`F3`.GetPowerTable.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { - "$ref": "#/components/schemas/F3PowerEntry" + "$ref": "#/components/schemas/`F3`PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "F3.GetRawNetworkName", + "name": "`F3`.GetRawNetworkName", "params": [], "result": { - "name": "F3.GetRawNetworkName.Result", + "name": "`F3`.GetRawNetworkName.Result", "required": true, "schema": { "type": "string" @@ -110,27 +116,27 @@ "paramStructure": "by-position" }, { - "name": "F3.GetTipset", + "name": "`F3`.GetTipset", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSetKey" + "$ref": "#/components/schemas/`F3`TipSetKey" } } ], "result": { - "name": "F3.GetTipset.Result", + "name": "`F3`.GetTipset.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSet" + "$ref": "#/components/schemas/`F3`TipSet" } }, "paramStructure": "by-position" }, { - "name": "F3.GetTipsetByEpoch", + "name": "`F3`.GetTipsetByEpoch", "params": [ { "name": "epoch", @@ -142,16 +148,16 @@ } ], "result": { - "name": "F3.GetTipsetByEpoch.Result", + "name": "`F3`.GetTipsetByEpoch.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3TipSet" + "$ref": "#/components/schemas/`F3`TipSet" } }, "paramStructure": "by-position" }, { - "name": "F3.ProtectPeer", + "name": "`F3`.ProtectPeer", "params": [ { "name": "peer_id", @@ -162,7 +168,7 @@ } ], "result": { - "name": "F3.ProtectPeer.Result", + "name": "`F3`.ProtectPeer.Result", "required": true, "schema": { "type": "boolean" @@ -171,7 +177,7 @@ "paramStructure": "by-position" }, { - "name": "F3.SignMessage", + "name": "`F3`.SignMessage", "params": [ { "name": "pubkey", @@ -189,7 +195,7 @@ } ], "result": { - "name": "F3.SignMessage.Result", + "name": "`F3`.SignMessage.Result", "required": true, "schema": { "$ref": "#/components/schemas/Signature" @@ -204,7 +210,10 @@ "name": "permissions", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -214,7 +223,10 @@ "name": "expiration_secs", "required": true, "schema": { - "type": ["integer", "null"], + "type": [ + "integer", + "null" + ], "format": "int64" } } @@ -243,7 +255,10 @@ "name": "Filecoin.AuthVerify.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -266,7 +281,10 @@ "name": "Filecoin.ChainExport.Result", "required": false, "schema": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] } }, "paramStructure": "by-position" @@ -329,7 +347,10 @@ "name": "Filecoin.ChainGetEvents.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Event" } @@ -384,7 +405,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -395,7 +419,10 @@ "name": "Filecoin.ChainGetMessagesInTipset.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ApiMessage" } @@ -419,7 +446,10 @@ "name": "Filecoin.ChainGetParentMessages.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ApiMessage" } @@ -443,7 +473,10 @@ "name": "Filecoin.ChainGetParentReceipts.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ApiReceipt" } @@ -474,7 +507,10 @@ "name": "Filecoin.ChainGetPath.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/PathChange" } @@ -490,7 +526,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -522,7 +561,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -554,7 +596,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -687,7 +732,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -710,7 +758,10 @@ "name": "Filecoin.EthAccounts.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -844,7 +895,10 @@ "name": "rewardPercentiles", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "number", "format": "double" @@ -970,7 +1024,10 @@ "name": "Filecoin.EthGetBlockReceipts.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1001,7 +1058,10 @@ "name": "Filecoin.EthGetBlockReceiptsLimited.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1545,7 +1605,10 @@ "name": "Filecoin.EthTraceBlock.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1569,7 +1632,10 @@ "name": "Filecoin.EthTraceFilter.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1591,7 +1657,10 @@ "name": "traceTypes", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -1602,7 +1671,10 @@ "name": "Filecoin.EthTraceReplayBlockTransactions.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -1626,7 +1698,10 @@ "name": "Filecoin.EthTraceTransaction.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1655,7 +1730,7 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetCertificate", + "name": "Filecoin.`F3`GetCertificate", "params": [ { "name": "instance", @@ -1668,7 +1743,7 @@ } ], "result": { - "name": "Filecoin.F3GetCertificate.Result", + "name": "Filecoin.`F3`GetCertificate.Result", "required": true, "schema": { "$ref": "#/components/schemas/FinalityCertificate" @@ -1677,13 +1752,16 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetECPowerTable", + "name": "Filecoin.`F3`GetECPowerTable", "params": [ { "name": "tipset_key", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -1691,25 +1769,31 @@ } ], "result": { - "name": "Filecoin.F3GetECPowerTable.Result", + "name": "Filecoin.`F3`GetECPowerTable.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { - "$ref": "#/components/schemas/F3PowerEntry" + "$ref": "#/components/schemas/`F3`PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetF3PowerTable", + "name": "Filecoin.`F3`Get`F3`PowerTable", "params": [ { "name": "tipset_key", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -1717,22 +1801,25 @@ } ], "result": { - "name": "Filecoin.F3GetF3PowerTable.Result", + "name": "Filecoin.`F3`Get`F3`PowerTable.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { - "$ref": "#/components/schemas/F3PowerEntry" + "$ref": "#/components/schemas/`F3`PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetLatestCertificate", + "name": "Filecoin.`F3`GetLatestCertificate", "params": [], "result": { - "name": "Filecoin.F3GetLatestCertificate.Result", + "name": "Filecoin.`F3`GetLatestCertificate.Result", "required": true, "schema": { "$ref": "#/components/schemas/FinalityCertificate" @@ -1741,19 +1828,19 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetManifest", + "name": "Filecoin.`F3`GetManifest", "params": [], "result": { - "name": "Filecoin.F3GetManifest.Result", + "name": "Filecoin.`F3`GetManifest.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3Manifest" + "$ref": "#/components/schemas/`F3`Manifest" } }, "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetOrRenewParticipationTicket", + "name": "Filecoin.`F3`GetOrRenewParticipationTicket", "params": [ { "name": "miner_address", @@ -1780,7 +1867,7 @@ } ], "result": { - "name": "Filecoin.F3GetOrRenewParticipationTicket.Result", + "name": "Filecoin.`F3`GetOrRenewParticipationTicket.Result", "required": true, "schema": { "$ref": "#/components/schemas/Base64String" @@ -1789,22 +1876,22 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.F3GetProgress", + "name": "Filecoin.`F3`GetProgress", "params": [], "result": { - "name": "Filecoin.F3GetProgress.Result", + "name": "Filecoin.`F3`GetProgress.Result", "required": true, "schema": { - "$ref": "#/components/schemas/F3InstanceProgress" + "$ref": "#/components/schemas/`F3`InstanceProgress" } }, "paramStructure": "by-position" }, { - "name": "Filecoin.F3IsRunning", + "name": "Filecoin.`F3`IsRunning", "params": [], "result": { - "name": "Filecoin.F3IsRunning.Result", + "name": "Filecoin.`F3`IsRunning.Result", "required": true, "schema": { "type": "boolean" @@ -1813,22 +1900,25 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.F3ListParticipants", + "name": "Filecoin.`F3`ListParticipants", "params": [], "result": { - "name": "Filecoin.F3ListParticipants.Result", + "name": "Filecoin.`F3`ListParticipants.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { - "$ref": "#/components/schemas/F3Participant" + "$ref": "#/components/schemas/`F3`Participant" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.F3Participate", + "name": "Filecoin.`F3`Participate", "params": [ { "name": "lease_ticket", @@ -1839,10 +1929,10 @@ } ], "result": { - "name": "Filecoin.F3Participate.Result", + "name": "Filecoin.`F3`Participate.Result", "required": true, "schema": { - "$ref": "#/components/schemas/ApiF3ParticipationLease" + "$ref": "#/components/schemas/Api`F3`ParticipationLease" } }, "paramStructure": "by-position" @@ -1870,7 +1960,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -1901,7 +1994,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -1950,7 +2046,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -1995,7 +2094,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2034,7 +2136,10 @@ "name": "Filecoin.GetActorEventsRaw.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ActorEvent" } @@ -2120,7 +2225,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2151,7 +2259,10 @@ "name": "messages", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2162,7 +2273,10 @@ "name": "Filecoin.MpoolBatchPush.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2178,7 +2292,10 @@ "name": "messages", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2189,7 +2306,10 @@ "name": "Filecoin.MpoolBatchPushUntrusted.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2228,7 +2348,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2332,7 +2455,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2351,7 +2477,10 @@ "name": "Filecoin.MpoolSelect.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2373,7 +2502,10 @@ "name": "tipset_key", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2403,7 +2535,10 @@ "name": "tipset_key", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2414,7 +2549,10 @@ "name": "Filecoin.MsigGetPending.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Transaction" } @@ -2436,7 +2574,10 @@ "name": "start_tsk", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2446,7 +2587,10 @@ "name": "end_tsk", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2476,7 +2620,10 @@ "name": "tsk", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2620,7 +2767,10 @@ "name": "Filecoin.NetPeers.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/AddrInfo" } @@ -2636,7 +2786,10 @@ "name": "peerIdList", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -2660,7 +2813,10 @@ "name": "Filecoin.NetProtectList.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -2676,7 +2832,10 @@ "name": "peerIdList", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -2769,7 +2928,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2800,7 +2962,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2824,7 +2989,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2856,7 +3024,10 @@ "name": "messages", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Message" } @@ -2866,7 +3037,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2906,7 +3080,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2953,7 +3130,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -2982,7 +3162,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3013,7 +3196,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3043,7 +3229,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3089,7 +3278,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3129,7 +3321,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3169,7 +3364,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3202,7 +3400,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3270,7 +3471,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3308,7 +3512,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3359,7 +3566,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3391,7 +3601,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3438,7 +3651,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3485,7 +3701,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3509,7 +3728,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3520,7 +3742,10 @@ "name": "Filecoin.StateListActors.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Address" } @@ -3543,7 +3768,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3562,7 +3790,10 @@ "name": "Filecoin.StateListMessages.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3578,7 +3809,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3589,7 +3823,10 @@ "name": "Filecoin.StateListMiners.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Address" } @@ -3612,7 +3849,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3643,7 +3883,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3674,7 +3917,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3698,7 +3944,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3725,7 +3974,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3761,7 +4013,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3792,7 +4047,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3803,7 +4061,10 @@ "name": "Filecoin.StateMinerActiveSectors.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SectorOnChainInfo" } @@ -3826,7 +4087,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3857,7 +4121,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3888,7 +4155,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3899,7 +4169,10 @@ "name": "Filecoin.StateMinerDeadlines.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ApiDeadline" } @@ -3922,7 +4195,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3953,7 +4229,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -3991,7 +4270,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4038,7 +4320,10 @@ "name": "tipset_key", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4078,7 +4363,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4089,7 +4377,10 @@ "name": "Filecoin.StateMinerPartitions.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/MinerPartitions" } @@ -4112,7 +4403,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4150,7 +4444,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4181,7 +4478,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4212,7 +4512,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4252,7 +4555,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4283,7 +4589,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4328,7 +4637,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4339,7 +4651,10 @@ "name": "Filecoin.StateMinerSectors.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SectorOnChainInfo" } @@ -4367,7 +4682,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4398,7 +4716,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4422,7 +4743,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4453,7 +4777,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4515,7 +4842,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4555,7 +4885,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4602,7 +4935,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4642,7 +4978,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4673,7 +5012,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4704,7 +5046,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4735,7 +5080,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -4766,7 +5114,10 @@ "name": "tipsetKey", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } @@ -5035,7 +5386,10 @@ "name": "Filecoin.WalletList.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Address" } @@ -5294,7 +5648,10 @@ "name": "save_to_file", "required": true, "schema": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] } } ], @@ -5340,7 +5697,10 @@ "name": "eth_accounts.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -5454,7 +5814,10 @@ "name": "rewardPercentiles", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "number", "format": "double" @@ -5580,7 +5943,10 @@ "name": "eth_getBlockReceipts.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -5611,7 +5977,10 @@ "name": "eth_getBlockReceiptsLimited.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -6199,7 +6568,10 @@ "name": "trace_block.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6223,7 +6595,10 @@ "name": "trace_filter.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6245,7 +6620,10 @@ "name": "traceTypes", "required": true, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -6256,7 +6634,10 @@ "name": "trace_replayBlockTransactions.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -6280,7 +6661,10 @@ "name": "trace_transaction.Result", "required": false, "schema": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6350,7 +6734,10 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["codec", "value"] + "required": [ + "codec", + "value" + ] }, "ActorEventFilter": { "type": "object", @@ -6371,7 +6758,10 @@ } }, "fromHeight": { - "type": ["integer", "null"], + "type": [ + "integer", + "null" + ], "format": "int64" }, "tipsetKey": { @@ -6385,7 +6775,10 @@ ] }, "toHeight": { - "type": ["integer", "null"], + "type": [ + "integer", + "null" + ], "format": "int64" } } @@ -6411,7 +6804,12 @@ "minimum": 0 } }, - "required": ["Code", "Head", "Nonce", "Balance"] + "required": [ + "Code", + "Head", + "Nonce", + "Balance" + ] }, "ActorTrace": { "type": "object", @@ -6425,7 +6823,10 @@ "$ref": "#/components/schemas/ActorState" } }, - "required": ["Id", "State"] + "required": [ + "Id", + "State" + ] }, "AddrInfo": { "type": "object", @@ -6441,7 +6842,10 @@ "type": "string" } }, - "required": ["ID", "Addrs"] + "required": [ + "ID", + "Addrs" + ] }, "Address": { "type": "string" @@ -6501,7 +6905,11 @@ }, "State": true }, - "required": ["Balance", "Code", "State"] + "required": [ + "Balance", + "Code", + "State" + ] }, "ApiDeadline": { "type": "object", @@ -6518,7 +6926,11 @@ "$ref": "#/components/schemas/BitField" } }, - "required": ["PostSubmissions", "DisputableProofCount", "DailyFee"] + "required": [ + "PostSubmissions", + "DisputableProofCount", + "DailyFee" + ] }, "ApiDeadlineInfo": { "type": "string" @@ -6613,7 +7025,10 @@ "$ref": "#/components/schemas/EthUint64" }, "accessList": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/EthHash" } @@ -6715,8 +7130,8 @@ "s" ] }, - "ApiF3ParticipationLease": { - "description": "defines the lease granted to a storage provider for\nparticipating in F3 consensus, detailing the session identifier, issuer,\nsubject, and the expiration instance.", + "Api`F3`ParticipationLease": { + "description": "defines the lease granted to a storage provider for\nparticipating in `F3` consensus, detailing the session identifier, issuer,\nsubject, and the expiration instance.", "type": "object", "properties": { "FromInstance": { @@ -6788,7 +7203,14 @@ "$ref": "#/components/schemas/Nullable_Receipt" } }, - "required": ["MsgCid", "Msg", "MsgRct", "Error", "Duration", "GasCost"] + "required": [ + "MsgCid", + "Msg", + "MsgRct", + "Error", + "Duration", + "GasCost" + ] }, "ApiMarketDeal": { "type": "object", @@ -6800,7 +7222,10 @@ "$ref": "#/components/schemas/ApiDealState" } }, - "required": ["Proposal", "State"] + "required": [ + "Proposal", + "State" + ] }, "ApiMessage": { "type": "object", @@ -6812,7 +7237,10 @@ "$ref": "#/components/schemas/Message" } }, - "required": ["Cid", "Message"] + "required": [ + "Cid", + "Message" + ] }, "ApiReceipt": { "type": "object", @@ -6832,10 +7260,18 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["ExitCode", "Return", "GasUsed", "EventsRoot"] + "required": [ + "ExitCode", + "Return", + "GasUsed", + "EventsRoot" + ] }, "Base64String": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "BeaconEntry": { "type": "object", @@ -6849,7 +7285,10 @@ "minimum": 0 } }, - "required": ["Round", "Data"] + "required": [ + "Round", + "Data" + ] }, "BeneficiaryTerm": { "type": "object", @@ -6868,13 +7307,20 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["Quota", "UsedQuota", "Expiration"] + "required": [ + "Quota", + "UsedQuota", + "Expiration" + ] }, "BigInt": { "type": "string" }, "BitField": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "integer", "format": "uint8", @@ -6986,7 +7432,10 @@ "type": "boolean" } }, - "required": ["blockHash", "requireCanonical"] + "required": [ + "blockHash", + "requireCanonical" + ] }, "BlockHeader": { "type": "object", @@ -7073,7 +7522,11 @@ "$ref": "#/components/schemas/Nullable_Array_of_Cid" } }, - "required": ["Header", "BlsMessages", "SecpkMessages"] + "required": [ + "Header", + "BlsMessages", + "SecpkMessages" + ] }, "BlockMessages": { "type": "object", @@ -7088,7 +7541,11 @@ "$ref": "#/components/schemas/Nullable_Array_of_SignedMessage" } }, - "required": ["BlsMessages", "SecpkMessages", "Cids"] + "required": [ + "BlsMessages", + "SecpkMessages", + "Cids" + ] }, "BlockNumber": { "type": "object", @@ -7097,7 +7554,9 @@ "$ref": "#/components/schemas/EthInt64" } }, - "required": ["blockNumber"] + "required": [ + "blockNumber" + ] }, "BlockNumberOrHash": { "anyOf": [ @@ -7296,7 +7755,9 @@ "type": "string" } }, - "required": ["/"] + "required": [ + "/" + ] }, "CirculatingSupply": { "type": "object", @@ -7341,7 +7802,10 @@ "$ref": "#/components/schemas/BigInt" } }, - "required": ["RawBytePower", "QualityAdjPower"] + "required": [ + "RawBytePower", + "QualityAdjPower" + ] }, "ClaimLotusJson": { "type": "object", @@ -7403,7 +7867,10 @@ "$ref": "#/components/schemas/ApiInvocResult" } }, - "required": ["Root", "Trace"] + "required": [ + "Root", + "Trace" + ] }, "DealCollateralBounds": { "type": "object", @@ -7415,7 +7882,10 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["Min", "Max"] + "required": [ + "Min", + "Max" + ] }, "ECTipSet": { "type": "object", @@ -7434,7 +7904,12 @@ "type": "string" } }, - "required": ["Key", "Epoch", "PowerTable", "Commitments"] + "required": [ + "Key", + "Epoch", + "PowerTable", + "Commitments" + ] }, "EcConfig": { "type": "object", @@ -7487,7 +7962,10 @@ "format": "int64" } }, - "required": ["VRFProof", "WinCount"] + "required": [ + "VRFProof", + "WinCount" + ] }, "EthAddress": { "type": "string" @@ -7526,7 +8004,10 @@ "format": "int64" }, "error": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "result": { "$ref": "#/components/schemas/TraceResult" @@ -7659,7 +8140,13 @@ "$ref": "#/components/schemas/EthBigInt" } }, - "required": ["callType", "from", "gas", "value", "input"] + "required": [ + "callType", + "from", + "gas", + "value", + "input" + ] }, "EthCallTraceResult": { "type": "object", @@ -7671,7 +8158,10 @@ "$ref": "#/components/schemas/EthBytes" } }, - "required": ["gasUsed", "output"] + "required": [ + "gasUsed", + "output" + ] }, "EthCreateTraceAction": { "type": "object", @@ -7689,7 +8179,12 @@ "$ref": "#/components/schemas/EthBigInt" } }, - "required": ["from", "gas", "value", "init"] + "required": [ + "from", + "gas", + "value", + "init" + ] }, "EthCreateTraceResult": { "type": "object", @@ -7711,7 +8206,10 @@ "$ref": "#/components/schemas/EthUint64" } }, - "required": ["gasUsed", "code"] + "required": [ + "gasUsed", + "code" + ] }, "EthFeeHistoryResult": { "type": "object", @@ -7733,7 +8231,10 @@ "$ref": "#/components/schemas/EthUint64" }, "reward": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "array", "items": { @@ -7742,7 +8243,11 @@ } } }, - "required": ["oldestBlock", "baseFeePerGas", "gasUsedRatio"] + "required": [ + "oldestBlock", + "baseFeePerGas", + "gasUsedRatio" + ] }, "EthFilterResult": { "description": "`EthFilterResult` represents the response from executing a filter:\n- A list of block hashes\n- A list of transaction hashes\n- Or a list of logs", @@ -7785,10 +8290,16 @@ ] }, "fromBlock": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "toBlock": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "topics": { "anyOf": [ @@ -7801,7 +8312,9 @@ ] } }, - "required": ["address"] + "required": [ + "address" + ] }, "EthHash": { "type": "string" @@ -7893,7 +8406,10 @@ "$ref": "#/components/schemas/EthBytes" }, "stateDiff": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "trace": { "type": "array", @@ -7905,10 +8421,17 @@ "$ref": "#/components/schemas/EthHash" }, "vmTrace": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] } }, - "required": ["output", "trace", "transactionHash"] + "required": [ + "output", + "trace", + "transactionHash" + ] }, "EthSyncingResultLotusJson": { "anyOf": [ @@ -7931,7 +8454,11 @@ "format": "int64" } }, - "required": ["startingblock", "currentblock", "highestblock"] + "required": [ + "startingblock", + "currentblock", + "highestblock" + ] } ] }, @@ -7951,7 +8478,10 @@ "$ref": "#/components/schemas/TraceAction" }, "error": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "result": { "$ref": "#/components/schemas/TraceResult" @@ -7968,7 +8498,13 @@ } } }, - "required": ["type", "subtraces", "traceAddress", "action", "result"] + "required": [ + "type", + "subtraces", + "traceAddress", + "action", + "result" + ] }, "EthTraceFilterCriteria": { "type": "object", @@ -8008,7 +8544,10 @@ }, "fromBlock": { "description": "Interpreted as an epoch (in hex) or one of \"latest\" for last mined block, \"pending\" for not yet committed messages.\nOptional, default: \"latest\".\nNote: \"earliest\" is not a permitted value.", - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "toAddress": { "description": "Actor address or a list of addresses to which transactions that generate traces are sent.\nOptional, default: None.\nThe JSON decoding must treat a string as equivalent to an array with one value, for example\n\"0x8888f1f195afa192cfee86069858\" must be decoded as [ \"0x8888f1f195afa192cfee86069858\" ]", @@ -8023,7 +8562,10 @@ }, "toBlock": { "description": "Interpreted as an epoch (in hex) or one of \"latest\" for last mined block, \"pending\" for not yet committed messages.\nOptional, default: \"latest\".\nNote: \"earliest\" is not a permitted value.", - "type": ["string", "null"] + "type": [ + "string", + "null" + ] } } }, @@ -8128,7 +8670,10 @@ } } }, - "required": ["Emitter", "Entries"] + "required": [ + "Emitter", + "Entries" + ] }, "EventEntry": { "type": "object", @@ -8150,7 +8695,12 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["Flags", "Key", "Codec", "Value"] + "required": [ + "Flags", + "Key", + "Codec", + "Value" + ] }, "ExecutionTrace": { "type": "object", @@ -8181,7 +8731,12 @@ "$ref": "#/components/schemas/Nullable_Array_of_ExecutionTrace" } }, - "required": ["Msg", "MsgRct", "GasCharges", "Subcalls"] + "required": [ + "Msg", + "MsgRct", + "GasCharges", + "Subcalls" + ] }, "ExitCode": { "description": "`Newtype` wrapper for the FVM `ExitCode`.\n\n# Examples\n```\n# use forest::doctest_private::ExitCode;\nlet fvm2_success = fvm_shared2::error::ExitCode::new(0);\nlet fvm3_success = fvm_shared3::error::ExitCode::new(0);\n\nlet shim_from_v2 = ExitCode::from(fvm2_success);\nlet shim_from_v3 = ExitCode::from(fvm3_success);\n\nassert_eq!(shim_from_v2, shim_from_v3);\nassert_eq!(shim_from_v2, fvm2_success.into());\nassert_eq!(shim_from_v3, fvm3_success.into());\n```", @@ -8226,9 +8781,14 @@ "minimum": 0 } }, - "required": ["SealProof", "SectorNumber", "SectorKey", "SealedCID"] + "required": [ + "SealProof", + "SectorNumber", + "SectorKey", + "SealedCID" + ] }, - "F3InstanceProgress": { + "`F3`InstanceProgress": { "type": "object", "properties": { "ID": { @@ -8251,9 +8811,13 @@ "minimum": 0 } }, - "required": ["ID", "Round", "Phase"] + "required": [ + "ID", + "Round", + "Phase" + ] }, - "F3Manifest": { + "`F3`Manifest": { "type": "object", "properties": { "BootstrapEpoch": { @@ -8321,7 +8885,7 @@ "PartialMessageManager" ] }, - "F3Participant": { + "`F3`Participant": { "type": "object", "properties": { "FromInstance": { @@ -8340,9 +8904,13 @@ "minimum": 0 } }, - "required": ["MinerID", "FromInstance", "ValidityTerm"] + "required": [ + "MinerID", + "FromInstance", + "ValidityTerm" + ] }, - "F3PowerEntry": { + "`F3`PowerEntry": { "description": "PowerEntry represents a single entry in the PowerTable, including ActorID and its StoragePower and PubKey.", "type": "object", "properties": { @@ -8358,9 +8926,13 @@ "type": "string" } }, - "required": ["ID", "Power", "PubKey"] + "required": [ + "ID", + "Power", + "PubKey" + ] }, - "F3TipSet": { + "`F3`TipSet": { "type": "object", "properties": { "beacon": { @@ -8373,7 +8945,7 @@ "format": "int64" }, "key": { - "$ref": "#/components/schemas/F3TipSetKey" + "$ref": "#/components/schemas/`F3`TipSetKey" }, "timestamp": { "description": "Block creation time, in seconds since the Unix epoch", @@ -8382,10 +8954,15 @@ "minimum": 0 } }, - "required": ["key", "beacon", "epoch", "timestamp"] + "required": [ + "key", + "beacon", + "epoch", + "timestamp" + ] }, - "F3TipSetKey": { - "description": "TipSetKey is the canonically ordered concatenation of the block CIDs in a tipset.", + "`F3`TipSetKey": { + "description": "TipSetKey is the canonically ordered concatenation of the block `CIDs` in a tipset.", "type": "string" }, "FilterID": { @@ -8435,7 +9012,10 @@ "properties": { "last_updated": { "description": "Last time status for this fork was updated.", - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "format": "date-time" }, "stage": { @@ -8444,7 +9024,10 @@ }, "start_time": { "description": "When processing for this fork started.", - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "format": "date-time" }, "target_epoch": { @@ -8684,7 +9267,13 @@ "minimum": 0 } }, - "required": ["Name", "tg", "cg", "sg", "tt"] + "required": [ + "Name", + "tg", + "cg", + "sg", + "tt" + ] }, "GossipBlock": { "type": "object", @@ -8699,7 +9288,11 @@ "$ref": "#/components/schemas/Cid" } }, - "required": ["Header", "BlsMessages", "SecpkMessages"] + "required": [ + "Header", + "BlsMessages", + "SecpkMessages" + ] }, "GpbftConfig": { "type": "object", @@ -8768,7 +9361,10 @@ "$ref": "#/components/schemas/SignatureTypeLotusJson" } }, - "required": ["Type", "PrivateKey"] + "required": [ + "Type", + "PrivateKey" + ] }, "MarketBalance": { "description": "External format for returning market balance from state.", @@ -8781,7 +9377,10 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["Escrow", "Locked"] + "required": [ + "Escrow", + "Locked" + ] }, "Message": { "type": "object", @@ -8832,7 +9431,10 @@ "minimum": 0 } }, - "required": ["To", "From"] + "required": [ + "To", + "From" + ] }, "MessageFilter": { "type": "object", @@ -8844,7 +9446,10 @@ "$ref": "#/components/schemas/Nullable_Address" } }, - "required": ["From", "To"] + "required": [ + "From", + "To" + ] }, "MessageGasCost": { "type": "object", @@ -8903,7 +9508,13 @@ "$ref": "#/components/schemas/NonEmpty_Array_of_Cid" } }, - "required": ["Receipt", "TipSet", "Height", "Message", "ReturnDec"] + "required": [ + "Receipt", + "TipSet", + "Height", + "Message", + "ReturnDec" + ] }, "MessageSendSpec": { "type": "object", @@ -8912,7 +9523,9 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["MaxFee"] + "required": [ + "MaxFee" + ] }, "MessageTrace": { "type": "object", @@ -8921,7 +9534,10 @@ "$ref": "#/components/schemas/Address" }, "GasLimit": { - "type": ["integer", "null"], + "type": [ + "integer", + "null" + ], "format": "uint64", "minimum": 0 }, @@ -8939,7 +9555,10 @@ "minimum": 0 }, "ReadOnly": { - "type": ["boolean", "null"] + "type": [ + "boolean", + "null" + ] }, "To": { "$ref": "#/components/schemas/Address" @@ -8948,7 +9567,14 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["From", "To", "Value", "Method", "Params", "ParamsCodec"] + "required": [ + "From", + "To", + "Value", + "Method", + "Params", + "ParamsCodec" + ] }, "MinerInfo": { "type": "object", @@ -9061,7 +9687,11 @@ "$ref": "#/components/schemas/Claim" } }, - "required": ["MinerPower", "TotalPower", "HasMinPower"] + "required": [ + "MinerPower", + "TotalPower", + "HasMinPower" + ] }, "MinerSectors": { "type": "object", @@ -9082,7 +9712,11 @@ "minimum": 0 } }, - "required": ["Live", "Active", "Faulty"] + "required": [ + "Live", + "Active", + "Faulty" + ] }, "MiningBaseInfo": { "type": "object", @@ -9140,13 +9774,20 @@ "format": "int64" } }, - "required": ["InitialBalance", "StartEpoch", "UnlockDuration"] + "required": [ + "InitialBalance", + "StartEpoch", + "UnlockDuration" + ] }, "NatStatusResult": { "type": "object", "properties": { "PublicAddrs": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "string" } @@ -9156,7 +9797,9 @@ "format": "int32" } }, - "required": ["Reachability"] + "required": [ + "Reachability" + ] }, "NetInfoResult": { "type": "object", @@ -9274,7 +9917,10 @@ "minimum": 0 } }, - "required": ["peers_to_publish_msgs", "peers_to_publish_blocks"] + "required": [ + "peers_to_publish_msgs", + "peers_to_publish_blocks" + ] }, "NodeStatusResult": { "type": "object", @@ -9289,7 +9935,11 @@ "$ref": "#/components/schemas/NodeSyncStatus" } }, - "required": ["sync_status", "peer_status", "chain_status"] + "required": [ + "sync_status", + "peer_status", + "chain_status" + ] }, "NodeSyncStatus": { "type": "object", @@ -9305,7 +9955,10 @@ "minimum": 0 } }, - "required": ["epoch", "behind"] + "required": [ + "epoch", + "behind" + ] }, "NodeSyncStatus2": { "description": "Represents the overall synchronization status of the Forest node.", @@ -9365,73 +10018,109 @@ ] }, "Nullable_Array_of_Address": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Address" } }, "Nullable_Array_of_Base64String": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Base64String" } }, "Nullable_Array_of_BeaconEntry": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/BeaconEntry" } }, "Nullable_Array_of_Cid": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Cid" } }, "Nullable_Array_of_ECTipSet": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ECTipSet" } }, "Nullable_Array_of_ExecutionTrace": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ExecutionTrace" } }, "Nullable_Array_of_ExtendedSectorInfo": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/ExtendedSectorInfo" } }, "Nullable_Array_of_Message": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/Message" } }, "Nullable_Array_of_PoStProof": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/PoStProof" } }, "Nullable_Array_of_PowerTableDelta": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/PowerTableDelta" } }, "Nullable_Array_of_SignedMessage": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "$ref": "#/components/schemas/SignedMessage" } }, "Nullable_Array_of_uint64": { - "type": ["array", "null"], + "type": [ + "array", + "null" + ], "items": { "type": "integer", "format": "uint64", @@ -9519,7 +10208,10 @@ ] }, "Nullable_string": { - "type": ["string", "null"] + "type": [ + "string", + "null" + ] }, "ObjStat": { "type": "object", @@ -9535,7 +10227,10 @@ "minimum": 0 } }, - "required": ["Size", "Links"] + "required": [ + "Size", + "Links" + ] }, "PartialMessageManagerConfig": { "type": "object", @@ -9592,7 +10287,10 @@ "$ref": "#/components/schemas/Tipset" } }, - "required": ["Type", "Val"] + "required": [ + "Type", + "Val" + ] }, { "type": "object", @@ -9605,7 +10303,10 @@ "$ref": "#/components/schemas/Tipset" } }, - "required": ["Type", "Val"] + "required": [ + "Type", + "Val" + ] } ] }, @@ -9647,7 +10348,10 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["PoStProof", "ProofBytes"] + "required": [ + "PoStProof", + "ProofBytes" + ] }, "PowerTableDelta": { "type": "object", @@ -9664,7 +10368,11 @@ "type": "string" } }, - "required": ["ParticipantID", "PowerDelta", "SigningKey"] + "required": [ + "ParticipantID", + "PowerDelta", + "SigningKey" + ] }, "PubSubConfig": { "type": "object", @@ -9707,7 +10415,11 @@ "type": "string" } }, - "required": ["Version", "APIVersion", "BlockDelay"] + "required": [ + "Version", + "APIVersion", + "BlockDelay" + ] }, "Receipt": { "type": "object", @@ -9730,7 +10442,11 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["ExitCode", "Return", "GasUsed"] + "required": [ + "ExitCode", + "Return", + "GasUsed" + ] }, "ReturnTrace": { "type": "object", @@ -9747,7 +10463,11 @@ "minimum": 0 } }, - "required": ["ExitCode", "Return", "ReturnCodec"] + "required": [ + "ExitCode", + "Return", + "ReturnCodec" + ] }, "SectorExpiration": { "type": "object", @@ -9761,7 +10481,10 @@ "format": "int64" } }, - "required": ["OnTime", "Early"] + "required": [ + "OnTime", + "Early" + ] }, "SectorLocation": { "type": "object", @@ -9777,7 +10500,10 @@ "minimum": 0 } }, - "required": ["Deadline", "Partition"] + "required": [ + "Deadline", + "Partition" + ] }, "SectorOnChainInfo": { "type": "object", @@ -9919,7 +10645,11 @@ "format": "int64" } }, - "required": ["Info", "PreCommitDeposit", "PreCommitEpoch"] + "required": [ + "Info", + "PreCommitDeposit", + "PreCommitEpoch" + ] }, "SectorSize": { "type": "integer", @@ -9942,12 +10672,19 @@ "$ref": "#/components/schemas/SignatureTypeLotusJson" } }, - "required": ["Type", "Data"] + "required": [ + "Type", + "Data" + ] }, "SignatureType": { "description": "Signature variants for Filecoin signatures.", "type": "string", - "enum": ["Secp256k1", "Bls", "Delegated"] + "enum": [ + "Secp256k1", + "Bls", + "Delegated" + ] }, "SignatureTypeLotusJson": { "anyOf": [ @@ -9975,13 +10712,20 @@ "$ref": "#/components/schemas/Signature" } }, - "required": ["Message", "Signature"] + "required": [ + "Message", + "Signature" + ] }, "SnapshotProgressState": { "oneOf": [ { "type": "string", - "enum": ["Initializing", "Completed", "NotRequired"] + "enum": [ + "Initializing", + "Completed", + "NotRequired" + ] }, { "type": "object", @@ -9993,11 +10737,15 @@ "type": "string" } }, - "required": ["message"] + "required": [ + "message" + ] } }, "additionalProperties": false, - "required": ["InProgress"] + "required": [ + "InProgress" + ] } ] }, @@ -10011,7 +10759,10 @@ "type": "string" } }, - "required": ["Commitments", "PowerTable"] + "required": [ + "Commitments", + "PowerTable" + ] }, "SyncStatusReport": { "description": "Contains information about the current status of the node's synchronization process.", @@ -10075,7 +10826,9 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": ["VRFProof"] + "required": [ + "VRFProof" + ] }, "Tipset": { "$ref": "#/components/schemas/TipsetInner" @@ -10094,7 +10847,11 @@ "format": "int64" } }, - "required": ["Cids", "Blocks", "Height"] + "required": [ + "Cids", + "Blocks", + "Height" + ] }, "TokenAmount": { "$ref": "#/components/schemas/BigInt" @@ -10144,7 +10901,14 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": ["ID", "To", "Value", "Method", "Params", "Approved"] + "required": [ + "ID", + "To", + "Value", + "Method", + "Params", + "Approved" + ] }, "Transactions": { "anyOf": [ @@ -10168,4 +10932,4 @@ } } } -} +} \ No newline at end of file diff --git a/docs/docs/users/reference/cli.md b/docs/docs/users/reference/cli.md index 04f11775a6ad..b6903412e1d7 100644 --- a/docs/docs/users/reference/cli.md +++ b/docs/docs/users/reference/cli.md @@ -4,7 +4,7 @@ sidebar_position: 1 --- @@ -340,7 +340,7 @@ SUBCOMMANDS: info Print node info shutdown Shutdown Forest healthcheck Print healthcheck info - f3 Manages Filecoin Fast Finality (F3) interactions + f3 Manages Filecoin Fast Finality (`F3`) interactions wait-api Wait for lotus API to come online help Print this message or the help of the given subcommand(s) @@ -416,7 +416,7 @@ Manually set the head to the given tipset. This invalidates blocks between the d Usage: forest-cli chain set-head [OPTIONS] ... Arguments: - ... Construct the new head tipset from these CIDs + ... Construct the new head tipset from these `CIDs` Options: --epoch Use the tipset from this epoch as the new head. Negative numbers specify decrements from the current head @@ -635,7 +635,7 @@ Usage: forest-cli mpool pending [OPTIONS] Options: --local Print pending messages for addresses in local wallet only - --cids Only print `CIDs` of messages in output + --cids Only print ``CIDs`` of messages in output --to Return messages to a given address --from Return messages from a given address -h, --help Print help @@ -828,16 +828,16 @@ Options: ### `forest-cli f3` ``` -Manages Filecoin Fast Finality (F3) interactions +Manages Filecoin Fast Finality (`F3`) interactions Usage: forest-cli f3 Commands: - manifest Gets the current manifest used by F3 - status Checks the F3 status - certs Manages interactions with F3 finality certificates [aliases: c] - powertable Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: pt] - ready Checks if F3 is in sync + manifest Gets the current manifest used by `F3` + status Checks the `F3` status + certs Manages interactions with `F3` finality certificates [aliases: c] + powertable Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: pt] + ready Checks if `F3` is in sync help Print this message or the help of the given subcommand(s) Options: @@ -847,7 +847,7 @@ Options: ### `forest-cli f3 manifest` ``` -Gets the current manifest used by F3 +Gets the current manifest used by `F3` Usage: forest-cli f3 manifest [OPTIONS] @@ -868,7 +868,7 @@ Options: ### `forest-cli f3 status` ``` -Checks the F3 status +Checks the `F3` status Usage: forest-cli f3 status @@ -879,13 +879,13 @@ Options: ### `forest-cli f3 certs` ``` -Manages interactions with F3 finality certificates +Manages interactions with `F3` finality certificates Usage: forest-cli f3 certs Commands: - get Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified - list Lists a range of F3 finality certificates + get Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified + list Lists a range of `F3` finality certificates help Print this message or the help of the given subcommand(s) Options: @@ -895,7 +895,7 @@ Options: ### `forest-cli f3 certs get` ``` -Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified +Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified Usage: forest-cli f3 certs get [OPTIONS] [INSTANCE] @@ -920,7 +920,7 @@ Options: ### `forest-cli f3 certs list` ``` -Lists a range of F3 finality certificates +Lists a range of `F3` finality certificates Usage: forest-cli f3 certs list [OPTIONS] [RANGE] @@ -953,12 +953,12 @@ Options: ### `forest-cli f3 powertable` ``` -Gets F3 power table at a specific instance ID or latest instance if none is specified +Gets `F3` power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable Commands: - get Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: g] + get Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: g] get-proportion Gets the total proportion of power for a list of actors at a given instance [aliases: gp] help Print this message or the help of the given subcommand(s) @@ -969,7 +969,7 @@ Options: ### `forest-cli f3 powertable get` ``` -Gets F3 power table at a specific instance ID or latest instance if none is specified +Gets `F3` power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable get [OPTIONS] [INSTANCE] @@ -1000,17 +1000,17 @@ Options: ### `forest-cli f3 ready` ``` -Checks if F3 is in sync +Checks if `F3` is in sync Usage: forest-cli f3 ready [OPTIONS] Options: --wait - Wait until F3 is in sync + Wait until `F3` is in sync --threshold - The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync [default: 20] + The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync [default: 20] --no-progress-timeout - Exit after F3 making no progress for this duration [default: 10m] + Exit after `F3` making no progress for this duration [default: 10m] -h, --help Print help ``` @@ -1038,7 +1038,7 @@ SUBCOMMANDS: api API tooling net Network utilities shed Miscellaneous, semver-exempt commands for developer use - completion Completion Command for generating shell completions for the CLI + completion Completion Command for generating shell completions for the `CLI` help Print this message or the help of the given subcommand(s) OPTIONS: @@ -1065,7 +1065,7 @@ Options: ### `forest-tool completion` ``` -Completion Command for generating shell completions for the CLI +Completion Command for generating shell completions for the `CLI` Usage: forest-tool completion [OPTIONS] [BINARIES]... @@ -1401,11 +1401,11 @@ Usage: forest-tool archive Commands: info Show basic information about an archive metadata Show FRC-0108 metadata of an Filecoin snapshot archive - f3-header Show FRC-0108 header of a standalone F3 snapshot + f3-header Show FRC-0108 header of a standalone `F3` snapshot export Trim a snapshot of the chain and write it to `` checkpoints Print block headers at 30 day interval for a snapshot file merge Merge snapshot archives into a single file. The output snapshot refers to the heaviest tipset in the input set - merge-f3 Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format + merge-f3 Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format diff Show the difference between the canonical and computed state of a tipset sync-bucket Export lite and diff snapshots from one or more CAR files, and upload them to an `S3` bucket help Print this message or the help of the given subcommand(s) @@ -1466,12 +1466,12 @@ Options: ### `forest-tool archive f3-header` ``` -Show FRC-0108 header of a standalone F3 snapshot +Show FRC-0108 header of a standalone `F3` snapshot Usage: forest-tool archive f3-header Arguments: - Path to a standalone F3 snapshot + Path to a standalone `F3` snapshot Options: -h, --help Print help @@ -1511,13 +1511,13 @@ Options: ### `forest-tool archive merge-f3` ``` -Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format +Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format -Usage: forest-tool archive merge-f3 --v1 --f3 --output +Usage: forest-tool archive merge-f3 --v1 --f3 <`F3`> --output Options: --v1 Path to the v1 Filecoin snapshot - --f3 Path to the F3 snapshot + --f3 <`F3`> Path to the `F3` snapshot --output Path to the snapshot output file in `.forest.car.zst` format -h, --help Print help ``` @@ -1947,7 +1947,7 @@ Miscellaneous, semver-exempt commands for developer use Usage: forest-tool shed Commands: - summarize-tipsets Enumerate the tipset CIDs for a span of epochs starting at `height` and working backwards + summarize-tipsets Enumerate the tipset `CIDs` for a span of epochs starting at `height` and working backwards peer-id-from-key-pair Generate a `PeerId` from the given key-pair file private-key-from-key-pair Generate a base64-encoded private key from the given key-pair file. This effectively transforms Forest's key-pair file into a Lotus-compatible private key key-pair-from-private-key Generate a key-pair file from the given base64-encoded private key. This effectively transforms Lotus's private key into a Forest-compatible key-pair file. If `output` is not provided, the key-pair is printed to stdout as a base64-encoded string @@ -1962,7 +1962,7 @@ Options: ### `forest-tool shed summarize-tipsets` ``` -Enumerate the tipset CIDs for a span of epochs starting at `height` and working backwards. +Enumerate the tipset `CIDs` for a span of epochs starting at `height` and working backwards. Useful for getting blocks to live test an RPC endpoint. diff --git a/docs/docs/users/reference/env_variables.md b/docs/docs/users/reference/env_variables.md index 3457e8efd7c1..04244f4be7cd 100644 --- a/docs/docs/users/reference/env_variables.md +++ b/docs/docs/users/reference/env_variables.md @@ -5,7 +5,7 @@ sidebar_position: 2 # Environment variables -Besides CLI options and the configuration values in the configuration file, +Besides `CLI` options and the configuration values in the configuration file, there are some environment variables that control the behavior of a `forest` process. @@ -32,14 +32,14 @@ process. | `RUST_LOG` | string | empty | `debug,forest_libp2p::service=info` | Allows for log level customization. | | `FOREST_IGNORE_DRAND` | 1 or true | empty | 1 | Ignore Drand validation. | | `FOREST_LIBP2P_METRICS_ENABLED` | 1 or true | empty | 1 | Include `libp2p` metrics in Forest's Prometheus output. | -| `FOREST_F3_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of F3 sidecar. | -| `FOREST_F3_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the F3 sidecar via FFI | -| `FOREST_F3_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the F3 consensus to the node | -| `FOREST_F3_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in F3 manifest | -| `FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in F3 permanently | -| `FOREST_F3_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the F3 initial power table CID | -| `FOREST_F3_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for F3 | -| `FOREST_F3_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for F3 | +| `FOREST_`F3`_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of `F3` sidecar. | +| `FOREST_`F3`_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the `F3` sidecar via FFI | +| `FOREST_`F3`_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the `F3` consensus to the node | +| `FOREST_`F3`_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in `F3` manifest | +| `FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in `F3` permanently | +| `FOREST_`F3`_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the `F3` initial power table CID | +| `FOREST_`F3`_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for `F3` | +| `FOREST_`F3`_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for `F3` | | `FOREST_DRAND_MAINNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_MAINNET` config | | `FOREST_DRAND_QUICKNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_QUICKNET` config | | `FOREST_TRACE_FILTER_MAX_RESULT` | positive integer | 500 | 1000 | Sets the maximum results returned per request by `trace_filter` | @@ -51,13 +51,13 @@ process. | `FOREST_DISABLE_BAD_BLOCK_CACHE` | 1 or true | empty | 1 | Whether or not to disable bad block cache | | `FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE` | positive integer | 268435456 | 536870912 | The default zstd frame cache max size in bytes | -### `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT` +### `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT` This is an environment variable that allows users to opt out of building the f3-sidecar. It's only useful when building the binary. By default, the Go f3-sidecar is built and linked into Forest binary unless environment -variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. +variable `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. ### `FOREST_DB_DEV_MODE` diff --git a/docs/docs/users/reference/generate_cli_md.sh b/docs/docs/users/reference/generate_cli_md.sh index a3c482ee52db..d0261f6664bc 100755 --- a/docs/docs/users/reference/generate_cli_md.sh +++ b/docs/docs/users/reference/generate_cli_md.sh @@ -16,7 +16,7 @@ sidebar_position: 1 --- diff --git a/docs/docs/users/reference/json_rpc_overview.md b/docs/docs/users/reference/json_rpc_overview.md index 0f0697b04664..0d6613fab78a 100644 --- a/docs/docs/users/reference/json_rpc_overview.md +++ b/docs/docs/users/reference/json_rpc_overview.md @@ -27,7 +27,7 @@ Until June 2025, the Lotus [V0](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v0-deprecated.md) and [V1](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v1-stable.md) -APIs served as the reference for Forest's implementation. +`APIs` served as the reference for Forest's implementation. Since June 2025, the [Common Node API](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0104.md) has been the standard for RPC methods across Filecoin clients, replacing the Lotus-specific API as the primary reference for V1 methods. @@ -39,7 +39,7 @@ An FIP to establish a canonical RPC API specification for general use [has been ## Connecting To A Node -By default, Forest exposes the RPC API on `localhost:2345`. See [CLI docs](./cli.md) for configuration options. +By default, Forest exposes the RPC API on `localhost:2345`. See [`CLI` docs](./cli.md) for configuration options. ### Authentication diff --git a/docs/docs/users/reference/metrics.md b/docs/docs/users/reference/metrics.md index 292e1f7cb114..771aad795864 100644 --- a/docs/docs/users/reference/metrics.md +++ b/docs/docs/users/reference/metrics.md @@ -86,22 +86,22 @@ lru_cache_miss_total{kind="tipset"} 7046 ``` # HELP rpc_processing_time Duration of RPC method call in milliseconds. # TYPE rpc_processing_time histogram -rpc_processing_time_sum{method="F3.GetHead"} 0.7877869999999999 -rpc_processing_time_count{method="F3.GetHead"} 30 -rpc_processing_time_bucket{le="0.1",method="F3.GetHead"} 29 -rpc_processing_time_bucket{le="1.0",method="F3.GetHead"} 30 -rpc_processing_time_bucket{le="10.0",method="F3.GetHead"} 30 -rpc_processing_time_bucket{le="100.0",method="F3.GetHead"} 30 -rpc_processing_time_bucket{le="1000.0",method="F3.GetHead"} 30 -rpc_processing_time_bucket{le="+Inf",method="F3.GetHead"} 30 -rpc_processing_time_sum{method="F3.GetPowerTable"} 406.521251 -rpc_processing_time_count{method="F3.GetPowerTable"} 7 -rpc_processing_time_bucket{le="0.1",method="F3.GetPowerTable"} 0 -rpc_processing_time_bucket{le="1.0",method="F3.GetPowerTable"} 0 -rpc_processing_time_bucket{le="10.0",method="F3.GetPowerTable"} 4 -rpc_processing_time_bucket{le="100.0",method="F3.GetPowerTable"} 6 -rpc_processing_time_bucket{le="1000.0",method="F3.GetPowerTable"} 7 -rpc_processing_time_bucket{le="+Inf",method="F3.GetPowerTable"} 7 +rpc_processing_time_sum{method="`F3`.GetHead"} 0.7877869999999999 +rpc_processing_time_count{method="`F3`.GetHead"} 30 +rpc_processing_time_bucket{le="0.1",method="`F3`.GetHead"} 29 +rpc_processing_time_bucket{le="1.0",method="`F3`.GetHead"} 30 +rpc_processing_time_bucket{le="10.0",method="`F3`.GetHead"} 30 +rpc_processing_time_bucket{le="100.0",method="`F3`.GetHead"} 30 +rpc_processing_time_bucket{le="1000.0",method="`F3`.GetHead"} 30 +rpc_processing_time_bucket{le="+Inf",method="`F3`.GetHead"} 30 +rpc_processing_time_sum{method="`F3`.GetPowerTable"} 406.521251 +rpc_processing_time_count{method="`F3`.GetPowerTable"} 7 +rpc_processing_time_bucket{le="0.1",method="`F3`.GetPowerTable"} 0 +rpc_processing_time_bucket{le="1.0",method="`F3`.GetPowerTable"} 0 +rpc_processing_time_bucket{le="10.0",method="`F3`.GetPowerTable"} 4 +rpc_processing_time_bucket{le="100.0",method="`F3`.GetPowerTable"} 6 +rpc_processing_time_bucket{le="1000.0",method="`F3`.GetPowerTable"} 7 +rpc_processing_time_bucket{le="+Inf",method="`F3`.GetPowerTable"} 7 rpc_processing_time_sum{method="Filecoin.NetAddrsListen"} 434.141625 rpc_processing_time_count{method="Filecoin.NetAddrsListen"} 1 rpc_processing_time_bucket{le="0.1",method="Filecoin.NetAddrsListen"} 0 @@ -110,46 +110,46 @@ rpc_processing_time_bucket{le="10.0",method="Filecoin.NetAddrsListen"} 0 rpc_processing_time_bucket{le="100.0",method="Filecoin.NetAddrsListen"} 0 rpc_processing_time_bucket{le="1000.0",method="Filecoin.NetAddrsListen"} 1 rpc_processing_time_bucket{le="+Inf",method="Filecoin.NetAddrsListen"} 1 -rpc_processing_time_sum{method="F3.GetParticipatingMinerIDs"} 51.30074899999999 -rpc_processing_time_count{method="F3.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="0.1",method="F3.GetParticipatingMinerIDs"} 0 -rpc_processing_time_bucket{le="1.0",method="F3.GetParticipatingMinerIDs"} 39 -rpc_processing_time_bucket{le="10.0",method="F3.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="100.0",method="F3.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="1000.0",method="F3.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="+Inf",method="F3.GetParticipatingMinerIDs"} 58 -rpc_processing_time_sum{method="F3.GetTipset"} 0.282751 -rpc_processing_time_count{method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="0.1",method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="1.0",method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="10.0",method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="100.0",method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="1000.0",method="F3.GetTipset"} 8 -rpc_processing_time_bucket{le="+Inf",method="F3.GetTipset"} 8 -rpc_processing_time_sum{method="F3.Finalize"} 12.134668999999999 -rpc_processing_time_count{method="F3.Finalize"} 26 -rpc_processing_time_bucket{le="0.1",method="F3.Finalize"} 1 -rpc_processing_time_bucket{le="1.0",method="F3.Finalize"} 23 -rpc_processing_time_bucket{le="10.0",method="F3.Finalize"} 26 -rpc_processing_time_bucket{le="100.0",method="F3.Finalize"} 26 -rpc_processing_time_bucket{le="1000.0",method="F3.Finalize"} 26 -rpc_processing_time_bucket{le="+Inf",method="F3.Finalize"} 26 -rpc_processing_time_sum{method="F3.GetParent"} 0.306957 -rpc_processing_time_count{method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="0.1",method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="1.0",method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="10.0",method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="100.0",method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="1000.0",method="F3.GetParent"} 10 -rpc_processing_time_bucket{le="+Inf",method="F3.GetParent"} 10 -rpc_processing_time_sum{method="F3.ProtectPeer"} 0.164208 -rpc_processing_time_count{method="F3.ProtectPeer"} 1 -rpc_processing_time_bucket{le="0.1",method="F3.ProtectPeer"} 0 -rpc_processing_time_bucket{le="1.0",method="F3.ProtectPeer"} 1 -rpc_processing_time_bucket{le="10.0",method="F3.ProtectPeer"} 1 -rpc_processing_time_bucket{le="100.0",method="F3.ProtectPeer"} 1 -rpc_processing_time_bucket{le="1000.0",method="F3.ProtectPeer"} 1 -rpc_processing_time_bucket{le="+Inf",method="F3.ProtectPeer"} 1 +rpc_processing_time_sum{method="`F3`.GetParticipatingMinerIDs"} 51.30074899999999 +rpc_processing_time_count{method="`F3`.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="0.1",method="`F3`.GetParticipatingMinerIDs"} 0 +rpc_processing_time_bucket{le="1.0",method="`F3`.GetParticipatingMinerIDs"} 39 +rpc_processing_time_bucket{le="10.0",method="`F3`.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="100.0",method="`F3`.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="1000.0",method="`F3`.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="+Inf",method="`F3`.GetParticipatingMinerIDs"} 58 +rpc_processing_time_sum{method="`F3`.GetTipset"} 0.282751 +rpc_processing_time_count{method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="0.1",method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="1.0",method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="10.0",method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="100.0",method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="1000.0",method="`F3`.GetTipset"} 8 +rpc_processing_time_bucket{le="+Inf",method="`F3`.GetTipset"} 8 +rpc_processing_time_sum{method="`F3`.Finalize"} 12.134668999999999 +rpc_processing_time_count{method="`F3`.Finalize"} 26 +rpc_processing_time_bucket{le="0.1",method="`F3`.Finalize"} 1 +rpc_processing_time_bucket{le="1.0",method="`F3`.Finalize"} 23 +rpc_processing_time_bucket{le="10.0",method="`F3`.Finalize"} 26 +rpc_processing_time_bucket{le="100.0",method="`F3`.Finalize"} 26 +rpc_processing_time_bucket{le="1000.0",method="`F3`.Finalize"} 26 +rpc_processing_time_bucket{le="+Inf",method="`F3`.Finalize"} 26 +rpc_processing_time_sum{method="`F3`.GetParent"} 0.306957 +rpc_processing_time_count{method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="0.1",method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="1.0",method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="10.0",method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="100.0",method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="1000.0",method="`F3`.GetParent"} 10 +rpc_processing_time_bucket{le="+Inf",method="`F3`.GetParent"} 10 +rpc_processing_time_sum{method="`F3`.ProtectPeer"} 0.164208 +rpc_processing_time_count{method="`F3`.ProtectPeer"} 1 +rpc_processing_time_bucket{le="0.1",method="`F3`.ProtectPeer"} 0 +rpc_processing_time_bucket{le="1.0",method="`F3`.ProtectPeer"} 1 +rpc_processing_time_bucket{le="10.0",method="`F3`.ProtectPeer"} 1 +rpc_processing_time_bucket{le="100.0",method="`F3`.ProtectPeer"} 1 +rpc_processing_time_bucket{le="1000.0",method="`F3`.ProtectPeer"} 1 +rpc_processing_time_bucket{le="+Inf",method="`F3`.ProtectPeer"} 1 rpc_processing_time_sum{method="Filecoin.StateNetworkName"} 4.00525 rpc_processing_time_count{method="Filecoin.StateNetworkName"} 1 rpc_processing_time_bucket{le="0.1",method="Filecoin.StateNetworkName"} 0 diff --git a/documentation/src/developer_documentation/local_actions.md b/documentation/src/developer_documentation/local_actions.md index 817589e0ff2c..dbdccc314390 100644 --- a/documentation/src/developer_documentation/local_actions.md +++ b/documentation/src/developer_documentation/local_actions.md @@ -28,7 +28,7 @@ is based on an older Ubuntu base. You can always edit this later in Let's consider running an integration test. At the time of writing, the usual workflow looks like this: -1. Build Forest daemon and CLI in one job. +1. Build Forest daemon and `CLI` in one job. 2. Upload the artifacts to GH. 3. In another job, download the artifacts to the test runner. 4. Run the integration test. @@ -144,7 +144,7 @@ download the artifacts. # Example run After all the remarks above are addressed, you can run the job locally. For -example, to run the integration test for the CLI: +example, to run the integration test for the `CLI`: ```shell act --secret-file act-secrets.env --env-file act.env -W .github/workflows/forest.yml -j forest-cli-check --artifact-server-path /tmp/artifacts/ --reuse @@ -183,32 +183,32 @@ INFO[0000] Start server on http://192.168.1.10:34567 [Integration tests/Build Ubuntu] 🐳 docker exec cmd=[node /var/run/act/actions/actions-upload-artifact@v3/dist/index.js] user= workdir= [Integration tests/Build Ubuntu] ✅ Success - Main actions/upload-artifact@v3 [Integration tests/Build Ubuntu] 🏁 Job succeeded -[Integration tests/Forest CLI checks] 🚀 Start image=catthehacker/ubuntu:act-latest -[Integration tests/Forest CLI checks] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false -[Integration tests/Forest CLI checks] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] -[Integration tests/Forest CLI checks] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] -[Integration tests/Forest CLI checks] ☁ git clone 'https://github.com/actions/download-artifact' # ref=v3 -[Integration tests/Forest CLI checks] ⭐ Run Main Checkout Sources -[Integration tests/Forest CLI checks] 🐳 docker cp src=/home/rumcajs/prj/forest/. dst=/home/rumcajs/prj/forest -[Integration tests/Forest CLI checks] ✅ Success - Main Checkout Sources -[Integration tests/Forest CLI checks] ⭐ Run Main actions/download-artifact@v3 -[Integration tests/Forest CLI checks] 🐳 docker cp src=/home/rumcajs/.cache/act/actions-download-artifact@v3/ dst=/var/run/act/actions/actions-download-artifact@v3/ -[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v3/dist/index.js] user= workdir= -[Integration tests/Forest CLI checks] ✅ Success - Main actions/download-artifact@v3 -[Integration tests/Forest CLI checks] ⚙ ::set-output:: download-path=/root/.cargo/bin -[Integration tests/Forest CLI checks] ⭐ Run Main Set permissions -[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= -[Integration tests/Forest CLI checks] ✅ Success - Main Set permissions -[Integration tests/Forest CLI checks] ⭐ Run Main install CA certificates -[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= -[Integration tests/Forest CLI checks] ✅ Success - Main install CA certificates -[Integration tests/Forest CLI checks] ⭐ Run Main Make sure everything is in PATH -[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=/root/.cargo/bin/ -[Integration tests/Forest CLI checks] ✅ Success - Main Make sure everything is in PATH -[Integration tests/Forest CLI checks] ⭐ Run Main forest-cli check -[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5] user= workdir= -[Integration tests/Forest CLI checks] ✅ Success - Main forest-cli check -[Integration tests/Forest CLI checks] 🏁 Job succeeded +[Integration tests/Forest `CLI` checks] 🚀 Start image=catthehacker/ubuntu:act-latest +[Integration tests/Forest `CLI` checks] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false +[Integration tests/Forest `CLI` checks] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] +[Integration tests/Forest `CLI` checks] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] +[Integration tests/Forest `CLI` checks] ☁ git clone 'https://github.com/actions/download-artifact' # ref=v3 +[Integration tests/Forest `CLI` checks] ⭐ Run Main Checkout Sources +[Integration tests/Forest `CLI` checks] 🐳 docker cp src=/home/rumcajs/prj/forest/. dst=/home/rumcajs/prj/forest +[Integration tests/Forest `CLI` checks] ✅ Success - Main Checkout Sources +[Integration tests/Forest `CLI` checks] ⭐ Run Main actions/download-artifact@v3 +[Integration tests/Forest `CLI` checks] 🐳 docker cp src=/home/rumcajs/.cache/act/actions-download-artifact@v3/ dst=/var/run/act/actions/actions-download-artifact@v3/ +[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v3/dist/index.js] user= workdir= +[Integration tests/Forest `CLI` checks] ✅ Success - Main actions/download-artifact@v3 +[Integration tests/Forest `CLI` checks] ⚙ ::set-output:: download-path=/root/.cargo/bin +[Integration tests/Forest `CLI` checks] ⭐ Run Main Set permissions +[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= +[Integration tests/Forest `CLI` checks] ✅ Success - Main Set permissions +[Integration tests/Forest `CLI` checks] ⭐ Run Main install CA certificates +[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= +[Integration tests/Forest `CLI` checks] ✅ Success - Main install CA certificates +[Integration tests/Forest `CLI` checks] ⭐ Run Main Make sure everything is in PATH +[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=/root/.cargo/bin/ +[Integration tests/Forest `CLI` checks] ✅ Success - Main Make sure everything is in PATH +[Integration tests/Forest `CLI` checks] ⭐ Run Main forest-cli check +[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5] user= workdir= +[Integration tests/Forest `CLI` checks] ✅ Success - Main forest-cli check +[Integration tests/Forest `CLI` checks] 🏁 Job succeeded ``` # Caveats diff --git a/f3-sidecar/README.md b/f3-sidecar/README.md index 4253224e1f5c..523b5023231f 100644 --- a/f3-sidecar/README.md +++ b/f3-sidecar/README.md @@ -22,9 +22,9 @@ Follow this [guide](https://go.dev/doc/install) to install or use one of the ver `mitmproxy --mode reverse:http://localhost:2345 --listen-port 8080` then `go run . -rpc http://127.0.0.1:8080/rpc/v1` -### How F3 sidecar interacts with Forest +### How `F3` sidecar interacts with Forest -An F3 sidecar node is a standalone node that is a part of a p2p network and +An `F3` sidecar node is a standalone node that is a part of a p2p network and participates in the f3 protocol. Besides what have been handled internally(e.g. p2p communications) in the @@ -40,7 +40,7 @@ Besides what have been handled internally(e.g. p2p communications) in the participating miners - it requires a backend that provides the actor IDs of the participating miners - it requires a p2p node as bootstrapper to discover more peers via Kademlia -- additionally, to power the `Filecoin.F3*` RPC methods in forest, a sidecar +- additionally, to power the `Filecoin.`F3`*` RPC methods in forest, a sidecar node runs an RPC server that implements the same RPC methods to which the associated forest node can delegate the RPC requests @@ -48,19 +48,19 @@ A brief diagram: ```mermaid flowchart TD - A[F3 sidecar] -->|EC API calls| B(Forest) + A[`F3` sidecar] -->|EC API calls| B(Forest) A --> |signer API calls| B A --> |read manifest params| B A --> |P2P bootstrap node| B - B --> |delegate F3 RPC calls| A + B --> |delegate `F3` RPC calls| A A --> |storage backend| C[level db] A --> |dynamic manifest backend| D[manifest p2p server] ``` -### To build and run F3 sidecar within Forest via FFI +### To build and run `F3` sidecar within Forest via FFI -By default, the Go F3-sidecar is built and linked into Forest binary unless -environment variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. +By default, the Go `F3`-sidecar is built and linked into Forest binary unless +environment variable `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. -F3 sidecar is not started by default, set `FOREST_F3_SIDECAR_FFI_ENABLED=1` to +`F3` sidecar is not started by default, set `FOREST_`F3`_SIDECAR_FFI_ENABLED=1` to opt in. diff --git a/f3-sidecar/api.go b/f3-sidecar/api.go index e11ac816e12a..051deee525fc 100644 --- a/f3-sidecar/api.go +++ b/f3-sidecar/api.go @@ -15,7 +15,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" ) -type F3Api struct { +type `F3`Api struct { GetRawNetworkName func(context.Context) (string, error) GetTipsetByEpoch func(context.Context, int64) (TipSet, error) GetTipset func(context.Context, gpbft.TipSetKey) (TipSet, error) @@ -39,23 +39,23 @@ type VersionInfo struct { Version string } -type F3ServerHandler struct { - f3 *f3.F3 +type `F3`ServerHandler struct { + f3 *f3.`F3` } -func (h *F3ServerHandler) F3GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { +func (h *`F3`ServerHandler) `F3`GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { return h.f3.GetCert(ctx, instance) } -func (h *F3ServerHandler) F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) { +func (h *`F3`ServerHandler) `F3`GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) { return h.f3.GetLatestCert(ctx) } -func (h *F3ServerHandler) F3GetF3PowerTable(ctx context.Context, tsk []byte) (gpbft.PowerEntries, error) { +func (h *`F3`ServerHandler) `F3`Get`F3`PowerTable(ctx context.Context, tsk []byte) (gpbft.PowerEntries, error) { return h.f3.GetPowerTable(ctx, tsk) } -func (h *F3ServerHandler) F3ExportLatestSnapshot(ctx context.Context, path string) (_ *cid.Cid, err error) { +func (h *`F3`ServerHandler) `F3`ExportLatestSnapshot(ctx context.Context, path string) (_ *cid.Cid, err error) { cs, err := h.f3.GetCertStore() if err != nil { return nil, err @@ -84,7 +84,7 @@ func (h *F3ServerHandler) F3ExportLatestSnapshot(ctx context.Context, path strin return &cid, nil } -// F3GetF3PowerTableByInstance retrieves the power table for a specific consensus instance. +// `F3`Get`F3`PowerTableByInstance retrieves the power table for a specific consensus instance. // It returns the power entries associated with the given instance number. // // Parameters: @@ -94,19 +94,19 @@ func (h *F3ServerHandler) F3ExportLatestSnapshot(ctx context.Context, path strin // Returns: // - PowerEntries: The power distribution table for the specified instance // - error: Any error encountered during retrieval -func (h *F3ServerHandler) F3GetF3PowerTableByInstance(ctx context.Context, instance uint64) (gpbft.PowerEntries, error) { +func (h *`F3`ServerHandler) `F3`Get`F3`PowerTableByInstance(ctx context.Context, instance uint64) (gpbft.PowerEntries, error) { return h.f3.GetPowerTableByInstance(ctx, instance) } -func (h *F3ServerHandler) F3IsRunning(_ context.Context) bool { +func (h *`F3`ServerHandler) `F3`IsRunning(_ context.Context) bool { return h.f3.IsRunning() } -func (h *F3ServerHandler) F3GetProgress(_ context.Context) gpbft.InstanceProgress { +func (h *`F3`ServerHandler) `F3`GetProgress(_ context.Context) gpbft.InstanceProgress { return h.f3.Progress() } -func (h *F3ServerHandler) F3GetManifest(ctx context.Context) manifest.Manifest { +func (h *`F3`ServerHandler) `F3`GetManifest(ctx context.Context) manifest.Manifest { m := h.f3.Manifest() if !isCidDefined(m.InitialPowerTable) { if cert0, err := h.f3.GetCert(ctx, 0); err == nil { diff --git a/f3-sidecar/ec.go b/f3-sidecar/ec.go index 06b7964a7bc2..2728db931967 100644 --- a/f3-sidecar/ec.go +++ b/f3-sidecar/ec.go @@ -13,18 +13,18 @@ import ( type ForestEC struct { rpcEndpoint string isJwtProvided bool - f3api F3Api + f3api `F3`Api closer jsonrpc.ClientCloser } func NewForestEC(ctx context.Context, rpcEndpoint, jwt string) (ForestEC, error) { - f3api := F3Api{} + f3api := `F3`Api{} headers := make(http.Header) isJwtProvided := len(jwt) > 0 if isJwtProvided { headers.Add("Authorization", fmt.Sprintf("Bearer %s", jwt)) } - closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "F3", &f3api, headers) + closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "`F3`", &f3api, headers) if err != nil { return ForestEC{}, err } diff --git a/f3-sidecar/ffi_gen.go b/f3-sidecar/ffi_gen.go index aea26d966715..15566c5a32d9 100644 --- a/f3-sidecar/ffi_gen.go +++ b/f3-sidecar/ffi_gen.go @@ -26,15 +26,15 @@ import ( "github.com/ihciah/rust2go/asmcall" ) -var GoF3NodeImpl GoF3Node +var Go`F3`NodeImpl Go`F3`Node -type GoF3Node interface { +type Go`F3`Node interface { run(rpc_endpoint *string, jwt *string, f3_rpc_endpoint *string, initial_power_table *string, bootstrap_epoch *int64, finality *int64, f3_root *string) bool import_snap(f3_rpc_endpoint *string, f3_root *string, snapshot_path *string) string } -//export CGoF3Node_run -func CGoF3Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C.StringRef, initial_power_table C.StringRef, bootstrap_epoch C.int64_t, finality C.int64_t, f3_root C.StringRef, slot *C.void, cb *C.void) { +//export CGo`F3`Node_run +func CGo`F3`Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C.StringRef, initial_power_table C.StringRef, bootstrap_epoch C.int64_t, finality C.int64_t, f3_root C.StringRef, slot *C.void, cb *C.void) { _new_rpc_endpoint := newString(rpc_endpoint) _new_jwt := newString(jwt) _new_f3_rpc_endpoint := newString(f3_rpc_endpoint) @@ -42,7 +42,7 @@ func CGoF3Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C. _new_bootstrap_epoch := newC_int64_t(bootstrap_epoch) _new_finality := newC_int64_t(finality) _new_f3_root := newString(f3_root) - resp := GoF3NodeImpl.run(&_new_rpc_endpoint, &_new_jwt, &_new_f3_rpc_endpoint, &_new_initial_power_table, &_new_bootstrap_epoch, &_new_finality, &_new_f3_root) + resp := Go`F3`NodeImpl.run(&_new_rpc_endpoint, &_new_jwt, &_new_f3_rpc_endpoint, &_new_initial_power_table, &_new_bootstrap_epoch, &_new_finality, &_new_f3_root) resp_ref, buffer := cvt_ref(cntC_bool, refC_bool)(&resp) asmcall.CallFuncG0P2(unsafe.Pointer(cb), unsafe.Pointer(&resp_ref), unsafe.Pointer(slot)) runtime.KeepAlive(resp_ref) @@ -50,12 +50,12 @@ func CGoF3Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C. runtime.KeepAlive(buffer) } -//export CGoF3Node_import_snap -func CGoF3Node_import_snap(f3_rpc_endpoint C.StringRef, f3_root C.StringRef, snapshot_path C.StringRef, slot *C.void, cb *C.void) { +//export CGo`F3`Node_import_snap +func CGo`F3`Node_import_snap(f3_rpc_endpoint C.StringRef, f3_root C.StringRef, snapshot_path C.StringRef, slot *C.void, cb *C.void) { _new_f3_rpc_endpoint := newString(f3_rpc_endpoint) _new_f3_root := newString(f3_root) _new_snapshot_path := newString(snapshot_path) - resp := GoF3NodeImpl.import_snap(&_new_f3_rpc_endpoint, &_new_f3_root, &_new_snapshot_path) + resp := Go`F3`NodeImpl.import_snap(&_new_f3_rpc_endpoint, &_new_f3_root, &_new_snapshot_path) resp_ref, buffer := cvt_ref(cntString, refString)(&resp) asmcall.CallFuncG0P2(unsafe.Pointer(cb), unsafe.Pointer(&resp_ref), unsafe.Pointer(slot)) runtime.KeepAlive(resp_ref) diff --git a/f3-sidecar/ffi_impl.go b/f3-sidecar/ffi_impl.go index 6bfb7f472e2f..45ef62150cdd 100644 --- a/f3-sidecar/ffi_impl.go +++ b/f3-sidecar/ffi_impl.go @@ -24,7 +24,7 @@ func init() { checkError(err) err = logging.SetLogLevel("f3/sidecar", "debug") checkError(err) - GoF3NodeImpl = &f3Impl{ctx: context.Background()} + Go`F3`NodeImpl = &f3Impl{ctx: context.Background()} } type f3Impl struct { @@ -41,7 +41,7 @@ func (f3 *f3Impl) run(rpc_endpoint *string, jwt *string, f3_rpc_endpoint *string err = run(f3.ctx, *rpc_endpoint, *jwt, *f3_rpc_endpoint, *initial_power_table, *bootstrap_epoch, *finality, *db) if err != nil { nRetry += 1 - logger.Errorf("Unexpected F3 failure, retrying(%d) in 10s... error=%s", nRetry, err) + logger.Errorf("Unexpected `F3` failure, retrying(%d) in 10s... error=%s", nRetry, err) time.Sleep(10 * time.Second) } } diff --git a/f3-sidecar/go.sum b/f3-sidecar/go.sum index 8d65d50e5c23..0720c50df84d 100644 --- a/f3-sidecar/go.sum +++ b/f3-sidecar/go.sum @@ -53,7 +53,7 @@ github.com/filecoin-project/go-state-types v0.16.0 h1:ajIREDzTGfq71ofIQ29iZR1WXx github.com/filecoin-project/go-state-types v0.16.0/go.mod h1:YCESyrqnyu17y0MazbV6Uwma5+BrMvEKEQp5QWeIf9g= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= -github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJh`F3`1t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -71,7 +71,7 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58U`F3`b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -138,7 +138,7 @@ github.com/ipfs/go-block-format v0.2.2/go.mod h1:vmuefuWU6b+9kIU0vZJgpiJt1yicQz9 github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43D`F3`iPgn4GIN0mk= github.com/ipfs/go-datastore v0.8.3 h1:z391GsQyGKUIUof2tPoaZVeDknbt7fNHs6Gqjcw5Jo4= github.com/ipfs/go-datastore v0.8.3/go.mod h1:raxQ/CreIy9L6MxT71ItfMX12/ASN6EhXJoUFjICQ2M= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -476,13 +476,13 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -496,7 +496,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0`F3`1C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= @@ -597,7 +597,7 @@ google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZbl`F3`eUsNvo= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/f3-sidecar/import.go b/f3-sidecar/import.go index 7acbbe0fdbb0..3c80af2628fe 100644 --- a/f3-sidecar/import.go +++ b/f3-sidecar/import.go @@ -13,10 +13,10 @@ import ( ) func importSnap(ctx context.Context, rpcEndpoint string, f3Root string, snapshotPath string) (err error) { - logger.Infof("importing F3 snapshot at %s", snapshotPath) + logger.Infof("importing `F3` snapshot at %s", snapshotPath) - f3api := F3Api{} - closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "F3", &f3api, nil) + f3api := `F3`Api{} + closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "`F3`", &f3api, nil) if err != nil { return err } diff --git a/f3-sidecar/main.go b/f3-sidecar/main.go index d94f71d50e70..b977d7897bd8 100644 --- a/f3-sidecar/main.go +++ b/f3-sidecar/main.go @@ -32,11 +32,11 @@ func main() { var jwt string flag.StringVar(&jwt, "jwt", "", "the JWT token for invoking forest RPC methods that require WRITE and SIGN permission") var f3RpcEndpoint string - flag.StringVar(&f3RpcEndpoint, "f3-rpc", "127.0.0.1:23456", "The RPC endpoint F3 sidecar listens on") + flag.StringVar(&f3RpcEndpoint, "f3-rpc", "127.0.0.1:23456", "The RPC endpoint `F3` sidecar listens on") var initialPowerTable string flag.StringVar(&initialPowerTable, "initial-power-table", "", "The CID of the initial power table") var bootstrapEpoch int64 - flag.Int64Var(&bootstrapEpoch, "bootstrap", -1, "F3 bootstrap epoch") + flag.Int64Var(&bootstrapEpoch, "bootstrap", -1, "`F3` bootstrap epoch") var finality int64 flag.Int64Var(&finality, "finality", 900, "chain finality epochs") var f3Root string diff --git a/f3-sidecar/manifest.go b/f3-sidecar/manifest.go index 147dcfd024d6..c6040b01a3be 100644 --- a/f3-sidecar/manifest.go +++ b/f3-sidecar/manifest.go @@ -11,31 +11,31 @@ import ( var Network2PredefinedManifestMappings map[gpbft.NetworkName]*manifest.Manifest = make(map[gpbft.NetworkName]*manifest.Manifest) func init() { - for _, bytes := range [][]byte{F3ManifestBytes2K, F3ManifestBytesButterfly, F3ManifestBytesCalibnet, F3ManifestBytesMainnet} { + for _, bytes := range [][]byte{`F3`ManifestBytes2K, `F3`ManifestBytesButterfly, `F3`ManifestBytesCalibnet, `F3`ManifestBytesMainnet} { m := loadManifest(bytes) Network2PredefinedManifestMappings[m.NetworkName] = m } } //go:embed f3manifest_2k.json -var F3ManifestBytes2K []byte +var `F3`ManifestBytes2K []byte //go:embed f3manifest_butterfly.json -var F3ManifestBytesButterfly []byte +var `F3`ManifestBytesButterfly []byte //go:embed f3manifest_calibnet.json -var F3ManifestBytesCalibnet []byte +var `F3`ManifestBytesCalibnet []byte //go:embed f3manifest_mainnet.json -var F3ManifestBytesMainnet []byte +var `F3`ManifestBytesMainnet []byte func loadManifest(bytes []byte) *manifest.Manifest { var m manifest.Manifest if err := json.Unmarshal(bytes, &m); err != nil { - logger.Panicf("failed to unmarshal F3 manifest: %s", err) + logger.Panicf("failed to unmarshal `F3` manifest: %s", err) } if err := m.Validate(); err != nil { - logger.Panicf("invalid F3 manifest: %s", err) + logger.Panicf("invalid `F3` manifest: %s", err) } return &m } diff --git a/f3-sidecar/p2p.go b/f3-sidecar/p2p.go index c98d1666943a..319d1e01a0c5 100644 --- a/f3-sidecar/p2p.go +++ b/f3-sidecar/p2p.go @@ -56,7 +56,7 @@ func createP2PHost(ctx context.Context, networkName string) (*P2PHost, error) { pubsub.WithMessageIdFn(hashMsgId), // Bump the validation queue to accommodate the increase in gossipsub message // exchange rate as a result of f3. The size of 256 should offer enough headroom - // for slower F3 validation while avoiding: 1) avoid excessive memory usage, 2) + // for slower `F3` validation while avoiding: 1) avoid excessive memory usage, 2) // dropped consensus related messages and 3) cascading effect among other topics // since this config isn't topic-specific. // diff --git a/f3-sidecar/run.go b/f3-sidecar/run.go index af7c8dae7f58..c7cf4e6b184a 100644 --- a/f3-sidecar/run.go +++ b/f3-sidecar/run.go @@ -104,7 +104,7 @@ func run(ctx context.Context, rpcEndpoint string, jwt string, f3RpcEndpoint stri } rpcServer := jsonrpc.NewServer() - serverHandler := &F3ServerHandler{f3Module} + serverHandler := &`F3`ServerHandler{f3Module} rpcServer.Register("Filecoin", serverHandler) srv := &http.Server{ Handler: rpcServer, @@ -176,12 +176,12 @@ func run(ctx context.Context, rpcEndpoint string, jwt string, f3RpcEndpoint stri } } -func participate(ctx context.Context, f3Module *f3.F3, signer gpbft.Signer, msgToSign *gpbft.MessageBuilder, miner uint64) error { +func participate(ctx context.Context, f3Module *f3.`F3`, signer gpbft.Signer, msgToSign *gpbft.MessageBuilder, miner uint64) error { signatureBuilder, err := msgToSign.PrepareSigningInputs(gpbft.ActorID(miner)) if err != nil { if errors.Is(err, gpbft.ErrNoPower) { - // we don't have any power in F3, continue - return fmt.Errorf("no power to participate in F3: %+v", err) + // we don't have any power in `F3`, continue + return fmt.Errorf("no power to participate in `F3`: %+v", err) } else { return fmt.Errorf("preparing signing inputs: %+v", err) } @@ -190,7 +190,7 @@ func participate(ctx context.Context, f3Module *f3.F3, signer gpbft.Signer, msgT if err != nil { logger.Warnf("signing message: %+v", err) } - logger.Debugf("miner with id %d is sending message in F3", miner) + logger.Debugf("miner with id %d is sending message in `F3`", miner) f3Module.Broadcast(ctx, signatureBuilder, payloadSig, vrfSig) return nil } diff --git a/f3-sidecar/utils.go b/f3-sidecar/utils.go index 7d89126bd134..e900a92ce2cb 100644 --- a/f3-sidecar/utils.go +++ b/f3-sidecar/utils.go @@ -20,7 +20,7 @@ func getDatastore(f3Root string) (*leveldb.Datastore, error) { return leveldb.NewDatastore(filepath.Join(f3Root, "db"), nil) } -func waitRawNetworkName(ctx context.Context, f3api *F3Api) string { +func waitRawNetworkName(ctx context.Context, f3api *`F3`Api) string { for { rawNetwork, err := f3api.GetRawNetworkName(ctx) if err != nil { diff --git a/interop-tests/src/tests/go_app/go.sum b/interop-tests/src/tests/go_app/go.sum index d9219f3e6f61..be0a065f6f56 100644 --- a/interop-tests/src/tests/go_app/go.sum +++ b/interop-tests/src/tests/go_app/go.sum @@ -39,7 +39,7 @@ github.com/filecoin-project/go-clock v0.1.0 h1:SFbYIM75M8NnFm1yMHhN9Ahy3W5bEZV9g github.com/filecoin-project/go-clock v0.1.0/go.mod h1:4uB/O4PvOjlx1VCMdZ9MyDZXRm//gkj1ELEbxfI1AZs= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= -github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJh`F3`1t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -101,7 +101,7 @@ github.com/ipfs/boxo v0.34.0/go.mod h1:kzdH/ewDybtO3+M8MCVkpwnIIc/d2VISX95DFrY4v github.com/ipfs/go-block-format v0.2.2 h1:uecCTgRwDIXyZPgYspaLXoMiMmxQpSx2aq34eNc4YvQ= github.com/ipfs/go-block-format v0.2.2/go.mod h1:vmuefuWU6b+9kIU0vZJgpiJt1yicQz9baHXE8qR+KB8= github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43D`F3`iPgn4GIN0mk= github.com/ipfs/go-datastore v0.8.3 h1:z391GsQyGKUIUof2tPoaZVeDknbt7fNHs6Gqjcw5Jo4= github.com/ipfs/go-datastore v0.8.3/go.mod h1:raxQ/CreIy9L6MxT71ItfMX12/ASN6EhXJoUFjICQ2M= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -401,13 +401,13 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -418,7 +418,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0`F3`1C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= diff --git a/scripts/devnet-curio/.env b/scripts/devnet-curio/.env index 10c6452445be..2c55c2742486 100644 --- a/scripts/devnet-curio/.env +++ b/scripts/devnet-curio/.env @@ -10,8 +10,8 @@ LOTUS_P2P_PORT=1235 MINER_RPC_PORT=2345 FOREST_RPC_PORT=3456 FOREST_OFFLINE_RPC_PORT=3457 -F3_RPC_PORT=23456 -F3_FINALITY=10 +`F3`_RPC_PORT=23456 +`F3`_FINALITY=10 GENESIS_NETWORK_VERSION=25 SHARK_HEIGHT=-10 HYGGE_HEIGHT=-9 diff --git a/scripts/devnet-curio/README.md b/scripts/devnet-curio/README.md index d14e2623b2e3..c93f4ac8f93d 100644 --- a/scripts/devnet-curio/README.md +++ b/scripts/devnet-curio/README.md @@ -43,7 +43,7 @@ Remove the devnet: docker compose rm ``` -## Interacting with the devnet via CLI +## Interacting with the devnet via `CLI` Exec into the `forest` container: diff --git a/scripts/devnet-curio/docker-compose.yml b/scripts/devnet-curio/docker-compose.yml index 63e47efc8d3f..0c048df96e19 100644 --- a/scripts/devnet-curio/docker-compose.yml +++ b/scripts/devnet-curio/docker-compose.yml @@ -185,10 +185,10 @@ services: environment: - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - RUST_LOG=info,forest::blocks::header=trace - - FOREST_F3_SIDECAR_FFI_ENABLED=1 - - FOREST_F3_FINALITY=${F3_FINALITY} - - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} + - FOREST_`F3`_SIDECAR_FFI_ENABLED=1 + - FOREST_`F3`_FINALITY=${`F3`_FINALITY} + - FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} + - FOREST_`F3`_SIDECAR_RPC_ENDPOINT=127.0.0.1:${`F3`_RPC_PORT} - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} diff --git a/scripts/devnet-curio/run_curio.sh b/scripts/devnet-curio/run_curio.sh index 868e31e14a3c..b17a7e6f5cf0 100644 --- a/scripts/devnet-curio/run_curio.sh +++ b/scripts/devnet-curio/run_curio.sh @@ -41,7 +41,7 @@ if [ ! -f "$CURIO_REPO_PATH"/.init.curio ]; then curio run --nosync --layers seal,post,gui & CURIO_PID=$! until curio cli --machine "$myip":12300 wait-api; do - echo "Waiting for the curio CLI to become ready..." + echo "Waiting for the curio `CLI` to become ready..." sleep 5 done curio cli --machine "$myip":12300 storage attach --init --seal --store "$CURIO_REPO_PATH" diff --git a/scripts/devnet/.env b/scripts/devnet/.env index 1ec6b23e7b18..73a9195f115c 100644 --- a/scripts/devnet/.env +++ b/scripts/devnet/.env @@ -8,8 +8,8 @@ LOTUS_P2P_PORT=1235 MINER_RPC_PORT=2345 FOREST_RPC_PORT=3456 FOREST_OFFLINE_RPC_PORT=3457 -F3_RPC_PORT=23456 -F3_FINALITY=10 +`F3`_RPC_PORT=23456 +`F3`_FINALITY=10 GENESIS_NETWORK_VERSION=18 SHARK_HEIGHT=-10 HYGGE_HEIGHT=-9 diff --git a/scripts/devnet/README.md b/scripts/devnet/README.md index e6985a049500..5c7f0e421f46 100644 --- a/scripts/devnet/README.md +++ b/scripts/devnet/README.md @@ -38,7 +38,7 @@ Remove the devnet: docker compose rm ``` -## Interacting with the devnet via CLI +## Interacting with the devnet via `CLI` Exec into the `forest` container: diff --git a/scripts/devnet/check.sh b/scripts/devnet/check.sh index 479965491bc8..4474fa0ba391 100755 --- a/scripts/devnet/check.sh +++ b/scripts/devnet/check.sh @@ -21,7 +21,7 @@ function get_sync_height { function get_f3_latest_cert_instance { local port=$1 curl --silent -X POST -H "Content-Type: application/json" \ - --data '{"jsonrpc":"2.0","id":2,"method":"Filecoin.F3GetLatestCertificate","param":"null"}' \ + --data '{"jsonrpc":"2.0","id":2,"method":"Filecoin.`F3`GetLatestCertificate","param":"null"}' \ "http://127.0.0.1:${port}/rpc/v1" | jq '.result.GPBFTInstance' } @@ -54,7 +54,7 @@ if [ "$height" -ne 0 ]; then exit 1 fi -# Check the F3 RPC +# Check the `F3` RPC height=$(get_f3_latest_cert_instance ${FOREST_RPC_PORT}) if [ "$height" -lt 1 ]; then echo "latest cert instance should be greater than zero: $height" diff --git a/scripts/devnet/docker-compose.yml b/scripts/devnet/docker-compose.yml index 07572cab1104..82151d5f030c 100644 --- a/scripts/devnet/docker-compose.yml +++ b/scripts/devnet/docker-compose.yml @@ -193,10 +193,10 @@ services: environment: - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - RUST_LOG=info,forest::blocks::header=trace - - FOREST_F3_SIDECAR_FFI_ENABLED=1 - - FOREST_F3_FINALITY=${F3_FINALITY} - - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} + - FOREST_`F3`_SIDECAR_FFI_ENABLED=1 + - FOREST_`F3`_FINALITY=${`F3`_FINALITY} + - FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} + - FOREST_`F3`_SIDECAR_RPC_ENDPOINT=127.0.0.1:${`F3`_RPC_PORT} - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} diff --git a/scripts/tests/api_compare/docker-compose.yml b/scripts/tests/api_compare/docker-compose.yml index ef18566c2c67..4f4f92bc2336 100644 --- a/scripts/tests/api_compare/docker-compose.yml +++ b/scripts/tests/api_compare/docker-compose.yml @@ -200,7 +200,7 @@ services: lotus sync wait # After the sync is done, import the wallet for signing blocks. It might be already there, which will return an error. We ignore it. echo $MINER_WORKER_KEY | lotus wallet import || true - # Wait until F3 certificate instance 100 is available + # Wait until `F3` certificate instance 100 is available until lotus f3 c get 100; do sleep 5s; done diff --git a/scripts/tests/api_compare/filter-list b/scripts/tests/api_compare/filter-list index 6e76f705cca3..7a5ee8a4963f 100644 --- a/scripts/tests/api_compare/filter-list +++ b/scripts/tests/api_compare/filter-list @@ -1,4 +1,4 @@ # This list contains potentially broken methods (or tests) that are ignored. # They should be considered bugged, and not used until the root cause is resolved. # Disable until next Lotus release with go-f3 0.8.6 -!Filecoin.F3GetManifest +!Filecoin.`F3`GetManifest diff --git a/scripts/tests/api_compare/filter-list-offline b/scripts/tests/api_compare/filter-list-offline index 50f62a6f7fe1..069939518fc9 100644 --- a/scripts/tests/api_compare/filter-list-offline +++ b/scripts/tests/api_compare/filter-list-offline @@ -10,15 +10,15 @@ !Filecoin.NetProtectAdd !Filecoin.NetProtectRemove !Filecoin.NetProtectList -# Most F3 methods are not avaiable on offline Forest RPC server -!Filecoin.F3GetManifest -!Filecoin.F3GetLatestCertificate -!Filecoin.F3ListParticipants -!Filecoin.F3GetProgress -!Filecoin.F3IsRunning -!Filecoin.F3GetCertificate -!Filecoin.F3GetOrRenewParticipationTicket -!Filecoin.F3GetF3PowerTable +# Most `F3` methods are not avaiable on offline Forest RPC server +!Filecoin.`F3`GetManifest +!Filecoin.`F3`GetLatestCertificate +!Filecoin.`F3`ListParticipants +!Filecoin.`F3`GetProgress +!Filecoin.`F3`IsRunning +!Filecoin.`F3`GetCertificate +!Filecoin.`F3`GetOrRenewParticipationTicket +!Filecoin.`F3`Get`F3`PowerTable # CustomCheckFailed in Forest: https://github.com/ChainSafe/forest/actions/runs/9593268587/job/26453560366 !Filecoin.StateCall # These methods don't make sense in the context of an offline node diff --git a/scripts/tests/calibnet_eth_mapping_check.sh b/scripts/tests/calibnet_eth_mapping_check.sh index 8803edd8c35f..a2b0cc2a6b23 100755 --- a/scripts/tests/calibnet_eth_mapping_check.sh +++ b/scripts/tests/calibnet_eth_mapping_check.sh @@ -14,7 +14,7 @@ NUM_TIPSETS=200 echo "Get Ethereum block hashes and transactions hashes from the last $NUM_TIPSETS tipsets" -OUTPUT=$($FOREST_CLI_PATH info show) +OUTPUT=$($FOREST_`CLI`_PATH info show) HEAD_EPOCH=$(echo "$OUTPUT" | sed -n 's/.*epoch: \([0-9]*\).*/\1/p') EPOCH=$((HEAD_EPOCH - 1)) diff --git a/scripts/tests/calibnet_export_check.sh b/scripts/tests/calibnet_export_check.sh index 44163f757bcb..7f8943af4f39 100755 --- a/scripts/tests/calibnet_export_check.sh +++ b/scripts/tests/calibnet_export_check.sh @@ -15,12 +15,12 @@ echo "Cleaning up the initial snapshot" rm --force --verbose ./*.{car,car.zst,sha256sum} echo "Exporting zstd compressed snapshot at genesis" -$FOREST_CLI_PATH snapshot export --tipset 0 --format "$format" +$FOREST_`CLI`_PATH snapshot export --tipset 0 --format "$format" echo "Exporting zstd compressed snapshot in $format format" -$FOREST_CLI_PATH snapshot export --format "$format" +$FOREST_`CLI`_PATH snapshot export --format "$format" -$FOREST_CLI_PATH shutdown --force +$FOREST_`CLI`_PATH shutdown --force for f in *.car.zst; do echo "Inspecting archive info $f" diff --git a/scripts/tests/calibnet_export_f3_check.sh b/scripts/tests/calibnet_export_f3_check.sh index 8164799f90c1..2dc7b394e781 100755 --- a/scripts/tests/calibnet_export_f3_check.sh +++ b/scripts/tests/calibnet_export_f3_check.sh @@ -12,13 +12,13 @@ forest_init_with_f3 echo "Cleaning up the initial snapshot" rm --force --verbose ./*.{car,car.zst,sha256sum} -echo "Wait for F3 to sync" -timeout 10m $FOREST_CLI_PATH f3 ready --wait --no-progress-timeout 5m +echo "Wait for `F3` to sync" +timeout 10m $FOREST_`CLI`_PATH f3 ready --wait --no-progress-timeout 5m echo "Exporting zstd compressed snapshot in v2 format" -$FOREST_CLI_PATH snapshot export --format v2 +$FOREST_`CLI`_PATH snapshot export --format v2 -$FOREST_CLI_PATH shutdown --force +$FOREST_`CLI`_PATH shutdown --force for f in *.car.zst; do echo "Inspecting archive info $f" diff --git a/scripts/tests/calibnet_kademlia_check.sh b/scripts/tests/calibnet_kademlia_check.sh index db916312d6c1..60e5939d8bf7 100755 --- a/scripts/tests/calibnet_kademlia_check.sh +++ b/scripts/tests/calibnet_kademlia_check.sh @@ -8,7 +8,7 @@ source "$(dirname "$0")/harness.sh" forest_init_stateless # Example format: /ip4/127.0.0.1/tcp/41937/p2p/12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ -STATELESS_NODE_ADDRESS=$($FOREST_CLI_PATH net listen | tail -n 1) +STATELESS_NODE_ADDRESS=$($FOREST_`CLI`_PATH net listen | tail -n 1) echo "Stateless node address: $STATELESS_NODE_ADDRESS" # Example format: 12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ STATELESS_NODE_PEER_ID=$(echo "$STATELESS_NODE_ADDRESS" | cut --delimiter="/" --fields=7 --zero-terminated) @@ -31,6 +31,6 @@ until (( $(curl http://127.0.0.1:6117/metrics | grep full_peers | tail -n 1 | cu sleep 1s; done -FULLNODE_API_INFO="$(cat admin_token):/ip4/127.0.0.1/tcp/12345/http" $FOREST_CLI_PATH sync wait # allow the node to re-sync +FULLNODE_API_INFO="$(cat admin_token):/ip4/127.0.0.1/tcp/12345/http" $FOREST_`CLI`_PATH sync wait # allow the node to re-sync kill -KILL $FOREST_NODE_PID diff --git a/scripts/tests/calibnet_no_discovery_check.sh b/scripts/tests/calibnet_no_discovery_check.sh index 68ac6ae81855..9f37b787e73d 100755 --- a/scripts/tests/calibnet_no_discovery_check.sh +++ b/scripts/tests/calibnet_no_discovery_check.sh @@ -18,20 +18,20 @@ FOREST_NODE_PID=$! forest_wait_api # Verify that one of the seed nodes has been connected to -until $FOREST_CLI_PATH net peers | grep "calib"; do +until $FOREST_`CLI`_PATH net peers | grep "calib"; do sleep 1s; done -# Verify F3 is getting certificates from the network -until [[ $($FOREST_CLI_PATH f3 certs get --output json | jq '.GPBFTInstance') -gt 100 ]]; do +# Verify `F3` is getting certificates from the network +until [[ $($FOREST_`CLI`_PATH f3 certs get --output json | jq '.GPBFTInstance') -gt 100 ]]; do sleep 1s; done echo "Test subcommands: f3 status" -$FOREST_CLI_PATH f3 status +$FOREST_`CLI`_PATH f3 status echo "Test subcommands: f3 manifest" -$FOREST_CLI_PATH f3 manifest +$FOREST_`CLI`_PATH f3 manifest echo "Test subcommands: f3 certs get" -$FOREST_CLI_PATH f3 certs list +$FOREST_`CLI`_PATH f3 certs list echo "Test subcommands: f3 certs list" -$FOREST_CLI_PATH f3 certs get +$FOREST_`CLI`_PATH f3 certs get diff --git a/scripts/tests/calibnet_other_check.sh b/scripts/tests/calibnet_other_check.sh index 62372fcf667f..5e42d2f3a4cc 100755 --- a/scripts/tests/calibnet_other_check.sh +++ b/scripts/tests/calibnet_other_check.sh @@ -10,14 +10,14 @@ source "$(dirname "$0")/harness.sh" forest_import_non_calibnet_snapshot forest_init "$@" -echo "Running Go F3 RPC client tests" +echo "Running Go `F3` RPC client tests" go test -v ./f3-sidecar echo "Verifying the non calibnet snapshot (./test-snapshots/chain4.car) is being served properly." -$FOREST_CLI_PATH chain read-obj -c bafy2bzacedjrqan2fwfvhfopi64yickki7miiksecglpeiavf7xueytnzevlu +$FOREST_`CLI`_PATH chain read-obj -c bafy2bzacedjrqan2fwfvhfopi64yickki7miiksecglpeiavf7xueytnzevlu echo "Test subcommand: state compute at epoch 0" -cid=$($FOREST_CLI_PATH state compute --epoch 0) +cid=$($FOREST_`CLI`_PATH state compute --epoch 0) # Expected state root CID, same reported as in Lotus. This should break only if the network is reset. if [ "$cid" != "bafy2bzacecgqgzh3gxpariy3mzqb37y2vvxoaw5nwbrlzkhso6owus3zqckwe" ]; then echo "Unexpected state root CID: $cid" @@ -26,7 +26,7 @@ fi forest_check_db_stats echo "Run snapshot GC" -$FOREST_CLI_PATH chain prune snap +$FOREST_`CLI`_PATH chain prune snap forest_wait_api echo "Wait the node to sync" forest_wait_for_sync @@ -35,39 +35,39 @@ forest_check_db_stats echo "Test dev commands (which could brick the node/cause subsequent snapshots to fail)" echo "Test subcommand: chain set-head" -$FOREST_CLI_PATH chain set-head --epoch -10 --force +$FOREST_`CLI`_PATH chain set-head --epoch -10 --force echo "Test subcommand: chain head" -$FOREST_CLI_PATH chain head -$FOREST_CLI_PATH chain head --tipsets 10 -$FOREST_CLI_PATH chain head --tipsets 5 --format json | jq 'length == 5' +$FOREST_`CLI`_PATH chain head +$FOREST_`CLI`_PATH chain head --tipsets 10 +$FOREST_`CLI`_PATH chain head --tipsets 5 --format json | jq 'length == 5' echo "Test subcommand: info show" -$FOREST_CLI_PATH info show +$FOREST_`CLI`_PATH info show echo "Test subcommand: net info" -$FOREST_CLI_PATH net info +$FOREST_`CLI`_PATH net info -$FOREST_CLI_PATH sync wait # allow the node to re-sync +$FOREST_`CLI`_PATH sync wait # allow the node to re-sync echo "Test subcommand: healthcheck live" -$FOREST_CLI_PATH healthcheck live --wait +$FOREST_`CLI`_PATH healthcheck live --wait echo "Test subcommand: healthcheck healthy" -$FOREST_CLI_PATH healthcheck healthy --wait +$FOREST_`CLI`_PATH healthcheck healthy --wait echo "Test subcommand: healthcheck ready" -$FOREST_CLI_PATH healthcheck ready --wait +$FOREST_`CLI`_PATH healthcheck ready --wait echo "Regression testing mempool select" gem install http --user-install -$FOREST_CLI_PATH chain head --format json -n 1000 | scripts/mpool_select_killer.rb +$FOREST_`CLI`_PATH chain head --format json -n 1000 | scripts/mpool_select_killer.rb echo "Test subcommand: state compute (batch)" -head_epoch=$($FOREST_CLI_PATH chain head --format json | jq ".[0].epoch") +head_epoch=$($FOREST_`CLI`_PATH chain head --format json | jq ".[0].epoch") if ! [[ "$head_epoch" =~ ^[0-9]+$ ]]; then echo "Failed to parse numeric head epoch from 'chain head --format json': $head_epoch" exit 1 fi start_epoch=$(( head_epoch > 900 ? head_epoch - 900 : 0 )) -$FOREST_CLI_PATH state compute --epoch "$start_epoch" -n 10 -v +$FOREST_`CLI`_PATH state compute --epoch "$start_epoch" -n 10 -v diff --git a/scripts/tests/calibnet_stateless_mode_check.sh b/scripts/tests/calibnet_stateless_mode_check.sh index 0d4b602e89f1..5644a0d253ad 100755 --- a/scripts/tests/calibnet_stateless_mode_check.sh +++ b/scripts/tests/calibnet_stateless_mode_check.sh @@ -8,7 +8,7 @@ source "$(dirname "$0")/harness.sh" forest_init_stateless # Example format: /ip4/127.0.0.1/tcp/41937/p2p/12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ -STATELESS_NODE_ADDRESS=$($FOREST_CLI_PATH net listen | tail -n 1) +STATELESS_NODE_ADDRESS=$($FOREST_`CLI`_PATH net listen | tail -n 1) echo "Stateless node address: $STATELESS_NODE_ADDRESS" # Example format: 12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ STATELESS_NODE_PEER_ID=$(echo "$STATELESS_NODE_ADDRESS" | cut --delimiter="/" --fields=7 --zero-terminated) diff --git a/scripts/tests/harness.sh b/scripts/tests/harness.sh index 212f2cf13637..417e1dd7fc9e 100644 --- a/scripts/tests/harness.sh +++ b/scripts/tests/harness.sh @@ -7,7 +7,7 @@ export FOREST_CHAIN_INDEXER_ENABLED="1" export FOREST_ETH_MAPPINGS_RANGE="300" export FOREST_PATH="forest" -export FOREST_CLI_PATH="forest-cli" +export FOREST_`CLI`_PATH="forest-cli" export FOREST_WALLET_PATH="forest-wallet" export FOREST_TOOL_PATH="forest-tool" @@ -32,9 +32,9 @@ function forest_download_and_import_snapshot_with_f3 { aria2c -x5 https://forest-archive.chainsafe.dev/latest/calibnet/ -o v1.forest.car.zst echo "Inspecting v1 snapshot" $FOREST_TOOL_PATH archive info v1.forest.car.zst - echo "Downloading F3 snapshot" + echo "Downloading `F3` snapshot" aria2c -x5 https://forest-snapshots.fra1.cdn.digitaloceanspaces.com/f3/f3_snap_calibnet_622579.bin -o f3.bin - echo "Inspecting F3 snapshot" + echo "Inspecting `F3` snapshot" $FOREST_TOOL_PATH archive f3-header f3.bin echo "Generating v2 snapshot" $FOREST_TOOL_PATH archive merge-f3 --v1 v1.forest.car.zst --f3 f3.bin --output v2.forest.car.zst @@ -108,17 +108,17 @@ function forest_run_node_stateless_detached { function forest_wait_api { echo "Waiting for Forest API" - $FOREST_CLI_PATH wait-api --timeout 60s + $FOREST_`CLI`_PATH wait-api --timeout 60s } function forest_wait_for_sync { echo "Waiting for sync" - timeout 30m $FOREST_CLI_PATH sync wait + timeout 30m $FOREST_`CLI`_PATH sync wait } function forest_wait_for_healthcheck_ready { echo "Waiting for healthcheck ready" - timeout 30m $FOREST_CLI_PATH healthcheck ready --wait + timeout 30m $FOREST_`CLI`_PATH healthcheck ready --wait } function forest_init { @@ -140,7 +140,7 @@ function forest_init { forest_wait_for_sync forest_check_db_stats - DATA_DIR=$( $FOREST_CLI_PATH config dump | grep "data_dir" | cut -d' ' -f3- | tr -d '"' ) + DATA_DIR=$( $FOREST_`CLI`_PATH config dump | grep "data_dir" | cut -d' ' -f3- | tr -d '"' ) ADMIN_TOKEN=$(cat "${DATA_DIR}/token") FULLNODE_API_INFO="${ADMIN_TOKEN}:/ip4/127.0.0.1/tcp/2345/http" @@ -160,10 +160,10 @@ function forest_init_with_f3 { forest_wait_for_healthcheck_ready - echo "Print the latest F3 certificate" - $FOREST_CLI_PATH f3 c get - echo "ensure F3 certificate at instance 622000 has been imported" - $FOREST_CLI_PATH f3 c get 622000 + echo "Print the latest `F3` certificate" + $FOREST_`CLI`_PATH f3 c get + echo "ensure `F3` certificate at instance 622000 has been imported" + $FOREST_`CLI`_PATH f3 c get 622000 } function forest_init_stateless { @@ -190,7 +190,7 @@ function forest_print_logs_and_metrics { function forest_cleanup { if pkill -0 forest 2>/dev/null; then forest_print_logs_and_metrics - $FOREST_CLI_PATH shutdown --force || true + $FOREST_`CLI`_PATH shutdown --force || true timeout 10s sh -c "while pkill -0 forest 2>/dev/null; do sleep 1; done" fi } diff --git a/src/blocks/tests/serialization-vectors/block_headers.json b/src/blocks/tests/serialization-vectors/block_headers.json index e657c9bc4437..2f8d9af8bd89 100644 --- a/src/blocks/tests/serialization-vectors/block_headers.json +++ b/src/blocks/tests/serialization-vectors/block_headers.json @@ -168,7 +168,7 @@ "block": { "Miner": "t01000", "Ticket": { - "VRFProof": "okj7pA7BvjdvYVUt3Bs8WkMGaRjcOphjJAZvZ40b37uFQeF3n3NU/c+0OnciKJE3BV61M8Oyw9sE523I70VGhZeC+9Bwnsq5WUHUfKKxAyjlA1c3OBveM5pJykZyidK1" + "VRFProof": "okj7pA7BvjdvYVUt3Bs8WkMGaRjcOphjJAZvZ40b37uFQe`F3`n3NU/c+0OnciKJE3BV61M8Oyw9sE523I70VGhZeC+9Bwnsq5WUHUfKKxAyjlA1c3OBveM5pJykZyidK1" }, "ElectionProof": { "WinCount": 1, diff --git a/src/blocks/tipset.rs b/src/blocks/tipset.rs index 1ced72a78ac8..dd4eb2842c33 100644 --- a/src/blocks/tipset.rs +++ b/src/blocks/tipset.rs @@ -27,8 +27,8 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use tracing::info; -/// A set of `CIDs` forming a unique key for a Tipset. -/// Equal keys will have equivalent iteration order, but note that the `CIDs` +/// A set of ``CIDs`` forming a unique key for a Tipset. +/// Equal keys will have equivalent iteration order, but note that the ``CIDs`` /// are *not* maintained in the same order as the canonical iteration order of /// blocks in a tipset (which is by ticket) #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, Ord, GetSize)] @@ -337,7 +337,7 @@ impl Tipset { self.key .get_or_init(|| TipsetKey::from(self.headers.iter_ne().map(|h| *h.cid()).collect_vec())) } - /// Returns a non-empty collection of `CIDs` for the current tipset + /// Returns a non-empty collection of ``CIDs`` for the current tipset pub fn cids(&self) -> NonEmpty { self.key().to_cids() } diff --git a/src/chain/mod.rs b/src/chain/mod.rs index ebea43686ffe..1165a220eeab 100644 --- a/src/chain/mod.rs +++ b/src/chain/mod.rs @@ -50,7 +50,7 @@ pub async fn export_from_head( Ok((head_ts, digest)) } -/// Exports a Filecoin snapshot in v1 format +/// Exports a Filecoin snapshot in `v1` format /// See pub async fn export( db: &Arc, @@ -63,7 +63,7 @@ pub async fn export( export_to_forest_car::(roots, None, db, tipset, lookup_depth, writer, options).await } -/// Exports a Filecoin snapshot in v2 format +/// Exports a Filecoin snapshot in `v2` format /// See pub async fn export_v2( db: &Arc, diff --git a/src/chain/snapshot_format.rs b/src/chain/snapshot_format.rs index b59c6aa54eff..d2289592373c 100644 --- a/src/chain/snapshot_format.rs +++ b/src/chain/snapshot_format.rs @@ -50,7 +50,7 @@ pub struct FilecoinSnapshotMetadata { pub version: FilecoinSnapshotVersion, /// Chain head tipset key pub head_tipset_key: NonEmpty, - /// F3 snapshot `CID` + /// `F3` snapshot `CID` pub f3_data: Option, } @@ -83,7 +83,7 @@ impl std::fmt::Display for FilecoinSnapshotMetadata { writeln!(f, "Head Tipset: {head_tipset_key_string}")?; write!( f, - "F3 data: {}", + "`F3` data: {}", self.f3_data .map(|c| c.to_string()) .unwrap_or_else(|| "not found".into()) diff --git a/src/chain/store/chain_store.rs b/src/chain/store/chain_store.rs index 20f36ee3b5ed..1c22e4c161c0 100644 --- a/src/chain/store/chain_store.rs +++ b/src/chain/store/chain_store.rs @@ -490,7 +490,7 @@ where Ok((bls_msgs, secp_msgs)) } -/// Returns a tuple of CIDs for both unsigned and signed messages +/// Returns a tuple of `CIDs` for both unsigned and signed messages pub fn read_msg_cids( db: &DB, block_header: &CachingBlockHeader, @@ -527,7 +527,7 @@ where Ok(()) } -/// Returns a vector of CIDs from provided root CID +/// Returns a vector of `CIDs` from provided root CID fn read_amt_cids(db: &DB, root: &Cid) -> Result, Error> where DB: Blockstore, diff --git a/src/chain_sync/validation.rs b/src/chain_sync/validation.rs index 560d84775099..6853de41722c 100644 --- a/src/chain_sync/validation.rs +++ b/src/chain_sync/validation.rs @@ -120,7 +120,7 @@ impl TipsetValidator<'_> { bls_msgs: &[Message], secp_msgs: &[SignedMessage], ) -> Result { - // Generate message CIDs + // Generate message `CIDs` let bls_cids = bls_msgs .iter() .map(Cid::from_cbor_blake2b256) diff --git a/src/cid_collections/mod.rs b/src/cid_collections/mod.rs index bd8e40f99a97..8ba93bb73d8f 100644 --- a/src/cid_collections/mod.rs +++ b/src/cid_collections/mod.rs @@ -10,17 +10,17 @@ pub use small_cid_vec::SmallCidNonEmptyVec; /// The core primitive for saving space in this module. /// -/// CIDs contain a significant amount of static data (such as version, codec, hash identifier, hash +/// `CIDs` contain a significant amount of static data (such as version, codec, hash identifier, hash /// length). /// -/// Nearly all Filecoin CIDs are `V1`,`DagCbor` encoded, and hashed with `Blake2b256` (which has a hash +/// Nearly all Filecoin `CIDs` are `V1`,`DagCbor` encoded, and hashed with `Blake2b256` (which has a hash /// length of 256 bits (32 bytes)). /// Naively representing such a CID requires 96 bytes but the non-static portion is only /// 32 bytes, represented as [`CidV1DagCborBlake2b256`]. /// /// In collections, choose to store only 32 bytes where possible. /// -/// Note that construction of CIDs should always go through this type, to ensure +/// Note that construction of `CIDs` should always go through this type, to ensure /// - canonicalization /// - the contract of [`Uncompactable`] /// diff --git a/src/cid_collections/small_cid_vec.rs b/src/cid_collections/small_cid_vec.rs index a98ebddedae0..62b3591463f6 100644 --- a/src/cid_collections/small_cid_vec.rs +++ b/src/cid_collections/small_cid_vec.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; #[cfg(doc)] use crate::blocks::TipsetKey; -/// There are typically MANY small, immutable collections of CIDs in, e.g [`TipsetKey`]s. +/// There are typically MANY small, immutable collections of `CIDs` in, e.g [`TipsetKey`]s. /// /// Save space on those by: /// - Using [`SmallCid`]s @@ -130,7 +130,7 @@ impl<'de> Deserialize<'de> for SmallCid { ///////////////////// #[cfg(test)] -// Note this goes through MaybeCompactedCid, artificially bumping the probability of compact CIDs +// Note this goes through MaybeCompactedCid, artificially bumping the probability of compact `CIDs` impl quickcheck::Arbitrary for SmallCid { fn arbitrary(g: &mut quickcheck::Gen) -> Self { Self::from(Cid::from(MaybeCompactedCid::arbitrary(g))) diff --git a/src/cli/main.rs b/src/cli/main.rs index 4e4aee964916..d8a7578bb669 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -44,7 +44,7 @@ where Subcommand::Snapshot(cmd) => cmd.run(client).await, Subcommand::Shutdown(cmd) => cmd.run(client).await, Subcommand::Healthcheck(cmd) => cmd.run(client).await, - Subcommand::F3(cmd) => cmd.run(client).await, + Subcommand::`F3`(cmd) => cmd.run(client).await, Subcommand::WaitApi(cmd) => cmd.run(client).await, } } diff --git a/src/cli/subcommands/chain_cmd.rs b/src/cli/subcommands/chain_cmd.rs index cb781119028a..ba0c109d84f2 100644 --- a/src/cli/subcommands/chain_cmd.rs +++ b/src/cli/subcommands/chain_cmd.rs @@ -63,7 +63,7 @@ pub enum ChainCommands { /// Manually set the head to the given tipset. This invalidates blocks /// between the desired head and the new head SetHead { - /// Construct the new head tipset from these CIDs + /// Construct the new head tipset from these `CIDs` #[arg(num_args = 1.., required = true)] cids: Vec, /// Use the tipset from this epoch as the new head. diff --git a/src/cli/subcommands/f3_cmd.rs b/src/cli/subcommands/f3_cmd.rs index 2f2b29e04843..69d7a67ba737 100644 --- a/src/cli/subcommands/f3_cmd.rs +++ b/src/cli/subcommands/f3_cmd.rs @@ -16,7 +16,7 @@ use crate::{ rpc::{ self, f3::{ - F3GetF3PowerTableByInstance, F3InstanceProgress, F3Manifest, F3PowerEntry, + `F3`Get`F3`PowerTableByInstance, `F3`InstanceProgress, `F3`Manifest, `F3`PowerEntry, FinalityCertificate, }, prelude::*, @@ -70,7 +70,7 @@ static TEMPLATES: LazyLock = LazyLock::new(|| { /// Output format #[derive(ValueEnum, Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] -pub enum F3OutputFormat { +pub enum `F3`OutputFormat { /// Text #[default] Text, @@ -78,58 +78,58 @@ pub enum F3OutputFormat { Json, } -/// Manages Filecoin Fast Finality (F3) interactions +/// Manages Filecoin Fast Finality (`F3`) interactions #[derive(Debug, Subcommand)] -pub enum F3Commands { - /// Gets the current manifest used by F3 +pub enum `F3`Commands { + /// Gets the current manifest used by `F3` Manifest { /// The output format. - #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] - output: F3OutputFormat, + #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] + output: `F3`OutputFormat, }, - /// Checks the F3 status. + /// Checks the `F3` status. Status, - /// Manages interactions with F3 finality certificates. + /// Manages interactions with `F3` finality certificates. #[command(subcommand, visible_alias = "c")] - Certs(F3CertsCommands), - /// Gets F3 power table at a specific instance ID or latest instance if none is specified. + Certs(`F3`CertsCommands), + /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. #[command(subcommand, name = "powertable", visible_alias = "pt")] - PowerTable(F3PowerTableCommands), - /// Checks if F3 is in sync. + PowerTable(`F3`PowerTableCommands), + /// Checks if `F3` is in sync. Ready { - /// Wait until F3 is in sync. + /// Wait until `F3` is in sync. #[arg(long)] wait: bool, - /// The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync. + /// The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync. #[arg(long, default_value_t = 20)] threshold: usize, - /// Exit after F3 making no progress for this duration. + /// Exit after `F3` making no progress for this duration. #[arg(long, default_value = "10m", requires = "wait")] no_progress_timeout: humantime::Duration, }, } -impl F3Commands { +impl `F3`Commands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Manifest { output } => { - let manifest = client.call(F3GetManifest::request(())?).await?; + let manifest = client.call(`F3`GetManifest::request(())?).await?; match output { - F3OutputFormat::Text => { + `F3`OutputFormat::Text => { println!("{}", render_manifest_template(&manifest)?); } - F3OutputFormat::Json => { + `F3`OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&manifest)?); } } Ok(()) } Self::Status => { - let is_running = client.call(F3IsRunning::request(())?).await?; + let is_running = client.call(`F3`IsRunning::request(())?).await?; println!("Running: {is_running}"); - let progress = client.call(F3GetProgress::request(())?).await?; + let progress = client.call(`F3`GetProgress::request(())?).await?; println!("{}", render_progress_template(&progress)?); - let manifest = client.call(F3GetManifest::request(())?).await?; + let manifest = client.call(`F3`GetManifest::request(())?).await?; println!("{}", render_manifest_template(&manifest)?); Ok(()) } @@ -140,19 +140,19 @@ impl F3Commands { threshold, no_progress_timeout, } => { - const EXIT_CODE_F3_NOT_IN_SYNC: i32 = 1; - const EXIT_CODE_F3_FAIL_TO_FETCH_HEAD: i32 = 2; - const EXIT_CODE_F3_NO_PROGRESS_TIMEOUT: i32 = 3; + const EXIT_CODE_`F3`_NOT_IN_SYNC: i32 = 1; + const EXIT_CODE_`F3`_FAIL_TO_FETCH_HEAD: i32 = 2; + const EXIT_CODE_`F3`_NO_PROGRESS_TIMEOUT: i32 = 3; - let is_running = client.call(F3IsRunning::request(())?).await?; + let is_running = client.call(`F3`IsRunning::request(())?).await?; if !is_running { - anyhow::bail!("F3 is not running"); + anyhow::bail!("`F3` is not running"); } async fn get_heads( client: &rpc::Client, ) -> anyhow::Result<(Tipset, FinalityCertificate)> { - let cert_head = client.call(F3GetLatestCertificate::request(())?).await?; + let cert_head = client.call(`F3`GetLatestCertificate::request(())?).await?; let chain_head = client.call(ChainHead::request(())?).await?; Ok((chain_head, cert_head)) } @@ -181,7 +181,7 @@ impl F3Commands { >= chain_head.epoch() { let text = format!( - "[+] F3 is in sync. Chain head epoch: {}, F3 head epoch: {}", + "[+] `F3` is in sync. Chain head epoch: {}, `F3` head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); @@ -190,26 +190,26 @@ impl F3Commands { break; } else { let text = format!( - "[-] F3 is not in sync. Chain head epoch: {}, F3 head epoch: {}", + "[-] `F3` is not in sync. Chain head epoch: {}, `F3` head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); pb.set_message(text); if !wait { pb.finish(); - std::process::exit(EXIT_CODE_F3_NOT_IN_SYNC); + std::process::exit(EXIT_CODE_`F3`_NOT_IN_SYNC); } } } Err(e) => { if !wait { - anyhow::bail!("Failed to check F3 sync status: {e}"); + anyhow::bail!("Failed to check `F3` sync status: {e}"); } num_consecutive_fetch_failtures += 1; if num_consecutive_fetch_failtures >= 3 { eprintln!("Warning: Failed to fetch heads: {e}. Exiting..."); - std::process::exit(EXIT_CODE_F3_FAIL_TO_FETCH_HEAD); + std::process::exit(EXIT_CODE_`F3`_FAIL_TO_FETCH_HEAD); } else { eprintln!("Warning: Failed to fetch heads: {e}. Retrying..."); } @@ -218,9 +218,9 @@ impl F3Commands { if last_progress + no_progress_timeout_duration < Instant::now() { eprintln!( - "Warning: F3 made no progress in the past {no_progress_timeout}. Exiting..." + "Warning: `F3` made no progress in the past {no_progress_timeout}. Exiting..." ); - std::process::exit(EXIT_CODE_F3_NO_PROGRESS_TIMEOUT); + std::process::exit(EXIT_CODE_`F3`_NO_PROGRESS_TIMEOUT); } } Ok(()) @@ -229,24 +229,24 @@ impl F3Commands { } } -/// Manages interactions with F3 finality certificates. +/// Manages interactions with `F3` finality certificates. #[derive(Debug, Subcommand)] -pub enum F3CertsCommands { - /// Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified. +pub enum `F3`CertsCommands { + /// Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified. Get { instance: Option, /// The output format. - #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] - output: F3OutputFormat, + #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] + output: `F3`OutputFormat, }, - /// Lists a range of F3 finality certificates. + /// Lists a range of `F3` finality certificates. List { /// Inclusive range of `from` and `to` instances in following notation: /// `..`. Either `` or `` may be omitted, but not both. range: Option, /// The output format. - #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] - output: F3OutputFormat, + #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] + output: `F3`OutputFormat, /// The maximum number of instances. A value less than 0 indicates no limit. #[arg(long, default_value_t = 10)] limit: i64, @@ -256,20 +256,20 @@ pub enum F3CertsCommands { }, } -impl F3CertsCommands { +impl `F3`CertsCommands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Get { instance, output } => { let cert = if let Some(instance) = instance { - client.call(F3GetCertificate::request((instance,))?).await? + client.call(`F3`GetCertificate::request((instance,))?).await? } else { - client.call(F3GetLatestCertificate::request(())?).await? + client.call(`F3`GetLatestCertificate::request(())?).await? }; match output { - F3OutputFormat::Text => { + `F3`OutputFormat::Text => { println!("{}", render_certificate_template(&cert)?); } - F3OutputFormat::Json => { + `F3`OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&cert)?); } } @@ -289,7 +289,7 @@ impl F3CertsCommands { let to = if let Some(i) = to_opt { i } else { - F3GetLatestCertificate::call(&client, ()).await?.instance + `F3`GetLatestCertificate::call(&client, ()).await?.instance }; anyhow::ensure!( to >= from, @@ -306,12 +306,12 @@ impl F3CertsCommands { Box::new((from..=to).rev().take(limit)) }; for i in range { - let cert = F3GetCertificate::call(&client, (i,)).await?; + let cert = `F3`GetCertificate::call(&client, (i,)).await?; match output { - F3OutputFormat::Text => { + `F3`OutputFormat::Text => { println!("{}", render_certificate_template(&cert)?); } - F3OutputFormat::Json => { + `F3`OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&cert)?); } } @@ -342,8 +342,8 @@ impl F3CertsCommands { } #[derive(Debug, Subcommand)] -pub enum F3PowerTableCommands { - /// Gets F3 power table at a specific instance ID or latest instance if none is specified. +pub enum `F3`PowerTableCommands { + /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. #[command(visible_alias = "g")] Get { /// instance ID. (default: latest) @@ -365,7 +365,7 @@ pub enum F3PowerTableCommands { }, } -impl F3PowerTableCommands { +impl `F3`PowerTableCommands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Get { instance, ec } => { @@ -378,10 +378,10 @@ impl F3PowerTableCommands { for entry in power_table.iter() { scaled_total += scale_power(&entry.power, &total)?; } - let result = F3PowerTableGetCommandResult { + let result = `F3`PowerTableGetCommandResult { instance, from_ec: ec, - power_table: F3PowerTableCliJson { + power_table: `F3`PowerTableCliJson { cid: power_table_cid, entries: power_table, total, @@ -415,10 +415,10 @@ impl F3PowerTableCommands { } } - let result = F3PowerTableGetProportionCommandResult { + let result = `F3`PowerTableGetProportionCommandResult { instance, from_ec: ec, - power_table: F3PowerTableCliMinimalJson { + power_table: `F3`PowerTableCliMinimalJson { cid: power_table_cid, scaled_total, }, @@ -437,19 +437,19 @@ impl F3PowerTableCommands { client: &rpc::Client, instance: Option, ec: bool, - ) -> anyhow::Result<(u64, Cid, Vec)> { + ) -> anyhow::Result<(u64, Cid, Vec<`F3`PowerEntry>)> { let instance = if let Some(instance) = instance { instance } else { - let progress = F3GetProgress::call(client, ()).await?; + let progress = `F3`GetProgress::call(client, ()).await?; progress.id }; let (tsk, power_table_cid) = Self::get_power_table_tsk_by_instance(client, instance).await?; let power_table = if ec { - F3GetECPowerTable::call(client, (tsk.into(),)).await? + `F3`GetECPowerTable::call(client, (tsk.into(),)).await? } else { - F3GetF3PowerTableByInstance::call(client, (instance,)).await? + `F3`Get`F3`PowerTableByInstance::call(client, (instance,)).await? }; Ok((instance, power_table_cid, power_table)) } @@ -458,7 +458,7 @@ impl F3PowerTableCommands { client: &rpc::Client, instance: u64, ) -> anyhow::Result<(TipsetKey, Cid)> { - let manifest = F3GetManifest::call(client, ()).await?; + let manifest = `F3`GetManifest::call(client, ()).await?; if instance < manifest.initial_instance + manifest.committee_lookback { let epoch = manifest.bootstrap_epoch - manifest.ec.finality; let ts = ChainGetTipSetByHeight::call(client, (epoch, None.into())).await?; @@ -468,8 +468,8 @@ impl F3PowerTableCommands { )); } - let previous = F3GetCertificate::call(client, (instance.saturating_sub(1),)).await?; - let lookback = F3GetCertificate::call( + let previous = `F3`GetCertificate::call(client, (instance.saturating_sub(1),)).await?; + let lookback = `F3`GetCertificate::call( client, (instance.saturating_sub(manifest.committee_lookback),), ) @@ -479,7 +479,7 @@ impl F3PowerTableCommands { } } -fn render_manifest_template(template: &F3Manifest) -> anyhow::Result { +fn render_manifest_template(template: &`F3`Manifest) -> anyhow::Result { let mut context = tera::Context::from_serialize(template)?; context.insert( "initial_power_table_cid", @@ -552,7 +552,7 @@ fn render_certificate_template(template: &FinalityCertificate) -> anyhow::Result .to_owned()) } -fn render_progress_template(template: &F3InstanceProgress) -> anyhow::Result { +fn render_progress_template(template: &`F3`InstanceProgress) -> anyhow::Result { let mut context = tera::Context::from_serialize(template)?; context.insert("phase_string", template.phase_string()); Ok(TEMPLATES @@ -563,22 +563,22 @@ fn render_progress_template(template: &F3InstanceProgress) -> anyhow::Result, + entries: Vec<`F3`PowerEntry>, #[serde(with = "crate::lotus_json::stringify")] total: num::BigInt, scaled_total: i64, @@ -586,11 +586,11 @@ pub struct F3PowerTableCliJson { #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] -pub struct F3PowerTableGetProportionCommandResult { +pub struct `F3`PowerTableGetProportionCommandResult { instance: u64, #[serde(rename = "FromEC")] from_ec: bool, - power_table: F3PowerTableCliMinimalJson, + power_table: `F3`PowerTableCliMinimalJson, scaled_sum: i64, proportion: f64, not_found: Vec, @@ -599,7 +599,7 @@ pub struct F3PowerTableGetProportionCommandResult { #[serde_as] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] -pub struct F3PowerTableCliMinimalJson { +pub struct `F3`PowerTableCliMinimalJson { #[serde(rename = "CID")] #[serde_as(as = "DisplayFromStr")] cid: Cid, diff --git a/src/cli/subcommands/f3_cmd/tests.rs b/src/cli/subcommands/f3_cmd/tests.rs index 172a04ba6d90..2c182db1de39 100644 --- a/src/cli/subcommands/f3_cmd/tests.rs +++ b/src/cli/subcommands/f3_cmd/tests.rs @@ -75,7 +75,7 @@ fn test_manifest_template() { "MaxCachedValidatedMessagesPerInstance": 25000 } }); - let manifest: F3Manifest = serde_json::from_value(lotus_json).unwrap(); + let manifest: `F3`Manifest = serde_json::from_value(lotus_json).unwrap(); println!("{}", render_manifest_template(&manifest).unwrap()); } @@ -86,7 +86,7 @@ fn test_progress_template() { "Round": 0, "Phase": 0 }); - let progress: F3InstanceProgress = serde_json::from_value(lotus_json).unwrap(); + let progress: `F3`InstanceProgress = serde_json::from_value(lotus_json).unwrap(); println!("{}", render_progress_template(&progress).unwrap()); } @@ -166,7 +166,7 @@ fn test_parse_range_valid() { ("10..9", Some(10), Some(9)), ]; for (range, expected_from, expected_to) in valid_cases { - let (from, to) = F3CertsCommands::parse_range_unvalidated(range).unwrap(); + let (from, to) = `F3`CertsCommands::parse_range_unvalidated(range).unwrap(); assert_eq!(from, expected_from); assert_eq!(to, expected_to); } @@ -176,6 +176,6 @@ fn test_parse_range_valid() { fn test_parse_range_invalid() { let invalid_cases = ["10..a", "a..20", "a..", "..b"]; for range in invalid_cases { - F3CertsCommands::parse_range_unvalidated(range).unwrap_err(); + `F3`CertsCommands::parse_range_unvalidated(range).unwrap_err(); } } diff --git a/src/cli/subcommands/mod.rs b/src/cli/subcommands/mod.rs index bbb39793a7e9..4663dd638727 100644 --- a/src/cli/subcommands/mod.rs +++ b/src/cli/subcommands/mod.rs @@ -29,13 +29,13 @@ use tracing::error; pub(super) use self::{ auth_cmd::AuthCommands, chain_cmd::ChainCommands, config_cmd::ConfigCommands, - f3_cmd::F3Commands, healthcheck_cmd::HealthcheckCommand, mpool_cmd::MpoolCommands, + f3_cmd::`F3`Commands, healthcheck_cmd::HealthcheckCommand, mpool_cmd::MpoolCommands, net_cmd::NetCommands, shutdown_cmd::ShutdownCommand, snapshot_cmd::SnapshotCommands, state_cmd::StateCommands, sync_cmd::SyncCommands, wait_api_cmd::WaitApiCommand, }; use crate::cli::subcommands::info_cmd::InfoCommand; -/// CLI structure generated when interacting with Forest binary +/// `CLI` structure generated when interacting with Forest binary #[derive(Parser)] #[command(name = env!("CARGO_PKG_NAME"), bin_name = "forest-cli", author = env!("CARGO_PKG_AUTHORS"), version = FOREST_VERSION_STRING.as_str(), about = env!("CARGO_PKG_DESCRIPTION") )] @@ -94,9 +94,9 @@ pub enum Subcommand { #[command(subcommand)] Healthcheck(HealthcheckCommand), - /// Manages Filecoin Fast Finality (F3) interactions + /// Manages Filecoin Fast Finality (`F3`) interactions #[command(subcommand)] - F3(F3Commands), + `F3`(`F3`Commands), /// Wait for lotus API to come online WaitApi(WaitApiCommand), diff --git a/src/cli/subcommands/mpool_cmd.rs b/src/cli/subcommands/mpool_cmd.rs index db64e1fa6963..a21d6280cfb9 100644 --- a/src/cli/subcommands/mpool_cmd.rs +++ b/src/cli/subcommands/mpool_cmd.rs @@ -20,7 +20,7 @@ pub enum MpoolCommands { /// Print pending messages for addresses in local wallet only #[arg(long)] local: bool, - /// Only print `CIDs` of messages in output + /// Only print ``CIDs`` of messages in output #[arg(long)] cids: bool, /// Return messages to a given address diff --git a/src/cli_shared/cli/client.rs b/src/cli_shared/cli/client.rs index a00f50287396..ea93680d6536 100644 --- a/src/cli_shared/cli/client.rs +++ b/src/cli_shared/cli/client.rs @@ -48,7 +48,7 @@ pub struct Client { pub snapshot_path: Option, pub import_mode: ImportMode, /// Skips loading import CAR file and assumes it's already been loaded. - /// Will use the CIDs in the header of the file to index the chain. + /// Will use the `CIDs` in the header of the file to index the chain. pub skip_load: bool, /// When importing CAR files, chunk key-value pairs before committing them /// to the database. diff --git a/src/cli_shared/cli/completion_cmd.rs b/src/cli_shared/cli/completion_cmd.rs index 4c28f689aebd..94c3440917ad 100644 --- a/src/cli_shared/cli/completion_cmd.rs +++ b/src/cli_shared/cli/completion_cmd.rs @@ -8,7 +8,7 @@ use ahash::HashMap; use clap::{Command, CommandFactory}; use clap_complete::aot::{Shell, generate}; -/// Completion Command for generating shell completions for the CLI +/// Completion Command for generating shell completions for the `CLI` #[derive(Debug, clap::Args)] pub struct CompletionCommand { /// The binaries for which to generate completions (e.g., 'forest-cli,forest-tool,forest-wallet'). diff --git a/src/cli_shared/cli/mod.rs b/src/cli_shared/cli/mod.rs index a74335eb6bf8..d7251c6d7145 100644 --- a/src/cli_shared/cli/mod.rs +++ b/src/cli_shared/cli/mod.rs @@ -36,7 +36,7 @@ OPTIONS: {options} "; -/// CLI options +/// `CLI` options #[derive(Default, Debug, Parser)] pub struct CliOpts { /// A TOML file containing relevant configurations @@ -220,7 +220,7 @@ impl CliOpts { } } -/// CLI RPC options +/// `CLI` RPC options #[derive(Default, Debug, Parser)] pub struct CliRpcOpts { /// Admin token to interact with the node diff --git a/src/cli_shared/snapshot.rs b/src/cli_shared/snapshot.rs index f3a06bb40a0a..59ef857fafd0 100644 --- a/src/cli_shared/snapshot.rs +++ b/src/cli_shared/snapshot.rs @@ -35,7 +35,7 @@ pub enum TrustedVendor { /// Create a filename in the "full" format. See [`parse`]. // Common between export, and [`fetch`]. -// Keep in sync with the CLI documentation for the `snapshot` sub-command. +// Keep in sync with the `CLI` documentation for the `snapshot` sub-command. pub fn filename( vendor: impl Display, chain: impl Display, diff --git a/src/daemon/bundle.rs b/src/daemon/bundle.rs index f90adda70636..08cf2a725bf7 100644 --- a/src/daemon/bundle.rs +++ b/src/daemon/bundle.rs @@ -85,7 +85,7 @@ pub static ACTOR_BUNDLE_CACHE_DIR: LazyLock = LazyLock::new(|| { .join("actor-bundles") }); -/// Loads the missing actor bundle, returns the CIDs of the loaded bundles. +/// Loads the missing actor bundle, returns the `CIDs` of the loaded bundles. pub async fn load_actor_bundles_from_server( db: &impl PersistentStore, network: &NetworkChain, diff --git a/src/daemon/db_util.rs b/src/daemon/db_util.rs index 2a8553d1fc98..63408f7a7e58 100644 --- a/src/daemon/db_util.rs +++ b/src/daemon/db_util.rs @@ -253,8 +253,8 @@ pub async fn import_chain_as_forest_car( f3_root.display().to_string(), temp_f3_snap.path().display().to_string(), ) { - // Do not make it a hard error if anything is wrong with F3 snapshot - tracing::error!("Failed to import F3 snapshot: {e}"); + // Do not make it a hard error if anything is wrong with `F3` snapshot + tracing::error!("Failed to import `F3` snapshot: {e}"); } } diff --git a/src/daemon/main.rs b/src/daemon/main.rs index 05f9d74c94d2..b71420c549bd 100644 --- a/src/daemon/main.rs +++ b/src/daemon/main.rs @@ -13,7 +13,7 @@ use std::ffi::OsString; use std::time::Duration; use tracing::info; -/// CLI structure generated when interacting with Forest binary +/// `CLI` structure generated when interacting with Forest binary #[derive(Parser)] #[command(name = env!("CARGO_PKG_NAME"), bin_name = "forest", author = env!("CARGO_PKG_AUTHORS"), version = FOREST_VERSION_STRING.as_str(), about = env!("CARGO_PKG_DESCRIPTION") )] diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index 2bbfaa35f6bf..c35a029ea37d 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -384,13 +384,13 @@ fn maybe_start_rpc_service( fn maybe_start_f3_service(opts: &CliOpts, config: &Config, ctx: &AppContext) -> anyhow::Result<()> { // already running - if crate::rpc::f3::F3_LEASE_MANAGER.get().is_some() { + if crate::rpc::f3::`F3`_LEASE_MANAGER.get().is_some() { return Ok(()); } if !config.client.enable_rpc { if crate::f3::is_sidecar_ffi_enabled(ctx.state_manager.chain_config()) { - tracing::warn!("F3 sidecar is enabled but not run because RPC is disabled. ") + tracing::warn!("`F3` sidecar is enabled but not run because RPC is disabled. ") } return Ok(()); } @@ -401,15 +401,15 @@ fn maybe_start_f3_service(opts: &CliOpts, config: &Config, ctx: &AppContext) -> let p2p_peer_id = ctx.p2p_peer_id; let admin_jwt = ctx.admin_jwt.clone(); tokio::task::spawn_blocking({ - crate::rpc::f3::F3_LEASE_MANAGER - .set(crate::rpc::f3::F3LeaseManager::new( + crate::rpc::f3::`F3`_LEASE_MANAGER + .set(crate::rpc::f3::`F3`LeaseManager::new( state_manager.chain_config().network.clone(), p2p_peer_id, )) - .expect("F3 lease manager should not have been initialized before"); + .expect("`F3` lease manager should not have been initialized before"); let chain_config = state_manager.chain_config().clone(); let f3_root = crate::f3::get_f3_root(config); - let crate::f3::F3Options { + let crate::f3::`F3`Options { chain_finality, bootstrap_epoch, initial_power_table, diff --git a/src/db/car/forest.rs b/src/db/car/forest.rs index 7603bed01b6b..2231ed1ac9f4 100644 --- a/src/db/car/forest.rs +++ b/src/db/car/forest.rs @@ -325,7 +325,7 @@ impl Encoder { offset += header_len; - // Write seekable zstd and collect a mapping of CIDs to frame_offset+data_offset. + // Write seekable zstd and collect a mapping of `CIDs` to frame_offset+data_offset. let mut builder = index::Builder::new(); while let Some((cids, zstd_frame)) = stream.try_next().await? { builder.extend(cids.into_iter().map(|cid| (cid, offset as u64))); @@ -562,7 +562,7 @@ mod tests { fn encode_hash_collisions() { use crate::utils::multihash::prelude::*; - // Distinct CIDs may map to the same hash value + // Distinct `CIDs` may map to the same hash value let cid_a = Cid::new_v1(0, MultihashCode::Identity.digest(&[10])); let cid_b = Cid::new_v1(0, MultihashCode::Identity.digest(&[0])); // A and B are _not_ the same... @@ -571,7 +571,7 @@ mod tests { assert_eq!(index::hash::summary(&cid_a), index::hash::summary(&cid_b)); // For testing purposes, we ignore that the data doesn't map to the - // CIDs. + // `CIDs`. let blocks = nonempty![ CarBlock { cid: cid_a, @@ -592,7 +592,7 @@ mod tests { )) .unwrap(); - // Even with colliding hashes, the CIDs can still be queried: + // Even with colliding hashes, the `CIDs` can still be queried: assert_eq!(forest_car.get(&cid_a).unwrap().unwrap(), blocks[0].data); assert_eq!(forest_car.get(&cid_b).unwrap().unwrap(), blocks[1].data); } diff --git a/src/db/car/forest/index/mod.rs b/src/db/car/forest/index/mod.rs index 6f444a361f7c..22e19d2c302a 100644 --- a/src/db/car/forest/index/mod.rs +++ b/src/db/car/forest/index/mod.rs @@ -124,7 +124,7 @@ where /// Returns `Ok([])` if no offsets are found, or [`Err(_)`] if the underlying /// IO fails. /// - /// Does not allocate unless 2 or more CIDs have collided, see [module documentation](mod@self). + /// Does not allocate unless 2 or more `CIDs` have collided, see [module documentation](mod@self). /// /// You MUST check the actual CID at the offset to see if it matches. pub fn get(&self, key: Cid) -> io::Result> { diff --git a/src/db/car/mod.rs b/src/db/car/mod.rs index b7b26dc44f5d..c9ecee2e7341 100644 --- a/src/db/car/mod.rs +++ b/src/db/car/mod.rs @@ -32,7 +32,7 @@ pub type CacheKey = u64; type FrameOffset = u64; -/// According to FRC-0108, v2 snapshots have exactly one root pointing to metadata +/// According to FRC-0108, `v2` snapshots have exactly one root pointing to metadata const V2_SNAPSHOT_ROOT_COUNT: usize = 1; pub static ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE: LazyLock = LazyLock::new(|| { diff --git a/src/db/car/plain.rs b/src/db/car/plain.rs index f69f5586ae2d..86210c52b9a1 100644 --- a/src/db/car/plain.rs +++ b/src/db/car/plain.rs @@ -51,7 +51,7 @@ //! - [CAR documentation](https://ipld.io/specs/transport/car/carv1/#determinism) //! //! # Future work -//! - [`fadvise`](https://linux.die.net/man/2/posix_fadvise)-based APIs to pre-fetch parts of the +//! - [`fadvise`](https://linux.die.net/man/2/posix_fadvise)-based `APIs` to pre-fetch parts of the //! file, to improve random access performance. //! - Use an inner [`Blockstore`] for writes. //! - Use safe arithmetic for all operations - a malicious frame shouldn't cause a crash. diff --git a/src/db/mod.rs b/src/db/mod.rs index 9712dfab063b..4265d246c59a 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -117,7 +117,7 @@ pub trait EthMappingsStore { #[allow(dead_code)] fn exists(&self, key: &EthHash) -> anyhow::Result; - /// Returns all message CIDs with their timestamp. + /// Returns all message `CIDs` with their timestamp. fn get_message_cids(&self) -> anyhow::Result>; /// Deletes `keys` if keys exist in store. diff --git a/src/documentation.rs b/src/documentation.rs index f8d6c4386e21..780a66faf34f 100644 --- a/src/documentation.rs +++ b/src/documentation.rs @@ -97,7 +97,7 @@ /// /// The [`ChainMuxer`](crate::chain_sync::ChainMuxer) receives two kinds of [messages](crate::libp2p::PubsubMessage) /// from peers: -/// - [`GossipBlock`](crate::blocks::GossipBlock)s are descriptions of a single block, with the `BlockHeader` and `Message` CIDs. +/// - [`GossipBlock`](crate::blocks::GossipBlock)s are descriptions of a single block, with the `BlockHeader` and `Message` `CIDs`. /// - [`SignedMessage`](crate::message::SignedMessage)s /// /// It assembles these messages into a chain to genesis. diff --git a/src/f3/go_ffi.rs b/src/f3/go_ffi.rs index 144e162816e8..bae7d1c4f20d 100644 --- a/src/f3/go_ffi.rs +++ b/src/f3/go_ffi.rs @@ -8,7 +8,7 @@ pub mod binding { } #[rust2go::r2g] -pub trait GoF3Node { +pub trait Go`F3`Node { fn run( rpc_endpoint: String, jwt: String, diff --git a/src/f3/mod.rs b/src/f3/mod.rs index 003fbb21016d..44f51a58d892 100644 --- a/src/f3/mod.rs +++ b/src/f3/mod.rs @@ -17,14 +17,14 @@ use cid::Cid; use crate::{networks::ChainConfig, utils::misc::env::is_env_set_and_truthy}; #[derive(Debug, Clone, Eq, PartialEq)] -pub struct F3Options { +pub struct `F3`Options { pub chain_finality: i64, pub bootstrap_epoch: i64, pub initial_power_table: Option, } pub fn get_f3_root(config: &crate::Config) -> PathBuf { - std::env::var("FOREST_F3_ROOT") + std::env::var("FOREST_`F3`_ROOT") .map(|p| Path::new(&p).to_path_buf()) .unwrap_or_else(|_| { config @@ -34,38 +34,38 @@ pub fn get_f3_root(config: &crate::Config) -> PathBuf { }) } -pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> F3Options { - let chain_finality = std::env::var("FOREST_F3_FINALITY") +pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> `F3`Options { + let chain_finality = std::env::var("FOREST_`F3`_FINALITY") .ok() .and_then(|v| match v.parse::() { Ok(f) if f > 0 => Some(f), _ => { tracing::warn!( - "Invalid FOREST_F3_FINALITY value {v}. A positive integer is expected." + "Invalid FOREST_`F3`_FINALITY value {v}. A positive integer is expected." ); None } }) .inspect(|i| { - tracing::info!("Using F3 finality {i} set by FOREST_F3_FINALITY"); + tracing::info!("Using `F3` finality {i} set by FOREST_`F3`_FINALITY"); }) .unwrap_or(chain_config.policy.chain_finality); - // This will be used post-bootstrap to hard-code the initial F3's initial power table CID. + // This will be used post-bootstrap to hard-code the initial `F3`'s initial power table CID. // Read from an environment variable for now before the hard-coded value is determined. - let initial_power_table = match std::env::var("FOREST_F3_INITIAL_POWER_TABLE") { + let initial_power_table = match std::env::var("FOREST_`F3`_INITIAL_POWER_TABLE") { Ok(i) if i.is_empty() => { - tracing::info!("F3 initial power table cid is unset by FOREST_F3_INITIAL_POWER_TABLE"); + tracing::info!("`F3` initial power table cid is unset by FOREST_`F3`_INITIAL_POWER_TABLE"); None } Ok(i) => { if let Ok(cid) = i.parse() { tracing::info!( - "Using F3 initial power table cid {i} set by FOREST_F3_INITIAL_POWER_TABLE" + "Using `F3` initial power table cid {i} set by FOREST_`F3`_INITIAL_POWER_TABLE" ); Some(cid) } else { tracing::warn!( - "Invalid power table cid {i} set by FOREST_F3_INITIAL_POWER_TABLE, fallback to chain config" + "Invalid power table cid {i} set by FOREST_`F3`_INITIAL_POWER_TABLE, fallback to chain config" ); chain_config.f3_initial_power_table } @@ -73,15 +73,15 @@ pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> F3Options { _ => chain_config.f3_initial_power_table, }; - let bootstrap_epoch = std::env::var("FOREST_F3_BOOTSTRAP_EPOCH") + let bootstrap_epoch = std::env::var("FOREST_`F3`_BOOTSTRAP_EPOCH") .ok() .and_then(|i| i.parse().ok()) .inspect(|i| { - tracing::info!("Using F3 bootstrap epoch {i} set by FOREST_F3_BOOTSTRAP_EPOCH") + tracing::info!("Using `F3` bootstrap epoch {i} set by FOREST_`F3`_BOOTSTRAP_EPOCH") }) .unwrap_or(chain_config.f3_bootstrap_epoch); - F3Options { + `F3`Options { chain_finality, bootstrap_epoch, initial_power_table, @@ -102,8 +102,8 @@ pub fn run_f3_sidecar_if_enabled( if is_sidecar_ffi_enabled(chain_config) { #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { - tracing::info!("Starting F3 sidecar service ..."); - GoF3NodeImpl::run( + tracing::info!("Starting `F3` sidecar service ..."); + Go`F3`NodeImpl::run( rpc_endpoint, jwt, f3_rpc_endpoint, @@ -127,34 +127,34 @@ pub fn import_f3_snapshot( #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { let sw = std::time::Instant::now(); - tracing::info!("Importing F3 snapshot ..."); - let err = GoF3NodeImpl::import_snap(rpc_endpoint, f3_root, snapshot); + tracing::info!("Importing `F3` snapshot ..."); + let err = Go`F3`NodeImpl::import_snap(rpc_endpoint, f3_root, snapshot); if !err.is_empty() { anyhow::bail!("{err}"); } tracing::info!( - "Imported F3 snapshot, took {}", + "Imported `F3` snapshot, took {}", humantime::format_duration(sw.elapsed()) ); } } else { - tracing::warn!("F3 sidecar is disabled, skip importing the F3 snapshot"); + tracing::warn!("`F3` sidecar is disabled, skip importing the `F3` snapshot"); } Ok(()) } -/// Whether F3 sidecar via FFI is enabled. +/// Whether `F3` sidecar via FFI is enabled. pub fn is_sidecar_ffi_enabled(chain_config: &ChainConfig) -> bool { // Respect the environment variable when set, and fallback to chain config when not set. let enabled = - is_env_set_and_truthy("FOREST_F3_SIDECAR_FFI_ENABLED").unwrap_or(chain_config.f3_enabled); + is_env_set_and_truthy("FOREST_`F3`_SIDECAR_FFI_ENABLED").unwrap_or(chain_config.f3_enabled); cfg_if::cfg_if! { if #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { enabled } else { if enabled { - tracing::info!("Failed to enable F3 sidecar, the Forest binary is not compiled with f3-sidecar Go lib"); + tracing::info!("Failed to enable `F3` sidecar, the Forest binary is not compiled with f3-sidecar Go lib"); } false } @@ -171,7 +171,7 @@ mod tests { // No environment variable overrides assert_eq!( get_f3_sidecar_params(&chain_config), - F3Options { + `F3`Options { chain_finality: chain_config.policy.chain_finality, bootstrap_epoch: chain_config.f3_bootstrap_epoch, initial_power_table: chain_config.f3_initial_power_table, @@ -179,17 +179,17 @@ mod tests { ); unsafe { - std::env::set_var("FOREST_F3_FINALITY", "100"); + std::env::set_var("FOREST_`F3`_FINALITY", "100"); // A random CID std::env::set_var( - "FOREST_F3_INITIAL_POWER_TABLE", + "FOREST_`F3`_INITIAL_POWER_TABLE", "bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i", ); - std::env::set_var("FOREST_F3_BOOTSTRAP_EPOCH", "100"); + std::env::set_var("FOREST_`F3`_BOOTSTRAP_EPOCH", "100"); } assert_eq!( get_f3_sidecar_params(&chain_config), - F3Options { + `F3`Options { chain_finality: 100, bootstrap_epoch: 100, initial_power_table: Some( @@ -200,10 +200,10 @@ mod tests { } ); // Unset initial power table - unsafe { std::env::set_var("FOREST_F3_INITIAL_POWER_TABLE", "") }; + unsafe { std::env::set_var("FOREST_`F3`_INITIAL_POWER_TABLE", "") }; assert_eq!( get_f3_sidecar_params(&chain_config), - F3Options { + `F3`Options { chain_finality: 100, bootstrap_epoch: 100, initial_power_table: None, diff --git a/src/f3/snapshot.rs b/src/f3/snapshot.rs index 2b8a6d597500..8ffafb1732a5 100644 --- a/src/f3/snapshot.rs +++ b/src/f3/snapshot.rs @@ -4,7 +4,7 @@ #[cfg(test)] mod tests; -use crate::{rpc::f3::F3PowerEntry, utils::multihash::MultihashCode}; +use crate::{rpc::f3::`F3`PowerEntry, utils::multihash::MultihashCode}; use cid::Cid; use fvm_ipld_encoding::{IPLD_RAW, tuple::*}; use integer_encoding::VarIntReader as _; @@ -19,14 +19,14 @@ pub fn get_f3_snapshot_cid(f3_data: &mut impl Read) -> anyhow::Result { /// Defined in #[derive(Debug, Clone, Eq, PartialEq, Serialize_tuple, Deserialize_tuple)] -pub struct F3SnapshotHeader { +pub struct `F3`SnapshotHeader { pub version: u64, pub first_instance: u64, pub latest_instance: u64, - pub initial_power_table: Vec, + pub initial_power_table: Vec<`F3`PowerEntry>, } -impl F3SnapshotHeader { +impl `F3`SnapshotHeader { pub fn decode_from_snapshot(f3_snapshot: &mut impl Read) -> anyhow::Result { // Reasonable upper bound for snapshot header size (100MiB) const MAX_HEADER_SIZE: usize = 100 * 1024 * 1024; @@ -34,7 +34,7 @@ impl F3SnapshotHeader { let data_len = f3_snapshot.read_varint::()?; anyhow::ensure!( data_len <= MAX_HEADER_SIZE, - "F3 snapshot header size {data_len} exceeds maximum allowed size {MAX_HEADER_SIZE}" + "`F3` snapshot header size {data_len} exceeds maximum allowed size {MAX_HEADER_SIZE}" ); let mut data_bytes = vec![0; data_len]; f3_snapshot.read_exact(&mut data_bytes)?; @@ -42,10 +42,10 @@ impl F3SnapshotHeader { } } -impl std::fmt::Display for F3SnapshotHeader { +impl std::fmt::Display for `F3`SnapshotHeader { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - writeln!(f, "F3 snapshot version: {}", self.version)?; - writeln!(f, "F3 snapshot first instance: {}", self.first_instance)?; - write!(f, "F3 snapshot last instance: {}", self.latest_instance) + writeln!(f, "`F3` snapshot version: {}", self.version)?; + writeln!(f, "`F3` snapshot first instance: {}", self.first_instance)?; + write!(f, "`F3` snapshot last instance: {}", self.latest_instance) } } diff --git a/src/f3/snapshot/tests.rs b/src/f3/snapshot/tests.rs index 996acf1f05b6..27a03e7b56e9 100644 --- a/src/f3/snapshot/tests.rs +++ b/src/f3/snapshot/tests.rs @@ -3,12 +3,12 @@ use super::*; -const ENCODED_F3_SNAP_HEADER_HEX: &str = "8401001a00086e7d94831a00021b71480002fbe0000000005830aedb9e1f2f4e20a6a6327b9136b8472b16f1f56cec2b6d9341a12a97dc90a39e93f026baefeea09b7507e3bf1fc70981831a00022eff4800010ae80000000058308cc2fc55933c0413e763b63b10b131b3e53f57882e0c79231de0ada3227e01ed817d689e3150874170a4a2f6b590cd93831943eb48000103dcdf0000005830b2158a380b942e099ee4c7522921d638598ebb487f97c5d5ed06a29ba47f620513316f7a596b0a4d5aff7343275c212f83190fc84700faa80000000058308a9b00505fedc14edde52278ea229f4fe91e80890f5f8951200663e41f8034986f56ffd593f4e6a9a282a81ef8dfdc1c831a0002114a4700b2180000000058308c39f779f522b8de5836f7c421427f40556f934376e493a6e0fc0c72f8e35228fcf14e116fa73146ae4d88710c668e4083190ec64700948000000000583095748c4cd115988755c49578725996df98eb96c0447f2b4d5064d6562876745950d64ffb410b6db141b3a43e49a0d6908319ea7847003a90000000005830b5a56233aa1dcbffa5a2326e9b224826b3d540998e8dffea40ee238a7c7ed67e6cc9e21fad0e3e4af9dd00329063c9cd831945b047001fd0ec10000058308cddcf1d23cf25a361cd9a451eeed1d391aae84adc2220d3b2d6d9b6c929d487581ddbde3c53b6770b1b1b3dfe21e8bc831a0001c5b3470001980000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001e00a470001600000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001c2ad47000138000000005830a64817823ab8728463b34ee36b44761ffdab722762d675f76f631dcfc02affc95e9f54cd765b7bc98c1619991dfbe2f2831a0002307b4600b8000000005830962b2e0e92443cec526cac167a7f80f42bd907b68c17f2e93baff6232b8f4d396b43458810dd95aea41163b7cc047222831903f54600b0000000005830a37c98356d8fa32a1a8fcbd6a009395c4a34177aae9cd28c1c652963fbe445e95513e9f0c8281047ebcbf97cdd0aed0f831a00021051460090009000005830a57b3347936bc303bdf8fc232e701270db3817507562f0cd591114adeb5596c665f828510f52f678e213ad31f0eb6b3383190e7a460078000000005830b234c6533b5b40b7241345a9e9a06eea45877b510170ae9d221bfcdd577d482ead9eb1f74992f667e96459ff43b0e5218319049b460068000000005830a6c8a62aec6bff5b185c220aebe671af9cb24560fce4913c7edffd4368ba7af67a292ab8bfde1b326d6885b27976d59b831a0001bf50460040000000005830ad31d1d68bb36fc0e830ad5d452c7e676ff3277d3ad86a45bacbdfe15b5d89119434fa003031dd2f82907717aba10f9b8319048f46002800000000583097f447a28d7a7a3a489a1683d5a6eb7f0a96bac3b67d6dfeee43bb8ed3a8b223887d9defc6436b73e8b75b2ee2cf9b4f8319066b4600280000000058309561056d88ceb20291cb4770aab1613502bbf8bd226bb0b1ba132cf770bbd00120cc6c09ebf4f4c6ae0fab38d83c833d831a0002286b4600220000000058308018ef30920f5ef4420164b13a806958563fabd74a356537bd38796d0baf070d8c10f3ba57e34ee1ccbea1517bcff9c2"; +const ENCODED_`F3`_SNAP_HEADER_HEX: &str = "8401001a00086e7d94831a00021b71480002fbe0000000005830aedb9e1f2f4e20a6a6327b9136b8472b16f1f56cec2b6d9341a12a97dc90a39e93f026baefeea09b7507e3bf1fc70981831a00022eff4800010ae80000000058308cc2fc55933c0413e763b63b10b131b3e53f57882e0c79231de0ada3227e01ed817d689e3150874170a4a2f6b590cd93831943eb48000103dcdf0000005830b2158a380b942e099ee4c7522921d638598ebb487f97c5d5ed06a29ba47f620513316f7a596b0a4d5aff7343275c212f83190fc84700faa80000000058308a9b00505fedc14edde52278ea229f4fe91e80890f5f8951200663e41f8034986f56ffd593f4e6a9a282a81ef8dfdc1c831a0002114a4700b2180000000058308c39f779f522b8de5836f7c421427f40556f934376e493a6e0fc0c72f8e35228fcf14e116fa73146ae4d88710c668e4083190ec64700948000000000583095748c4cd115988755c49578725996df98eb96c0447f2b4d5064d6562876745950d64ffb410b6db141b3a43e49a0d6908319ea7847003a90000000005830b5a56233aa1dcbffa5a2326e9b224826b3d540998e8dffea40ee238a7c7ed67e6cc9e21fad0e3e4af9dd00329063c9cd831945b047001fd0ec10000058308cddcf1d23cf25a361cd9a451eeed1d391aae84adc2220d3b2d6d9b6c929d487581ddbde3c53b6770b1b1b3dfe21e8bc831a0001c5b3470001980000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001e00a470001600000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001c2ad47000138000000005830a64817823ab8728463b34ee36b44761ffdab722762d675f76f631dcfc02affc95e9f54cd765b7bc98c1619991dfbe2f2831a0002307b4600b8000000005830962b2e0e92443cec526cac167a7f80f42bd907b68c17f2e93baff6232b8f4d396b43458810dd95aea41163b7cc047222831903f54600b0000000005830a37c98356d8fa32a1a8fcbd6a009395c4a34177aae9cd28c1c652963fbe445e95513e9f0c8281047ebcbf97cdd0aed0f831a00021051460090009000005830a57b3347936bc303bdf8fc232e701270db3817507562f0cd591114adeb5596c665f828510f52f678e213ad31f0eb6b3383190e7a460078000000005830b234c6533b5b40b7241345a9e9a06eea45877b510170ae9d221bfcdd577d482ead9eb1f74992f667e96459ff43b0e5218319049b460068000000005830a6c8a62aec6bff5b185c220aebe671af9cb24560fce4913c7edffd4368ba7af67a292ab8bfde1b326d6885b27976d59b831a0001bf50460040000000005830ad31d1d68bb36fc0e830ad5d452c7e676ff3277d3ad86a45bacbdfe15b5d89119434fa003031dd2f82907717aba10f9b8319048f46002800000000583097f447a28d7a7a3a489a1683d5a6eb7f0a96bac3b67d6dfeee43bb8ed3a8b223887d9defc6436b73e8b75b2ee2cf9b4f8319066b4600280000000058309561056d88ceb20291cb4770aab1613502bbf8bd226bb0b1ba132cf770bbd00120cc6c09ebf4f4c6ae0fab38d83c833d831a0002286b4600220000000058308018ef30920f5ef4420164b13a806958563fabd74a356537bd38796d0baf070d8c10f3ba57e34ee1ccbea1517bcff9c2"; #[test] pub fn test_f3_snap_header_serde() { - let encoded_block_bytes = hex::decode(ENCODED_F3_SNAP_HEADER_HEX).unwrap(); - let F3SnapshotHeader { + let encoded_block_bytes = hex::decode(ENCODED_`F3`_SNAP_HEADER_HEX).unwrap(); + let `F3`SnapshotHeader { version, first_instance, latest_instance, diff --git a/src/health/endpoints.rs b/src/health/endpoints.rs index 1d1a5f3e57a9..0287db64bd6f 100644 --- a/src/health/endpoints.rs +++ b/src/health/endpoints.rs @@ -8,7 +8,7 @@ use axum::extract::{self, Query}; use super::{AppError, ForestState}; use crate::chain_sync::NodeSyncStatus; use crate::networks::calculate_expected_epoch; -use crate::rpc::f3::F3IsRunning; +use crate::rpc::f3::`F3`IsRunning; /// Query parameter for verbose responses const VERBOSE_PARAM: &str = "verbose"; @@ -44,7 +44,7 @@ pub(crate) async fn livez( /// - The node is in sync with the network /// - The current epoch of the node is not too far behind the network /// - The RPC server is running if not disabled -/// - The F3 side car is running if enabled +/// - The `F3` side car is running if enabled /// /// If any of these conditions are not met, the nod is **not** ready to serve requests. pub(crate) async fn readyz( @@ -163,7 +163,7 @@ async fn check_f3_running(state: &ForestState, acc: &mut MessageAccumulator) -> if !crate::f3::is_sidecar_ffi_enabled(&state.chain_config) { acc.push_ok("f3 disabled"); true - } else if F3IsRunning::is_f3_running().await.unwrap_or_default() { + } else if `F3`IsRunning::is_f3_running().await.unwrap_or_default() { acc.push_ok("f3 running"); true } else { diff --git a/src/interpreter/fvm2.rs b/src/interpreter/fvm2.rs index ef6e55ac07f1..ccd1ded7bf3a 100644 --- a/src/interpreter/fvm2.rs +++ b/src/interpreter/fvm2.rs @@ -147,7 +147,7 @@ impl Consensus for ForestExternsV2 { // ever have been accepted in a chain is not checked/does not matter here. // for that reason when checking block parent relationships, rather than // instantiating a Tipset to do so (which runs a syntactic check), we do - // it directly on the CIDs. + // it directly on the `CIDs`. // (0) cheap preliminary checks diff --git a/src/interpreter/fvm3.rs b/src/interpreter/fvm3.rs index 4730b7072399..b111a171d4c3 100644 --- a/src/interpreter/fvm3.rs +++ b/src/interpreter/fvm3.rs @@ -168,7 +168,7 @@ impl Consensus for ForestExterns { // ever have been accepted in a chain is not checked/does not matter here. // for that reason when checking block parent relationships, rather than // instantiating a Tipset to do so (which runs a syntactic check), we do - // it directly on the CIDs. + // it directly on the `CIDs`. // (0) cheap preliminary checks diff --git a/src/interpreter/fvm4.rs b/src/interpreter/fvm4.rs index 05c711e9a1af..e8e74f86db74 100644 --- a/src/interpreter/fvm4.rs +++ b/src/interpreter/fvm4.rs @@ -167,7 +167,7 @@ impl Consensus for ForestExterns { // ever have been accepted in a chain is not checked/does not matter here. // for that reason when checking block parent relationships, rather than // instantiating a Tipset to do so (which runs a syntactic check), we do - // it directly on the CIDs. + // it directly on the `CIDs`. // (0) cheap preliminary checks diff --git a/src/ipld/util.rs b/src/ipld/util.rs index 4b584489855e..262180007c1c 100644 --- a/src/ipld/util.rs +++ b/src/ipld/util.rs @@ -18,9 +18,9 @@ use std::pin::Pin; use std::task::{Context, Poll}; fn should_save_block_to_snapshot(cid: Cid) -> bool { - // Don't include identity CIDs. + // Don't include identity `CIDs`. // We only include raw and dagcbor, for now. - // Raw for "code" CIDs. + // Raw for "code" `CIDs`. if cid.hash().code() == u64::from(MultihashCode::Identity) { false } else { diff --git a/src/libp2p/discovery.rs b/src/libp2p/discovery.rs index 0294886a601a..5309ed5ed49d 100644 --- a/src/libp2p/discovery.rs +++ b/src/libp2p/discovery.rs @@ -35,7 +35,7 @@ use crate::{networks::GenesisNetworkName, utils::version::FOREST_VERSION_STRING} pub struct DerivedDiscoveryBehaviour { /// Kademlia discovery. kademlia: Toggle>, - /// Kademlia discovery for bootstrapping F3 sidecar when the main Kademlia is disabled. + /// Kademlia discovery for bootstrapping `F3` sidecar when the main Kademlia is disabled. kademlia_f3_sidecar: kad::Behaviour, /// Discovers nodes on the local network. mdns: Toggle, @@ -484,7 +484,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { trace!("Libp2p => Unhandled Kademlia event: {:?}", other) } }, - DerivedDiscoveryBehaviourEvent::KademliaF3Sidecar(_) => {} + DerivedDiscoveryBehaviourEvent::Kademlia`F3`Sidecar(_) => {} DerivedDiscoveryBehaviourEvent::Mdns(ev) => match ev { MdnsEvent::Discovered(list) => { if self.n_node_connected >= self.target_peer_count { diff --git a/src/message_pool/msgpool/selection.rs b/src/message_pool/msgpool/selection.rs index 9cb4ee629a9b..8b4833481292 100644 --- a/src/message_pool/msgpool/selection.rs +++ b/src/message_pool/msgpool/selection.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Contains routines for message selection APIs. +//! Contains routines for message selection `APIs`. //! Whenever a miner is ready to create a block for a tipset, it invokes the //! `select_messages` API which selects an appropriate set of messages such that //! it optimizes miner reward and chain capacity. See for more details diff --git a/src/message_pool/msgpool/test_provider.rs b/src/message_pool/msgpool/test_provider.rs index 36b8b3b40b19..a5e6be07797f 100644 --- a/src/message_pool/msgpool/test_provider.rs +++ b/src/message_pool/msgpool/test_provider.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Contains mock implementations for testing internal `MessagePool` APIs +//! Contains mock implementations for testing internal `MessagePool` `APIs` use std::{convert::TryFrom, sync::Arc}; diff --git a/src/networks/mod.rs b/src/networks/mod.rs index d067c8157372..f05dd1cc520f 100644 --- a/src/networks/mod.rs +++ b/src/networks/mod.rs @@ -263,7 +263,7 @@ pub struct ChainConfig { // See FIP-0100 and https://github.com/filecoin-project/lotus/pull/12938 for why this exists pub upgrade_teep_initial_fil_reserved: Option, pub f3_enabled: bool, - // F3Consensus set whether F3 should checkpoint tipsets finalized by F3. This flag has no effect if F3 is not enabled. + // `F3`Consensus set whether `F3` should checkpoint tipsets finalized by `F3`. This flag has no effect if `F3` is not enabled. pub f3_consensus: bool, pub f3_bootstrap_epoch: i64, pub f3_initial_power_table: Option, diff --git a/src/rpc/filter_list.rs b/src/rpc/filter_list.rs index 7abbcd28f752..4a489d44272b 100644 --- a/src/rpc/filter_list.rs +++ b/src/rpc/filter_list.rs @@ -129,17 +129,17 @@ mod tests { let mut filter_file = tempfile::Builder::new().tempfile().unwrap(); write!( filter_file, - r#"# Allow all F3 methods, except for F3.GetParent - F3. - !F3.GetParent + r#"# Allow all `F3` methods, except for `F3`.GetParent + `F3`. + !`F3`.GetParent "# ) .unwrap(); let list = FilterList::new_from_file(filter_file.path()).unwrap(); - assert!(!list.authorize("F3.GetParent")); - assert!(list.authorize("F3.GetHead")); - assert!(list.authorize("F3.GetPowerTable")); + assert!(!list.authorize("`F3`.GetParent")); + assert!(list.authorize("`F3`.GetHead")); + assert!(list.authorize("`F3`.GetPowerTable")); assert!(!list.authorize("Filecoin.ChainExport")); } } diff --git a/src/rpc/methods/chain.rs b/src/rpc/methods/chain.rs index 53a502dc4ced..d4f59c023a46 100644 --- a/src/rpc/methods/chain.rs +++ b/src/rpc/methods/chain.rs @@ -17,7 +17,7 @@ use crate::lotus_json::{HasLotusJson, LotusJson, lotus_json_with_self}; use crate::lotus_json::{assert_all_snapshots, assert_unchanged_via_json}; use crate::message::{ChainMessage, SignedMessage}; use crate::rpc::eth::{EthLog, eth_logs_with_filter, types::ApiHeaders, types::EthFilterSpec}; -use crate::rpc::f3::F3ExportLatestSnapshot; +use crate::rpc::f3::`F3`ExportLatestSnapshot; use crate::rpc::types::{ApiTipsetKey, Event}; use crate::rpc::{ApiPaths, Ctx, EthEventHandler, Permission, RpcMethod, ServerError}; use crate::shim::clock::ChainEpoch; @@ -378,11 +378,11 @@ impl RpcMethod<1> for ForestChainExport { .into_temp_path() }; let f3_snap = { - match F3ExportLatestSnapshot::run(f3_snap_tmp_path.display().to_string()).await + match `F3`ExportLatestSnapshot::run(f3_snap_tmp_path.display().to_string()).await { Ok(cid) => Some((cid, File::open(&f3_snap_tmp_path)?)), Err(e) => { - tracing::error!("Failed to export F3 snapshot: {e}"); + tracing::error!("Failed to export `F3` snapshot: {e}"); None } } diff --git a/src/rpc/methods/f3.rs b/src/rpc/methods/f3.rs index 4bb75c36d3f2..13929e1d6151 100644 --- a/src/rpc/methods/f3.rs +++ b/src/rpc/methods/f3.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! -//! This module contains F3(fast finality) related V1 RPC methods -//! as well as some internal RPC methods(F3.*) that power +//! This module contains `F3`(fast finality) related V1 RPC methods +//! as well as some internal RPC methods(`F3`.*) that power //! the go-f3 node in sidecar mode. //! @@ -11,7 +11,7 @@ mod types; mod util; pub use self::types::{ - F3InstanceProgress, F3LeaseManager, F3Manifest, F3PowerEntry, FinalityCertificate, + `F3`InstanceProgress, `F3`LeaseManager, `F3`Manifest, `F3`PowerEntry, FinalityCertificate, }; use self::{types::*, util::*}; use super::wallet::WalletSign; @@ -57,12 +57,12 @@ use std::{ sync::{Arc, LazyLock, OnceLock}, }; -pub static F3_LEASE_MANAGER: OnceLock = OnceLock::new(); +pub static `F3`_LEASE_MANAGER: OnceLock<`F3`LeaseManager> = OnceLock::new(); pub enum GetRawNetworkName {} impl RpcMethod<0> for GetRawNetworkName { - const NAME: &'static str = "F3.GetRawNetworkName"; + const NAME: &'static str = "`F3`.GetRawNetworkName"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -77,13 +77,13 @@ impl RpcMethod<0> for GetRawNetworkName { pub enum GetTipsetByEpoch {} impl RpcMethod<1> for GetTipsetByEpoch { - const NAME: &'static str = "F3.GetTipsetByEpoch"; + const NAME: &'static str = "`F3`.GetTipsetByEpoch"; const PARAM_NAMES: [&'static str; 1] = ["epoch"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ChainEpoch,); - type Ok = F3TipSet; + type Ok = `F3`TipSet; async fn handle( ctx: Ctx, @@ -100,13 +100,13 @@ impl RpcMethod<1> for GetTipsetByEpoch { pub enum GetTipset {} impl RpcMethod<1> for GetTipset { - const NAME: &'static str = "F3.GetTipset"; + const NAME: &'static str = "`F3`.GetTipset"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (F3TipSetKey,); - type Ok = F3TipSet; + type Params = (`F3`TipSetKey,); + type Ok = `F3`TipSet; async fn handle( ctx: Ctx, @@ -120,13 +120,13 @@ impl RpcMethod<1> for GetTipset { pub enum GetHead {} impl RpcMethod<0> for GetHead { - const NAME: &'static str = "F3.GetHead"; + const NAME: &'static str = "`F3`.GetHead"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = F3TipSet; + type Ok = `F3`TipSet; async fn handle(ctx: Ctx, _: Self::Params) -> Result { Ok(ctx.chain_store().heaviest_tipset().into()) @@ -135,13 +135,13 @@ impl RpcMethod<0> for GetHead { pub enum GetParent {} impl RpcMethod<1> for GetParent { - const NAME: &'static str = "F3.GetParent"; + const NAME: &'static str = "`F3`.GetParent"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (F3TipSetKey,); - type Ok = F3TipSet; + type Params = (`F3`TipSetKey,); + type Ok = `F3`TipSet; async fn handle( ctx: Ctx, @@ -160,7 +160,7 @@ impl GetPowerTable { async fn compute( ctx: &Ctx, ts: &Arc, - ) -> anyhow::Result> { + ) -> anyhow::Result> { // The RAM overhead on mainnet is ~14MiB const BLOCKSTORE_CACHE_CAP: usize = 65536; static BLOCKSTORE_CACHE: LazyLock = LazyLock::new(|| { @@ -454,12 +454,12 @@ impl GetPowerTable { anyhow::bail!("wrong type of worker address"); } let pub_key = waddr.payload_bytes(); - power_entries.push(F3PowerEntry { id, power, pub_key }); + power_entries.push(`F3`PowerEntry { id, power, pub_key }); } power_entries.sort(); if let Some(stats) = db.stats() { - tracing::debug!(epoch=%ts.epoch(), hit=%stats.hit(), miss=%stats.miss(),cache_len=%BLOCKSTORE_CACHE.len(), "F3.GetPowerTable blockstore read cache"); + tracing::debug!(epoch=%ts.epoch(), hit=%stats.hit(), miss=%stats.miss(),cache_len=%BLOCKSTORE_CACHE.len(), "`F3`.GetPowerTable blockstore read cache"); } Ok(power_entries) @@ -467,13 +467,13 @@ impl GetPowerTable { } impl RpcMethod<1> for GetPowerTable { - const NAME: &'static str = "F3.GetPowerTable"; + const NAME: &'static str = "`F3`.GetPowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (F3TipSetKey,); - type Ok = Vec; + type Params = (`F3`TipSetKey,); + type Ok = Vec<`F3`PowerEntry>; async fn handle( ctx: Ctx, @@ -483,14 +483,14 @@ impl RpcMethod<1> for GetPowerTable { let start = std::time::Instant::now(); let ts = ctx.chain_index().load_required_tipset(&tsk)?; let power_entries = Self::compute(&ctx, &ts).await?; - tracing::debug!(epoch=%ts.epoch(), %tsk, "F3.GetPowerTable, took {}", humantime::format_duration(start.elapsed())); + tracing::debug!(epoch=%ts.epoch(), %tsk, "`F3`.GetPowerTable, took {}", humantime::format_duration(start.elapsed())); Ok(power_entries) } } pub enum ProtectPeer {} impl RpcMethod<1> for ProtectPeer { - const NAME: &'static str = "F3.ProtectPeer"; + const NAME: &'static str = "`F3`.ProtectPeer"; const PARAM_NAMES: [&'static str; 1] = ["peer_id"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -517,7 +517,7 @@ impl RpcMethod<1> for ProtectPeer { pub enum GetParticipatingMinerIDs {} impl RpcMethod<0> for GetParticipatingMinerIDs { - const NAME: &'static str = "F3.GetParticipatingMinerIDs"; + const NAME: &'static str = "`F3`.GetParticipatingMinerIDs"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -526,9 +526,9 @@ impl RpcMethod<0> for GetParticipatingMinerIDs { type Ok = Vec; async fn handle(_: Ctx, _: Self::Params) -> Result { - let participants = F3ListParticipants::run().await?; + let participants = `F3`ListParticipants::run().await?; let mut ids: HashSet = participants.into_iter().map(|p| p.miner_id).collect(); - if let Some(permanent_miner_ids) = (*F3_PERMANENT_PARTICIPATING_MINER_IDS).clone() { + if let Some(permanent_miner_ids) = (*`F3`_PERMANENT_PARTICIPATING_MINER_IDS).clone() { ids.extend(permanent_miner_ids); } Ok(ids.into_iter().collect()) @@ -537,12 +537,12 @@ impl RpcMethod<0> for GetParticipatingMinerIDs { pub enum Finalize {} impl RpcMethod<1> for Finalize { - const NAME: &'static str = "F3.Finalize"; + const NAME: &'static str = "`F3`.Finalize"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Write; - type Params = (F3TipSetKey,); + type Params = (`F3`TipSetKey,); type Ok = (); async fn handle( @@ -550,7 +550,7 @@ impl RpcMethod<1> for Finalize { (f3_tsk,): Self::Params, ) -> Result { // Respect the environment variable when set, and fallback to chain config when not set. - let enabled = is_env_set_and_truthy("FOREST_F3_CONSENSUS_ENABLED") + let enabled = is_env_set_and_truthy("FOREST_`F3`_CONSENSUS_ENABLED") .unwrap_or(ctx.chain_config().f3_consensus); if !enabled { return Ok(()); @@ -571,12 +571,12 @@ impl RpcMethod<1> for Finalize { // When finalized_ts is not part of the current chain, // reset the current head to finalized_ts. // Note that when finalized_ts is newer than head or older than head - chain_finality, - // we don't reset the head to allow the chain or F3 to catch up. + // we don't reset the head to allow the chain or `F3` to catch up. if head.epoch() >= finalized_ts.epoch() && head.epoch() <= finalized_ts.epoch() + ctx.chain_config().policy.chain_finality { tracing::debug!( - "F3 finalized tsk {} at epoch {}", + "`F3` finalized tsk {} at epoch {}", finalized_ts.key(), finalized_ts.epoch() ); @@ -586,7 +586,7 @@ impl RpcMethod<1> for Finalize { .any(|ts| ts == finalized_ts) { tracing::info!( - "F3 reset chain head to tsk {} at epoch {}", + "`F3` reset chain head to tsk {} at epoch {}", finalized_ts.key(), finalized_ts.epoch() ); @@ -615,7 +615,7 @@ impl RpcMethod<1> for Finalize { pub enum SignMessage {} impl RpcMethod<2> for SignMessage { - const NAME: &'static str = "F3.SignMessage"; + const NAME: &'static str = "`F3`.SignMessage"; const PARAM_NAMES: [&'static str; 2] = ["pubkey", "message"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; @@ -633,27 +633,27 @@ impl RpcMethod<2> for SignMessage { } } -pub enum F3ExportLatestSnapshot {} +pub enum `F3`ExportLatestSnapshot {} -impl F3ExportLatestSnapshot { +impl `F3`ExportLatestSnapshot { pub async fn run(path: String) -> anyhow::Result { let client = get_rpc_http_client()?; let mut params = ArrayParams::new(); params.insert(path)?; let LotusJson(cid): LotusJson = client - .request("Filecoin.F3ExportLatestSnapshot", params) + .request("Filecoin.`F3`ExportLatestSnapshot", params) .await?; Ok(cid) } } -impl RpcMethod<1> for F3ExportLatestSnapshot { - const NAME: &'static str = "F3.ExportLatestSnapshot"; +impl RpcMethod<1> for `F3`ExportLatestSnapshot { + const NAME: &'static str = "`F3`.ExportLatestSnapshot"; const PARAM_NAMES: [&'static str; 1] = ["path"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; const DESCRIPTION: Option<&'static str> = - Some("Exports the latest F3 snapshot to the specified path and returns its CID"); + Some("Exports the latest `F3` snapshot to the specified path and returns its CID"); type Params = (String,); type Ok = Cid; @@ -667,9 +667,9 @@ impl RpcMethod<1> for F3ExportLatestSnapshot { } /// returns a finality certificate at given instance number -pub enum F3GetCertificate {} -impl RpcMethod<1> for F3GetCertificate { - const NAME: &'static str = "Filecoin.F3GetCertificate"; +pub enum `F3`GetCertificate {} +impl RpcMethod<1> for `F3`GetCertificate { + const NAME: &'static str = "Filecoin.`F3`GetCertificate"; const PARAM_NAMES: [&'static str; 1] = ["instance"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -690,9 +690,9 @@ impl RpcMethod<1> for F3GetCertificate { } /// returns the latest finality certificate -pub enum F3GetLatestCertificate {} -impl RpcMethod<0> for F3GetLatestCertificate { - const NAME: &'static str = "Filecoin.F3GetLatestCertificate"; +pub enum `F3`GetLatestCertificate {} +impl RpcMethod<0> for `F3`GetLatestCertificate { + const NAME: &'static str = "Filecoin.`F3`GetLatestCertificate"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -707,15 +707,15 @@ impl RpcMethod<0> for F3GetLatestCertificate { } } -pub enum F3GetECPowerTable {} -impl RpcMethod<1> for F3GetECPowerTable { - const NAME: &'static str = "Filecoin.F3GetECPowerTable"; +pub enum `F3`GetECPowerTable {} +impl RpcMethod<1> for `F3`GetECPowerTable { + const NAME: &'static str = "Filecoin.`F3`GetECPowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ApiTipsetKey,); - type Ok = Vec; + type Ok = Vec<`F3`PowerEntry>; async fn handle( ctx: Ctx, @@ -726,21 +726,21 @@ impl RpcMethod<1> for F3GetECPowerTable { } } -pub enum F3GetF3PowerTable {} -impl RpcMethod<1> for F3GetF3PowerTable { - const NAME: &'static str = "Filecoin.F3GetF3PowerTable"; +pub enum `F3`Get`F3`PowerTable {} +impl RpcMethod<1> for `F3`Get`F3`PowerTable { + const NAME: &'static str = "Filecoin.`F3`Get`F3`PowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ApiTipsetKey,); - type Ok = Vec; + type Ok = Vec<`F3`PowerEntry>; async fn handle( ctx: Ctx, (ApiTipsetKey(tsk_opt),): Self::Params, ) -> Result { - let tsk: F3TipSetKey = tsk_opt + let tsk: `F3`TipSetKey = tsk_opt .unwrap_or_else(|| ctx.chain_store().heaviest_tipset().key().clone()) .into(); let client = get_rpc_http_client()?; @@ -751,9 +751,9 @@ impl RpcMethod<1> for F3GetF3PowerTable { } } -pub enum F3GetF3PowerTableByInstance {} -impl RpcMethod<1> for F3GetF3PowerTableByInstance { - const NAME: &'static str = "Filecoin.F3GetF3PowerTableByInstance"; +pub enum `F3`Get`F3`PowerTableByInstance {} +impl RpcMethod<1> for `F3`Get`F3`PowerTableByInstance { + const NAME: &'static str = "Filecoin.`F3`Get`F3`PowerTableByInstance"; const PARAM_NAMES: [&'static str; 1] = ["instance"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -761,7 +761,7 @@ impl RpcMethod<1> for F3GetF3PowerTableByInstance { Some("Gets the power table (committee) used to validate the specified instance"); type Params = (u64,); - type Ok = Vec; + type Ok = Vec<`F3`PowerEntry>; async fn handle( _ctx: Ctx, @@ -775,9 +775,9 @@ impl RpcMethod<1> for F3GetF3PowerTableByInstance { } } -pub enum F3IsRunning {} +pub enum `F3`IsRunning {} -impl F3IsRunning { +impl `F3`IsRunning { pub async fn is_f3_running() -> anyhow::Result { let client = get_rpc_http_client()?; let response = client.request(Self::NAME, ArrayParams::new()).await?; @@ -785,8 +785,8 @@ impl F3IsRunning { } } -impl RpcMethod<0> for F3IsRunning { - const NAME: &'static str = "Filecoin.F3IsRunning"; +impl RpcMethod<0> for `F3`IsRunning { + const NAME: &'static str = "Filecoin.`F3`IsRunning"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -799,92 +799,92 @@ impl RpcMethod<0> for F3IsRunning { } } -/// See -pub enum F3GetProgress {} +/// See +pub enum `F3`GetProgress {} -impl F3GetProgress { - async fn run() -> anyhow::Result { +impl `F3`GetProgress { + async fn run() -> anyhow::Result<`F3`InstanceProgress> { let client = get_rpc_http_client()?; - let response: LotusJson = + let response: LotusJson<`F3`InstanceProgress> = client.request(Self::NAME, ArrayParams::new()).await?; Ok(response.into_inner()) } } -impl RpcMethod<0> for F3GetProgress { - const NAME: &'static str = "Filecoin.F3GetProgress"; +impl RpcMethod<0> for `F3`GetProgress { + const NAME: &'static str = "Filecoin.`F3`GetProgress"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = F3InstanceProgress; + type Ok = `F3`InstanceProgress; async fn handle(_: Ctx, (): Self::Params) -> Result { Ok(Self::run().await?) } } -/// See -pub enum F3GetManifest {} +/// See +pub enum `F3`GetManifest {} -impl F3GetManifest { - async fn run() -> anyhow::Result { +impl `F3`GetManifest { + async fn run() -> anyhow::Result<`F3`Manifest> { let client = get_rpc_http_client()?; - let response: LotusJson = + let response: LotusJson<`F3`Manifest> = client.request(Self::NAME, ArrayParams::new()).await?; Ok(response.into_inner()) } } -impl RpcMethod<0> for F3GetManifest { - const NAME: &'static str = "Filecoin.F3GetManifest"; +impl RpcMethod<0> for `F3`GetManifest { + const NAME: &'static str = "Filecoin.`F3`GetManifest"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = F3Manifest; + type Ok = `F3`Manifest; async fn handle(_: Ctx, (): Self::Params) -> Result { Ok(Self::run().await?) } } -/// returns the list of miner addresses that are currently participating in F3 via this node. -pub enum F3ListParticipants {} -impl RpcMethod<0> for F3ListParticipants { - const NAME: &'static str = "Filecoin.F3ListParticipants"; +/// returns the list of miner addresses that are currently participating in `F3` via this node. +pub enum `F3`ListParticipants {} +impl RpcMethod<0> for `F3`ListParticipants { + const NAME: &'static str = "Filecoin.`F3`ListParticipants"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = Vec; + type Ok = Vec<`F3`Participant>; async fn handle(_: Ctx, _: Self::Params) -> Result { Ok(Self::run().await?) } } -impl F3ListParticipants { - async fn run() -> anyhow::Result> { - let current_instance = F3GetProgress::run().await?.id; - Ok(F3_LEASE_MANAGER +impl `F3`ListParticipants { + async fn run() -> anyhow::Result> { + let current_instance = `F3`GetProgress::run().await?.id; + Ok(`F3`_LEASE_MANAGER .get() - .context("F3 lease manager is not initialized")? + .context("`F3` lease manager is not initialized")? .get_active_participants(current_instance) .values() - .map(F3Participant::from) + .map(`F3`Participant::from) .collect()) } } /// retrieves or renews a participation ticket necessary for a miner to engage in -/// the F3 consensus process for the given number of instances. -pub enum F3GetOrRenewParticipationTicket {} -impl RpcMethod<3> for F3GetOrRenewParticipationTicket { - const NAME: &'static str = "Filecoin.F3GetOrRenewParticipationTicket"; +/// the `F3` consensus process for the given number of instances. +pub enum `F3`GetOrRenewParticipationTicket {} +impl RpcMethod<3> for `F3`GetOrRenewParticipationTicket { + const NAME: &'static str = "Filecoin.`F3`GetOrRenewParticipationTicket"; const PARAM_NAMES: [&'static str; 3] = ["miner_address", "previous_lease_ticket", "instances"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; @@ -901,49 +901,49 @@ impl RpcMethod<3> for F3GetOrRenewParticipationTicket { None } else { Some( - fvm_ipld_encoding::from_slice::(&previous_lease_ticket) + fvm_ipld_encoding::from_slice::<`F3`ParticipationLease>(&previous_lease_ticket) .context("the previous lease ticket is invalid")?, ) }; - let lease = F3_LEASE_MANAGER + let lease = `F3`_LEASE_MANAGER .get() - .context("F3 lease manager is not initialized")? + .context("`F3` lease manager is not initialized")? .get_or_renew_participation_lease(id, previous_lease, instances) .await?; Ok(fvm_ipld_encoding::to_vec(&lease)?) } } -/// enrolls a storage provider in the F3 consensus process using a +/// enrolls a storage provider in the `F3` consensus process using a /// provided participation ticket. This ticket grants a temporary lease that enables -/// the provider to sign transactions as part of the F3 consensus. -pub enum F3Participate {} -impl RpcMethod<1> for F3Participate { - const NAME: &'static str = "Filecoin.F3Participate"; +/// the provider to sign transactions as part of the `F3` consensus. +pub enum `F3`Participate {} +impl RpcMethod<1> for `F3`Participate { + const NAME: &'static str = "Filecoin.`F3`Participate"; const PARAM_NAMES: [&'static str; 1] = ["lease_ticket"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; type Params = (Vec,); - type Ok = F3ParticipationLease; + type Ok = `F3`ParticipationLease; async fn handle( _: Ctx, (lease_ticket,): Self::Params, ) -> Result { - let lease: F3ParticipationLease = + let lease: `F3`ParticipationLease = fvm_ipld_encoding::from_slice(&lease_ticket).context("invalid lease ticket")?; - let current_instance = F3GetProgress::run().await?.id; - F3_LEASE_MANAGER + let current_instance = `F3`GetProgress::run().await?.id; + `F3`_LEASE_MANAGER .get() - .context("F3 lease manager is not initialized")? + .context("`F3` lease manager is not initialized")? .participate(&lease, current_instance)?; Ok(lease) } } pub fn get_f3_rpc_endpoint() -> Cow<'static, str> { - if let Ok(host) = std::env::var("FOREST_F3_SIDECAR_RPC_ENDPOINT") { + if let Ok(host) = std::env::var("FOREST_`F3`_SIDECAR_RPC_ENDPOINT") { Cow::Owned(host) } else { Cow::Borrowed("127.0.0.1:23456") diff --git a/src/rpc/methods/f3/types.rs b/src/rpc/methods/f3/types.rs index cb5e8ad24b76..08282952e06b 100644 --- a/src/rpc/methods/f3/types.rs +++ b/src/rpc/methods/f3/types.rs @@ -28,32 +28,32 @@ use std::{cmp::Ordering, time::Duration}; const MAX_LEASE_INSTANCES: u64 = 5; -/// TipSetKey is the canonically ordered concatenation of the block CIDs in a tipset. +/// TipSetKey is the canonically ordered concatenation of the block `CIDs` in a tipset. #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] -pub struct F3TipSetKey( +pub struct `F3`TipSetKey( #[schemars(with = "String")] #[serde(with = "base64_standard")] pub Vec, ); -lotus_json_with_self!(F3TipSetKey); +lotus_json_with_self!(`F3`TipSetKey); -impl From<&TipsetKey> for F3TipSetKey { +impl From<&TipsetKey> for `F3`TipSetKey { fn from(tsk: &TipsetKey) -> Self { let bytes = tsk.iter().flat_map(|cid| cid.to_bytes()).collect(); Self(bytes) } } -impl From for F3TipSetKey { +impl From for `F3`TipSetKey { fn from(tsk: TipsetKey) -> Self { (&tsk).into() } } -impl TryFrom for TipsetKey { +impl TryFrom<`F3`TipSetKey> for TipsetKey { type Error = anyhow::Error; - fn try_from(tsk: F3TipSetKey) -> Result { + fn try_from(tsk: `F3`TipSetKey) -> Result { static BLOCK_HEADER_CID_LEN: LazyLock = LazyLock::new(|| { let buf = [0_u8; 256]; let cid = Cid::new_v1( @@ -76,8 +76,8 @@ impl TryFrom for TipsetKey { } #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] -pub struct F3TipSet { - pub key: F3TipSetKey, +pub struct `F3`TipSet { + pub key: `F3`TipSetKey, /// The verifiable oracle randomness used to elect this block's author leader #[schemars(with = "String")] #[serde(with = "base64_standard")] @@ -88,9 +88,9 @@ pub struct F3TipSet { /// Block creation time, in seconds since the Unix epoch pub timestamp: u64, } -lotus_json_with_self!(F3TipSet); +lotus_json_with_self!(`F3`TipSet); -impl From for F3TipSet { +impl From for `F3`TipSet { fn from(ts: Tipset) -> Self { let key = ts.key().into(); let beacon = { @@ -112,7 +112,7 @@ impl From for F3TipSet { } } -impl From> for F3TipSet { +impl From> for `F3`TipSet { fn from(ts: Arc) -> Self { Arc::unwrap_or_clone(ts).into() } @@ -136,7 +136,7 @@ lotus_json_with_self!(ECTipSet); /// PowerEntry represents a single entry in the PowerTable, including ActorID and its StoragePower and PubKey. #[derive(Debug, Clone, Serialize_tuple, Deserialize_tuple, Eq, PartialEq)] -pub struct F3PowerEntry { +pub struct `F3`PowerEntry { pub id: ActorID, #[serde(with = "bigint_ser")] pub power: num::BigInt, @@ -146,7 +146,7 @@ pub struct F3PowerEntry { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] -pub struct F3PowerEntryLotusJson { +pub struct `F3`PowerEntryLotusJson { #[serde(rename = "ID")] pub id: ActorID, #[schemars(with = "String")] @@ -157,8 +157,8 @@ pub struct F3PowerEntryLotusJson { pub pub_key: Vec, } -impl HasLotusJson for F3PowerEntry { - type LotusJson = F3PowerEntryLotusJson; +impl HasLotusJson for `F3`PowerEntry { + type LotusJson = `F3`PowerEntryLotusJson; #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { @@ -182,10 +182,10 @@ impl HasLotusJson for F3PowerEntry { fn into_lotus_json(self) -> Self::LotusJson { let Self { id, power, pub_key } = self; - F3PowerEntryLotusJson { id, power, pub_key } + `F3`PowerEntryLotusJson { id, power, pub_key } } - fn from_lotus_json(F3PowerEntryLotusJson { id, power, pub_key }: Self::LotusJson) -> Self { + fn from_lotus_json(`F3`PowerEntryLotusJson { id, power, pub_key }: Self::LotusJson) -> Self { Self { id, power, pub_key } } } @@ -193,7 +193,7 @@ impl HasLotusJson for F3PowerEntry { /// Entries are sorted descending order of their power, where entries with equal power are /// sorted by ascending order of their ID. /// This ordering is guaranteed to be stable, since a valid PowerTable cannot contain entries with duplicate IDs -impl Ord for F3PowerEntry { +impl Ord for `F3`PowerEntry { fn cmp(&self, other: &Self) -> Ordering { match other.power.cmp(&self.power) { Ordering::Equal => self.id.cmp(&other.id), @@ -202,7 +202,7 @@ impl Ord for F3PowerEntry { } } -impl PartialOrd for F3PowerEntry { +impl PartialOrd for `F3`PowerEntry { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } @@ -210,7 +210,7 @@ impl PartialOrd for F3PowerEntry { #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct F3InstanceProgress { +pub struct `F3`InstanceProgress { #[serde(rename = "ID")] pub id: u64, pub round: u64, @@ -223,9 +223,9 @@ pub struct F3InstanceProgress { )] pub input: Vec, } -lotus_json_with_self!(F3InstanceProgress); +lotus_json_with_self!(`F3`InstanceProgress); -impl F3InstanceProgress { +impl `F3`InstanceProgress { pub fn phase_string(&self) -> &'static str { match self.phase { 0 => "INITIAL", @@ -332,7 +332,7 @@ pub struct PartialMessageManagerConfig { #[serde_as] #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct F3Manifest { +pub struct `F3`Manifest { pub protocol_version: u64, pub initial_instance: u64, pub bootstrap_epoch: i64, @@ -352,9 +352,9 @@ pub struct F3Manifest { pub chain_exchange: ChainExchangeConfig, pub partial_message_manager: PartialMessageManagerConfig, } -lotus_json_with_self!(F3Manifest); +lotus_json_with_self!(`F3`Manifest); -impl F3Manifest { +impl `F3`Manifest { pub fn get_eth_return_from_message_receipt(receipt: &Receipt) -> anyhow::Result> { anyhow::ensure!( receipt.exit_code().is_success(), @@ -437,7 +437,7 @@ impl F3Manifest { let mut deflater = DeflateDecoder::new(compressed_manifest_bytes); let mut manifest_bytes = vec![]; deflater.read_to_end(&mut manifest_bytes)?; - let manifest: F3Manifest = serde_json::from_slice(&manifest_bytes)?; + let manifest: `F3`Manifest = serde_json::from_slice(&manifest_bytes)?; anyhow::ensure!( manifest.bootstrap_epoch >= 0 && manifest.bootstrap_epoch as u64 == activation_epoch, "bootstrap epoch does not match: {} != {activation_epoch}", @@ -447,7 +447,7 @@ impl F3Manifest { } } -impl TryFrom<&Receipt> for F3Manifest { +impl TryFrom<&Receipt> for `F3`Manifest { type Error = anyhow::Error; fn try_from(receipt: &Receipt) -> Result { @@ -456,7 +456,7 @@ impl TryFrom<&Receipt> for F3Manifest { } } -impl TryFrom for F3Manifest { +impl TryFrom for `F3`Manifest { type Error = anyhow::Error; fn try_from(receipt: Receipt) -> Result { @@ -545,17 +545,17 @@ impl FinalityCertificate { #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct F3Participant { +pub struct `F3`Participant { #[serde(rename = "MinerID")] pub miner_id: u64, pub from_instance: u64, pub validity_term: u64, } -lotus_json_with_self!(F3Participant); +lotus_json_with_self!(`F3`Participant); -impl From for F3Participant { - fn from(value: F3ParticipationLease) -> Self { - let F3ParticipationLease { +impl From<`F3`ParticipationLease> for `F3`Participant { + fn from(value: `F3`ParticipationLease) -> Self { + let `F3`ParticipationLease { miner_id, from_instance, validity_term, @@ -569,9 +569,9 @@ impl From for F3Participant { } } -impl From<&F3ParticipationLease> for F3Participant { - fn from(value: &F3ParticipationLease) -> Self { - let &F3ParticipationLease { +impl From<&`F3`ParticipationLease> for `F3`Participant { + fn from(value: &`F3`ParticipationLease) -> Self { + let &`F3`ParticipationLease { miner_id, from_instance, validity_term, @@ -586,11 +586,11 @@ impl From<&F3ParticipationLease> for F3Participant { } /// defines the lease granted to a storage provider for -/// participating in F3 consensus, detailing the session identifier, issuer, +/// participating in `F3` consensus, detailing the session identifier, issuer, /// subject, and the expiration instance. #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct ApiF3ParticipationLease { +pub struct Api`F3`ParticipationLease { /// the name of the network this lease belongs to. #[schemars(with = "String")] pub network: NetworkChain, @@ -609,7 +609,7 @@ pub struct ApiF3ParticipationLease { #[serde_as] #[derive(PartialEq, Debug, Clone, Serialize_tuple, Deserialize_tuple)] #[serde(rename_all = "PascalCase")] -pub struct F3ParticipationLease { +pub struct `F3`ParticipationLease { #[serde_as(as = "DisplayFromStr")] pub network: NetworkChain, #[serde_as(as = "DisplayFromStr")] @@ -619,8 +619,8 @@ pub struct F3ParticipationLease { pub validity_term: u64, } -impl HasLotusJson for F3ParticipationLease { - type LotusJson = ApiF3ParticipationLease; +impl HasLotusJson for `F3`ParticipationLease { + type LotusJson = Api`F3`ParticipationLease; #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { @@ -662,7 +662,7 @@ impl HasLotusJson for F3ParticipationLease { } } -impl F3ParticipationLease { +impl `F3`ParticipationLease { pub fn validate( &self, network: &NetworkChain, @@ -690,13 +690,13 @@ impl F3ParticipationLease { } #[derive(Debug)] -pub struct F3LeaseManager { +pub struct `F3`LeaseManager { network: NetworkChain, peer_id: PeerId, - leases: RwLock>, + leases: RwLock>, } -impl F3LeaseManager { +impl `F3`LeaseManager { pub fn new(network: NetworkChain, peer_id: PeerId) -> Self { Self { network, @@ -708,7 +708,7 @@ impl F3LeaseManager { pub fn get_active_participants( &self, current_instance: u64, - ) -> HashMap { + ) -> HashMap { self.leases .read() .iter() @@ -725,16 +725,16 @@ impl F3LeaseManager { pub async fn get_or_renew_participation_lease( &self, id: u64, - previous_lease: Option, + previous_lease: Option<`F3`ParticipationLease>, instances: u64, - ) -> anyhow::Result { + ) -> anyhow::Result<`F3`ParticipationLease> { anyhow::ensure!(instances > 0, "instances should be positive"); anyhow::ensure!( instances <= MAX_LEASE_INSTANCES, "instances {instances} exceeds the maximum allowed value {MAX_LEASE_INSTANCES}" ); - let current_instance = super::F3GetProgress::run().await?.id; + let current_instance = super::`F3`GetProgress::run().await?.id; if let Some(previous_lease) = previous_lease { // A previous ticket is present. To avoid overlapping lease across multiple // instances for the same participant check its validity and only proceed to @@ -757,8 +757,8 @@ impl F3LeaseManager { participant: u64, from_instance: u64, instances: u64, - ) -> F3ParticipationLease { - F3ParticipationLease { + ) -> `F3`ParticipationLease { + `F3`ParticipationLease { issuer: self.peer_id, network: self.network.clone(), miner_id: participant, @@ -769,7 +769,7 @@ impl F3LeaseManager { pub fn participate( &self, - lease: &F3ParticipationLease, + lease: &`F3`ParticipationLease, current_instance: u64, ) -> anyhow::Result<()> { lease.validate(&self.network, &self.peer_id, current_instance)?; @@ -785,7 +785,7 @@ impl F3LeaseManager { "the from instance should never decrease" ); } else { - tracing::info!("started participating in F3 for miner {}", lease.miner_id); + tracing::info!("started participating in `F3` for miner {}", lease.miner_id); } self.leases.write().insert(lease.miner_id, lease.clone()); Ok(()) @@ -799,15 +799,15 @@ mod tests { #[test] fn decode_f3_participation_lease_ticket_from_lotus() { - // ticket is generated from a Lotus node by calling `Filecoin.F3GetOrRenewParticipationTicket` + // ticket is generated from a Lotus node by calling `Filecoin.`F3`GetOrRenewParticipationTicket` // params: ["t01000", "", 1] let ticket = "hW5jYWxpYnJhdGlvbm5ldHg0MTJEM0tvb1dKV0VxZzRLcXpxQUJMeU0yMUtBbWFKYzNqdFBzWEJrNmJNNllyN1BLSGczSxkD6AAB"; let ticket_bytes = BASE64_STANDARD.decode(ticket).unwrap(); - let lease: F3ParticipationLease = + let lease: `F3`ParticipationLease = fvm_ipld_encoding::from_slice(ticket_bytes.as_slice()).unwrap(); assert_eq!( lease, - F3ParticipationLease { + `F3`ParticipationLease { network: NetworkChain::Calibnet, issuer: PeerId::from_str("12D3KooWJWEqg4KqzqABLyM21KAmaJc3jtPsXBk6bM6Yr7PKHg3K") .unwrap(), @@ -820,7 +820,7 @@ mod tests { #[test] fn f3_participation_lease_ticket_serde_roundtrip() { - let lease = F3ParticipationLease { + let lease = `F3`ParticipationLease { network: NetworkChain::Calibnet, issuer: PeerId::from_str("12D3KooWJWEqg4KqzqABLyM21KAmaJc3jtPsXBk6bM6Yr7PKHg3K") .unwrap(), @@ -829,7 +829,7 @@ mod tests { validity_term: 1, }; let ticket = fvm_ipld_encoding::to_vec(&lease).unwrap(); - let decoded: F3ParticipationLease = fvm_ipld_encoding::from_slice(&ticket).unwrap(); + let decoded: `F3`ParticipationLease = fvm_ipld_encoding::from_slice(&ticket).unwrap(); assert_eq!(lease, decoded); } @@ -839,7 +839,7 @@ mod tests { let peer_id = PeerId::random(); let miner = 1000; - let lm = F3LeaseManager::new(network, peer_id); + let lm = `F3`LeaseManager::new(network, peer_id); let lease = lm.new_participation_lease(miner, 10, 2); assert!( @@ -941,7 +941,7 @@ mod tests { "MaxCachedValidatedMessagesPerInstance": 25000 } }); - let manifest: F3Manifest = serde_json::from_value(lotus_json.clone()).unwrap(); + let manifest: `F3`Manifest = serde_json::from_value(lotus_json.clone()).unwrap(); let serialized = serde_json::to_value(manifest.clone()).unwrap(); assert_eq!(lotus_json, serialized); } @@ -1015,13 +1015,13 @@ mod tests { #[test] fn test_f3_manifest_parse_contract_return() { - // The solidity contract: https://github.com/filecoin-project/f3-activation-contract/blob/063cd51a46f61b717375fe5675a6ddc73f4d8626/contracts/F3Parameters.sol + // The solidity contract: https://github.com/filecoin-project/f3-activation-contract/blob/063cd51a46f61b717375fe5675a6ddc73f4d8626/contracts/`F3`Parameters.sol let eth_return_hex = include_str!("contract_return.hex").trim(); let eth_return = hex::decode(eth_return_hex).unwrap(); - let manifest = F3Manifest::parse_contract_return(ð_return).unwrap(); + let manifest = `F3`Manifest::parse_contract_return(ð_return).unwrap(); assert_eq!( manifest, - serde_json::from_str::(include_str!("contract_manifest_golden.json")) + serde_json::from_str::<`F3`Manifest>(include_str!("contract_manifest_golden.json")) .unwrap(), ); } diff --git a/src/rpc/methods/f3/util.rs b/src/rpc/methods/f3/util.rs index 5c9571f047e8..1e071e87a137 100644 --- a/src/rpc/methods/f3/util.rs +++ b/src/rpc/methods/f3/util.rs @@ -4,27 +4,27 @@ use super::*; use std::sync::LazyLock; -const F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY: &str = - "FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES"; +const `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY: &str = + "FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES"; -pub static F3_PERMANENT_PARTICIPATING_MINER_IDS: LazyLock>> = +pub static `F3`_PERMANENT_PARTICIPATING_MINER_IDS: LazyLock>> = LazyLock::new(get_f3_permanent_participating_miner_ids); /// loads f3 permanent participating miner IDs. /// Note that this environment variable should only be used for testing purpose. fn get_f3_permanent_participating_miner_ids() -> Option> { - if let Ok(permanent_addrs) = std::env::var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY) { + if let Ok(permanent_addrs) = std::env::var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY) { let mut ids = HashSet::default(); for addr_str in permanent_addrs.split(",") { let Ok(addr) = Address::from_str(addr_str.trim()) else { tracing::warn!( - "Failed to parse miner address {addr_str} set in {F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY}" + "Failed to parse miner address {addr_str} set in {`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY}" ); continue; }; let Ok(id) = addr.id() else { tracing::warn!( - "miner address {addr_str} set in {F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY} is not an id address" + "miner address {addr_str} set in {`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY} is not an id address" ); continue; }; @@ -44,30 +44,30 @@ mod tests { fn test_get_f3_permanent_participating_miner_ids() { unsafe { // empty - std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, ""); + std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, ""); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 valid address - std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000"); + std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000"); assert_eq!( get_f3_permanent_participating_miner_ids(), Some(HashSet::from_iter([1000])), ); // 1 invalid address - std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "tf1000"); + std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "tf1000"); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 bls address std::env::set_var( - F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, + `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t3sw466j35hqjbch5x7tcr7ona6idsgzypoturfci2ajqsfrrwhp7ty3ythtd7x646adaidnvxpdr5b2ftcciq", ); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 valid address and 1 invalid address with extra whitespaces std::env::set_var( - F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, + `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000, t3sw466j35hqjbch5x7tcr7ona6idsgzypoturfci2ajqsfrrwhp7ty3ythtd7x646adaidnvxpdr5b2ftcciq, ", ); assert_eq!( diff --git a/src/rpc/methods/mpool.rs b/src/rpc/methods/mpool.rs index 10ceddab0ca9..d7392a2c211f 100644 --- a/src/rpc/methods/mpool.rs +++ b/src/rpc/methods/mpool.rs @@ -155,7 +155,7 @@ impl RpcMethod<1> for MpoolPush { } } -/// Add a batch of `SignedMessage`s to `mpool`, return message CIDs +/// Add a batch of `SignedMessage`s to `mpool`, return message `CIDs` pub enum MpoolBatchPush {} impl RpcMethod<1> for MpoolBatchPush { const NAME: &'static str = "Filecoin.MpoolBatchPush"; @@ -204,7 +204,7 @@ impl RpcMethod<1> for MpoolPushUntrusted { } } -/// Add a batch of `SignedMessage`s to `mpool`, return message CIDs +/// Add a batch of `SignedMessage`s to `mpool`, return message `CIDs` pub enum MpoolBatchPushUntrusted {} impl RpcMethod<1> for MpoolBatchPushUntrusted { const NAME: &'static str = "Filecoin.MpoolBatchPushUntrusted"; diff --git a/src/rpc/methods/state.rs b/src/rpc/methods/state.rs index 7be0d5596be1..d49a1839ebae 100644 --- a/src/rpc/methods/state.rs +++ b/src/rpc/methods/state.rs @@ -1259,7 +1259,7 @@ impl RpcMethod<2> for StateSearchMsgLimited { } } -// Sample CIDs (useful for testing): +// Sample `CIDs` (useful for testing): // Mainnet: // 1,594,681 bafy2bzaceaclaz3jvmbjg3piazaq5dcesoyv26cdpoozlkzdiwnsvdvm2qoqm OhSnap upgrade // 1_960_320 bafy2bzacec43okhmihmnwmgqspyrkuivqtxv75rpymsdbulq6lgsdq2vkwkcg Skyr upgrade @@ -1337,7 +1337,7 @@ impl RpcMethod<2> for StateFetchRoot { // Do a depth-first-search of the IPLD graph (DAG). Nodes that are _not_ present in our database // are fetched in background tasks. If the number of tasks reaches MAX_CONCURRENT_REQUESTS, the // depth-first-search pauses until one of the work tasks returns. The memory usage of this - // algorithm is dominated by the set of seen CIDs and the 'dfs' stack is not expected to grow to + // algorithm is dominated by the set of seen `CIDs` and the 'dfs' stack is not expected to grow to // more than 1000 elements (even when walking tens of millions of nodes). let dfs = Arc::new(Mutex::new(vec![Ipld::Link(root_cid)])); let mut to_be_fetched = vec![]; @@ -1347,14 +1347,14 @@ impl RpcMethod<2> for StateFetchRoot { while let Some(ipld) = lock_pop(&dfs) { { let mut dfs_guard = dfs.lock(); - // Scan for unseen CIDs. Available IPLD nodes are pushed to the depth-first-search + // Scan for unseen `CIDs`. Available IPLD nodes are pushed to the depth-first-search // stack, unavailable nodes will be requested in worker tasks. for new_cid in ipld.iter().filter_map(&mut get_ipld_link) { counter += 1; if counter % 1_000 == 0 { // set RUST_LOG=forest::rpc::state_api=debug to enable these printouts. tracing::debug!( - "Graph walk: CIDs: {counter}, Fetched: {fetched}, Failures: {failures}, dfs: {}, Concurrent: {}", + "Graph walk: `CIDs`: {counter}, Fetched: {fetched}, Failures: {failures}, dfs: {}, Concurrent: {}", dfs_guard.len(), task_set.len() ); @@ -1432,7 +1432,7 @@ impl RpcMethod<2> for StateFetchRoot { } Ok(format!( - "IPLD graph traversed! CIDs: {counter}, fetched: {fetched}, failures: {failures}." + "IPLD graph traversed! `CIDs`: {counter}, fetched: {fetched}, failures: {failures}." )) } } diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs index b175b0427cd7..dc46161dd5a2 100644 --- a/src/rpc/mod.rs +++ b/src/rpc/mod.rs @@ -273,18 +273,18 @@ macro_rules! for_each_rpc_method { // f3 $callback!($crate::rpc::f3::GetRawNetworkName); - $callback!($crate::rpc::f3::F3GetCertificate); - $callback!($crate::rpc::f3::F3GetECPowerTable); - $callback!($crate::rpc::f3::F3GetF3PowerTable); - $callback!($crate::rpc::f3::F3GetF3PowerTableByInstance); - $callback!($crate::rpc::f3::F3IsRunning); - $callback!($crate::rpc::f3::F3GetProgress); - $callback!($crate::rpc::f3::F3GetManifest); - $callback!($crate::rpc::f3::F3ListParticipants); - $callback!($crate::rpc::f3::F3GetLatestCertificate); - $callback!($crate::rpc::f3::F3GetOrRenewParticipationTicket); - $callback!($crate::rpc::f3::F3Participate); - $callback!($crate::rpc::f3::F3ExportLatestSnapshot); + $callback!($crate::rpc::f3::`F3`GetCertificate); + $callback!($crate::rpc::f3::`F3`GetECPowerTable); + $callback!($crate::rpc::f3::`F3`Get`F3`PowerTable); + $callback!($crate::rpc::f3::`F3`Get`F3`PowerTableByInstance); + $callback!($crate::rpc::f3::`F3`IsRunning); + $callback!($crate::rpc::f3::`F3`GetProgress); + $callback!($crate::rpc::f3::`F3`GetManifest); + $callback!($crate::rpc::f3::`F3`ListParticipants); + $callback!($crate::rpc::f3::`F3`GetLatestCertificate); + $callback!($crate::rpc::f3::`F3`GetOrRenewParticipationTicket); + $callback!($crate::rpc::f3::`F3`Participate); + $callback!($crate::rpc::f3::`F3`ExportLatestSnapshot); $callback!($crate::rpc::f3::GetHead); $callback!($crate::rpc::f3::GetParent); $callback!($crate::rpc::f3::GetParticipatingMinerIDs); @@ -357,7 +357,7 @@ pub fn collect_rpc_method_info() -> Vec<(&'static str, Permission)> { /// - `src/rpc/methods/auth/types.rs` (if there are so many that they would cause clutter). /// - If it is used _across_ API verticals, it should live in `src/rpc/types.rs` /// -/// # Interactions with the [`lotus_json`] APIs +/// # Interactions with the [`lotus_json`] `APIs` /// - Types may have fields which must go through [`LotusJson`], /// and MUST reflect that in their [`JsonSchema`]. /// You have two options for this: @@ -514,7 +514,7 @@ where let keystore = state.keystore.clone(); let mut module = create_module(state.clone()); - // register eth subscription APIs + // register eth subscription `APIs` let eth_pubsub = EthPubSub::new(state.clone()); module.merge(eth_pubsub.into_rpc())?; diff --git a/src/rpc/reflect/mod.rs b/src/rpc/reflect/mod.rs index 540edb9d27b2..47e1202c682a 100644 --- a/src/rpc/reflect/mod.rs +++ b/src/rpc/reflect/mod.rs @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! Forest wishes to provide [OpenRPC](http://open-rpc.org) definitions for -//! Filecoin APIs. +//! Filecoin `APIs`. //! To do this, it needs: //! - [JSON Schema](https://json-schema.org/) definitions for all the argument //! and return types. //! - The number of arguments ([arity](https://en.wikipedia.org/wiki/Arity)) and //! names of those arguments for each RPC method. //! -//! As a secondary objective, we wish to provide an RPC client for our CLI, and +//! As a secondary objective, we wish to provide an RPC client for our `CLI`, and //! internal tests against Lotus. //! //! The [`RpcMethod`] trait encapsulates all the above at a single site. diff --git a/src/rpc/registry/actors_reg.rs b/src/rpc/registry/actors_reg.rs index f990a51d4764..5d5c9424df46 100644 --- a/src/rpc/registry/actors_reg.rs +++ b/src/rpc/registry/actors_reg.rs @@ -200,7 +200,7 @@ mod test { fn test_basic_load_and_serialize_actor_state_all_supported_actors() { let db = Arc::new(MemoryDB::default()); - // Test all supported actor types with real CIDs + // Test all supported actor types with real `CIDs` let supported_actors = vec![ (BuiltinActor::Account, "Account"), (BuiltinActor::Cron, "Cron"), diff --git a/src/rpc/types/mod.rs b/src/rpc/types/mod.rs index e198abd27fa6..f09bf0466ac4 100644 --- a/src/rpc/types/mod.rs +++ b/src/rpc/types/mod.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Types that are shared _between_ APIs. +//! Types that are shared _between_ `APIs`. //! //! If a type here is used by only one API, it should be relocated. diff --git a/src/shim/actors/builtin/miner/mod.rs b/src/shim/actors/builtin/miner/mod.rs index 9fd052ffece3..c602550d0482 100644 --- a/src/shim/actors/builtin/miner/mod.rs +++ b/src/shim/actors/builtin/miner/mod.rs @@ -376,7 +376,7 @@ impl State { } } - /// Unclaimed funds. Actor balance - (locked funds, pre-commit deposit, ip requirement) Can go negative if the miner is in IP debt. + /// Unclaimed funds. Actor balance - (locked funds, pre-commit deposit, IP requirement) Can go negative if the miner is in IP debt. pub fn available_balance(&self, balance: &BigInt) -> anyhow::Result { let balance: TokenAmount = TokenAmount::from_atto(balance.clone()); let balance_v3 = from_token_v2_to_v3(&balance); diff --git a/src/shim/machine/manifest.rs b/src/shim/machine/manifest.rs index 1be8c9649557..44c72c65eef2 100644 --- a/src/shim/machine/manifest.rs +++ b/src/shim/machine/manifest.rs @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize}; /// This should be the latest enumeration of all builtin actors pub use fil_actors_shared::v11::runtime::builtins::Type as BuiltinActor; -/// A list of [`BuiltinActor`]s to their CIDs +/// A list of [`BuiltinActor`]s to their `CIDs` // Theoretically, this struct could just have fields for all the actors, // acting as a kind of perfect hash map, but performance will be fine as-is // #[derive(Serialize, Deserialize, Debug)] diff --git a/src/shim/state_tree.rs b/src/shim/state_tree.rs index e11a66e38390..77697f3cdc96 100644 --- a/src/shim/state_tree.rs +++ b/src/shim/state_tree.rs @@ -360,7 +360,7 @@ where .with_context(|| format!("failed to find actor: {addr}"))?; // A workaround to implement `if state.Version() >= types.StateTreeVersion5` - // When state tree version is not available in rust APIs + // When state tree version is not available in rust `APIs` if !matches!(self, Self::FvmV2(_) | Self::V0(_)) && let Some(address) = actor.delegated_address { diff --git a/src/tool/subcommands/api_cmd.rs b/src/tool/subcommands/api_cmd.rs index 7e193120eece..d6635cc9fac9 100644 --- a/src/tool/subcommands/api_cmd.rs +++ b/src/tool/subcommands/api_cmd.rs @@ -216,7 +216,7 @@ pub enum ApiCommands { /// that rely on internal state. /// /// Inputs: - /// - `--to`, `--from`: delegated Filecoin (f4) addresses + /// - `--to`, `--from`: delegated Filecoin (`f4`) addresses /// - `--payload`: calldata in hex (accepts optional `0x` prefix) /// - `--topic`: `32‑byte` event topic in hex /// - `--filter`: run only tests that interact with a specific RPC method diff --git a/src/tool/subcommands/api_cmd/api_compare_tests.rs b/src/tool/subcommands/api_cmd/api_compare_tests.rs index 99f93c90f89e..f9ca1f14324d 100644 --- a/src/tool/subcommands/api_cmd/api_compare_tests.rs +++ b/src/tool/subcommands/api_cmd/api_compare_tests.rs @@ -1992,31 +1992,31 @@ fn gas_tests_with_tipset(shared_tipset: &Tipset) -> Vec { fn f3_tests() -> anyhow::Result> { Ok(vec![ // using basic because 2 nodes are not garanteed to be at the same head - RpcTest::basic(F3GetECPowerTable::request((None.into(),))?), - RpcTest::basic(F3GetLatestCertificate::request(())?), - RpcTest::basic(F3ListParticipants::request(())?), - RpcTest::basic(F3GetProgress::request(())?), - RpcTest::basic(F3GetOrRenewParticipationTicket::request(( + RpcTest::basic(`F3`GetECPowerTable::request((None.into(),))?), + RpcTest::basic(`F3`GetLatestCertificate::request(())?), + RpcTest::basic(`F3`ListParticipants::request(())?), + RpcTest::basic(`F3`GetProgress::request(())?), + RpcTest::basic(`F3`GetOrRenewParticipationTicket::request(( Address::new_id(1000), vec![], 3, ))?), - RpcTest::identity(F3IsRunning::request(())?), - RpcTest::identity(F3GetCertificate::request((0,))?), - RpcTest::identity(F3GetCertificate::request((100,))?), - RpcTest::identity(F3GetManifest::request(())?), + RpcTest::identity(`F3`IsRunning::request(())?), + RpcTest::identity(`F3`GetCertificate::request((0,))?), + RpcTest::identity(`F3`GetCertificate::request((100,))?), + RpcTest::identity(`F3`GetManifest::request(())?), ]) } fn f3_tests_with_tipset(tipset: &Tipset) -> anyhow::Result> { Ok(vec![ - RpcTest::identity(F3GetECPowerTable::request((tipset.key().into(),))?), - RpcTest::identity(F3GetF3PowerTable::request((tipset.key().into(),))?), + RpcTest::identity(`F3`GetECPowerTable::request((tipset.key().into(),))?), + RpcTest::identity(`F3`Get`F3`PowerTable::request((tipset.key().into(),))?), ]) } -// Extract tests that use chain-specific data such as block CIDs or message -// CIDs. Right now, only the last `n_tipsets` tipsets are used. +// Extract tests that use chain-specific data such as block `CIDs` or message +// `CIDs`. Right now, only the last `n_tipsets` tipsets are used. fn snapshot_tests( store: Arc, num_tipsets: usize, diff --git a/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt b/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt index 5b26058d7984..30b5fcc6a963 100644 --- a/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt +++ b/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt @@ -1,14 +1,14 @@ -F3.ExportLatestSnapshot -F3.Finalize -F3.GetHead -F3.GetParent -F3.GetParticipatingMinerIDs -F3.GetPowerTable -F3.GetRawNetworkName -F3.GetTipset -F3.GetTipsetByEpoch -F3.ProtectPeer -F3.SignMessage +`F3`.ExportLatestSnapshot +`F3`.Finalize +`F3`.GetHead +`F3`.GetParent +`F3`.GetParticipatingMinerIDs +`F3`.GetPowerTable +`F3`.GetRawNetworkName +`F3`.GetTipset +`F3`.GetTipsetByEpoch +`F3`.ProtectPeer +`F3`.SignMessage Filecoin.AuthNew Filecoin.AuthVerify Filecoin.ChainExport @@ -21,17 +21,17 @@ Filecoin.EthSendRawTransaction Filecoin.EthSubscribe Filecoin.EthSyncing Filecoin.EthUnsubscribe -Filecoin.F3GetCertificate -Filecoin.F3GetECPowerTable -Filecoin.F3GetF3PowerTable -Filecoin.F3GetF3PowerTableByInstance -Filecoin.F3GetLatestCertificate -Filecoin.F3GetManifest -Filecoin.F3GetOrRenewParticipationTicket -Filecoin.F3GetProgress -Filecoin.F3IsRunning -Filecoin.F3ListParticipants -Filecoin.F3Participate +Filecoin.`F3`GetCertificate +Filecoin.`F3`GetECPowerTable +Filecoin.`F3`Get`F3`PowerTable +Filecoin.`F3`Get`F3`PowerTableByInstance +Filecoin.`F3`GetLatestCertificate +Filecoin.`F3`GetManifest +Filecoin.`F3`GetOrRenewParticipationTicket +Filecoin.`F3`GetProgress +Filecoin.`F3`IsRunning +Filecoin.`F3`ListParticipants +Filecoin.`F3`Participate Filecoin.GasEstimateFeeCap Filecoin.GasEstimateGasPremium Filecoin.GasEstimateMessageGas diff --git a/src/tool/subcommands/archive_cmd.rs b/src/tool/subcommands/archive_cmd.rs index b8a7041688f6..2c835d727a3c 100644 --- a/src/tool/subcommands/archive_cmd.rs +++ b/src/tool/subcommands/archive_cmd.rs @@ -34,7 +34,7 @@ use crate::chain::{ use crate::cid_collections::CidHashSet; use crate::cli_shared::{snapshot, snapshot::TrustedVendor}; use crate::db::car::{AnyCar, ManyCar, forest::DEFAULT_FOREST_CAR_COMPRESSION_LEVEL}; -use crate::f3::snapshot::F3SnapshotHeader; +use crate::f3::snapshot::`F3`SnapshotHeader; use crate::interpreter::VMTrace; use crate::ipld::stream_graph; use crate::networks::{ChainConfig, NetworkChain, butterflynet, calibnet, mainnet}; @@ -97,9 +97,9 @@ pub enum ArchiveCommands { /// Path to an archive (`.car` or `.car.zst`). snapshot: PathBuf, }, - /// Show FRC-0108 header of a standalone F3 snapshot. - F3Header { - /// Path to a standalone F3 snapshot. + /// Show FRC-0108 header of a standalone `F3` snapshot. + `F3`Header { + /// Path to a standalone `F3` snapshot. snapshot: PathBuf, }, /// Trim a snapshot of the chain and write it to `` @@ -149,12 +149,12 @@ pub enum ArchiveCommands { #[arg(long, default_value_t = false)] force: bool, }, - /// Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format - MergeF3 { + /// Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format + Merge`F3` { /// Path to the v1 Filecoin snapshot #[arg(long = "v1")] filecoin_v1: PathBuf, - /// Path to the F3 snapshot + /// Path to the `F3` snapshot #[arg(long)] f3: PathBuf, /// Path to the snapshot output file in `.forest.car.zst` format @@ -225,7 +225,7 @@ impl ArchiveCommands { let mut f3_data = store .get_reader(f3_cid)? .with_context(|| format!("f3 data not found, cid: {f3_cid}"))?; - let f3_snap_header = F3SnapshotHeader::decode_from_snapshot(&mut f3_data)?; + let f3_snap_header = `F3`SnapshotHeader::decode_from_snapshot(&mut f3_data)?; println!("{f3_snap_header}"); } } else { @@ -235,14 +235,14 @@ impl ArchiveCommands { } Ok(()) } - Self::F3Header { snapshot } => { + Self::`F3`Header { snapshot } => { let mut r = BufReader::new(File::open(&snapshot).with_context(|| { - format!("failed to open F3 snapshot '{}'", snapshot.display()) + format!("failed to open `F3` snapshot '{}'", snapshot.display()) })?); let f3_snap_header = - F3SnapshotHeader::decode_from_snapshot(&mut r).with_context(|| { + `F3`SnapshotHeader::decode_from_snapshot(&mut r).with_context(|| { format!( - "failed to decode F3 snapshot header from '{}'", + "failed to decode `F3` snapshot header from '{}'", snapshot.display() ) })?; @@ -280,7 +280,7 @@ impl ArchiveCommands { output_path, force, } => merge_snapshots(snapshot_files, output_path, force).await, - Self::MergeF3 { + Self::Merge`F3` { filecoin_v1, f3, output, @@ -916,7 +916,7 @@ async fn bucket_has_diff_snapshot( const FOREST_ARCHIVE_S3_ENDPOINT: &str = "https://2238a825c5aca59233eab1f221f7aefb.r2.cloudflarestorage.com"; -/// Check if the AWS CLI is installed and correctly configured. +/// Check if the AWS `CLI` is installed and correctly configured. fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { let status = std::process::Command::new("aws") .arg("help") @@ -926,7 +926,7 @@ fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { if !status.success() { bail!( - "'aws help' failed with status code: {}. Please ensure that the AWS CLI is installed and configured.", + "'aws help' failed with status code: {}. Please ensure that the AWS `CLI` is installed and configured.", status ); } @@ -946,7 +946,7 @@ fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { Ok(()) } -/// Use the AWS CLI to upload a snapshot file to the `S3` bucket. +/// Use the AWS `CLI` to upload a snapshot file to the `S3` bucket. fn upload_to_forest_bucket(path: PathBuf, network: &str, tag: &str) -> anyhow::Result<()> { let status = std::process::Command::new("aws") .args([ diff --git a/src/tool/subcommands/shed_cmd.rs b/src/tool/subcommands/shed_cmd.rs index 97b0977e5c70..1e5c2a940ad1 100644 --- a/src/tool/subcommands/shed_cmd.rs +++ b/src/tool/subcommands/shed_cmd.rs @@ -22,7 +22,7 @@ use std::path::PathBuf; #[derive(Subcommand)] pub enum ShedCommands { - /// Enumerate the tipset CIDs for a span of epochs starting at `height` and working backwards. + /// Enumerate the tipset `CIDs` for a span of epochs starting at `height` and working backwards. /// /// Useful for getting blocks to live test an RPC endpoint. SummarizeTipsets { diff --git a/src/utils/db/car_stream.rs b/src/utils/db/car_stream.rs index 99a5c296b448..71980a96bffe 100644 --- a/src/utils/db/car_stream.rs +++ b/src/utils/db/car_stream.rs @@ -29,7 +29,7 @@ use crate::utils::encoding::from_slice_with_fallback; #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct CarV1Header { - // The roots array must contain one or more CIDs, + // The roots array must contain one or more `CIDs`, // each of which should be present somewhere in the remainder of the CAR. // See pub roots: NonEmpty, diff --git a/src/utils/db/mod.rs b/src/utils/db/mod.rs index d3a997dad470..7ed036d8a742 100644 --- a/src/utils/db/mod.rs +++ b/src/utils/db/mod.rs @@ -15,9 +15,9 @@ use multihash_codetable::Code; use serde::ser::Serialize; -/// Extension methods for inserting and retrieving IPLD data with CIDs +/// Extension methods for inserting and retrieving IPLD data with `CIDs` pub trait BlockstoreExt: Blockstore { - /// Batch put CBOR objects into block store and returns vector of CIDs + /// Batch put CBOR objects into block store and returns vector of `CIDs` #[allow(clippy::disallowed_types)] fn bulk_put<'a, S, V>(&self, values: V, code: Code) -> anyhow::Result> where @@ -53,7 +53,7 @@ pub trait BlockstoreExt: Blockstore { impl BlockstoreExt for T {} -/// Extension methods for [`CborStore`] that omits default multihash code from its APIs +/// Extension methods for [`CborStore`] that omits default multihash code from its `APIs` pub trait CborStoreExt: CborStore { /// Default multihash code is [`cid::multihash::Code::Blake2b256`] /// See diff --git a/src/utils/encoding/cid_de_cbor.rs b/src/utils/encoding/cid_de_cbor.rs index accb21adc274..6a4a608e9643 100644 --- a/src/utils/encoding/cid_de_cbor.rs +++ b/src/utils/encoding/cid_de_cbor.rs @@ -22,7 +22,7 @@ pub fn extract_cids(cbor_blob: &[u8]) -> anyhow::Result { /// vector of [`Cid`]. struct CidVec(SmallCidVec); -/// [`FilterCids`] traverses an [`ipld_core::ipld::Ipld`] tree, appending [`Cid`]s (and only CIDs) to a single vector. +/// [`FilterCids`] traverses an [`ipld_core::ipld::Ipld`] tree, appending [`Cid`]s (and only `CIDs`) to a single vector. /// This is much faster than constructing an [`ipld_core::ipld::Ipld`] tree and then performing the filtering. struct FilterCids<'a>(&'a mut SmallCidVec); @@ -92,7 +92,7 @@ impl<'de> DeserializeSeed<'de> for FilterCids<'_> { Ok(()) } - // "New-type" structs are only used to de-serialize CIDs. + // "New-type" structs are only used to de-serialize `CIDs`. #[inline] fn visit_newtype_struct(self, deserializer: D) -> Result where @@ -104,7 +104,7 @@ impl<'de> DeserializeSeed<'de> for FilterCids<'_> { Ok(()) } - // We don't care about anything else as the CIDs could only be found in "new-type" + // We don't care about anything else as the `CIDs` could only be found in "new-type" // structs. So we visit only lists, maps and said structs. #[inline] fn visit_str(self, _value: &str) -> Result diff --git a/src/utils/encoding/fallback_de_ipld_dagcbor.rs b/src/utils/encoding/fallback_de_ipld_dagcbor.rs index e94d9f600538..f32116ee923a 100644 --- a/src/utils/encoding/fallback_de_ipld_dagcbor.rs +++ b/src/utils/encoding/fallback_de_ipld_dagcbor.rs @@ -32,7 +32,7 @@ mod cbor4ii_nonpub { pub const NULL: u8 = 0xf6; // simple(22) pub const UNDEFINED: u8 = 0xf7; // simple(23) pub const F16: u8 = 0xf9; - pub const F32: u8 = 0xfa; + pub const `F3`2: u8 = 0xfa; pub const F64: u8 = 0xfb; pub const BREAK: u8 = 0xff; } @@ -234,7 +234,7 @@ impl<'de, R: dec::Read<'de>> serde::Deserializer<'de> for &mut Deserializer { de.reader.advance(1); visitor.visit_none() } - marker::F32 => de.deserialize_f32(visitor), + marker::`F3`2 => de.deserialize_f32(visitor), marker::F64 => de.deserialize_f64(visitor), _ => Err(DecodeError::Unsupported { byte }), }, @@ -666,7 +666,7 @@ impl<'de, 'a, R: dec::Read<'de>> de::Deserializer<'de> for &'a mut CidDeserializ let byte = peek_one(&mut self.0.reader)?; match dec::if_major(byte) { major::BYTES => { - // CBOR encoded CIDs have a zero byte prefix we have to remove. + // CBOR encoded `CIDs` have a zero byte prefix we have to remove. match >>::decode(&mut self.0.reader)?.0 { Cow::Borrowed(buf) => match buf.split_first() { Some((0, rest)) => visitor.visit_borrowed_bytes(rest), diff --git a/src/utils/net.rs b/src/utils/net.rs index 8016cc05f327..b29de02c20f4 100644 --- a/src/utils/net.rs +++ b/src/utils/net.rs @@ -21,8 +21,8 @@ use tracing::info; use url::Url; pub fn global_http_client() -> reqwest::Client { - static CLIENT: LazyLock = LazyLock::new(reqwest::Client::new); - CLIENT.clone() + static `CLI`ENT: LazyLock = LazyLock::new(reqwest::Client::new); + `CLI`ENT.clone() } /// Download a file via IPFS HTTP gateway in trustless mode. From 14840662908bb55bde6b02b8d73d1fa1ebf82eed Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 19 Sep 2025 09:27:38 +0100 Subject: [PATCH 17/34] chore: fixing spellcheck --- .github/workflows/docs-auto-update.yml | 8 +- .github/workflows/forest.yml | 4 +- CHANGELOG.md | 84 +++---- README.md | 12 +- build.rs | 2 +- build/bootstrap/butterflynet | 2 +- docs/README.md | 4 +- docs/dictionary.txt | 6 +- docs/docs/users/getting_started/install.md | 2 +- docs/docs/users/guides/advanced/backups.md | 4 +- .../guides/advanced/generating_snapshots.md | 4 +- docs/docs/users/introduction.md | 2 +- docs/docs/users/knowledge_base/docker_tips.md | 2 +- .../docs/users/knowledge_base/jwt_handling.md | 2 +- .../users/knowledge_base/snapshot_service.md | 2 +- docs/docs/users/openrpc.json | 128 +++++------ docs/docs/users/reference/cli.md | 62 ++--- docs/docs/users/reference/env_variables.md | 22 +- docs/docs/users/reference/generate_cli_md.sh | 2 +- .../docs/users/reference/json_rpc_overview.md | 4 +- docs/docs/users/reference/metrics.md | 112 ++++----- .../developer_documentation/local_actions.md | 56 ++--- f3-sidecar/README.md | 18 +- f3-sidecar/api.go | 24 +- f3-sidecar/ec.go | 6 +- f3-sidecar/ffi_gen.go | 16 +- f3-sidecar/ffi_impl.go | 4 +- f3-sidecar/go.sum | 24 +- f3-sidecar/import.go | 6 +- f3-sidecar/main.go | 4 +- f3-sidecar/manifest.go | 14 +- f3-sidecar/p2p.go | 2 +- f3-sidecar/run.go | 10 +- f3-sidecar/utils.go | 2 +- interop-tests/src/tests/go_app/go.sum | 20 +- scripts/devnet-curio/.env | 4 +- scripts/devnet-curio/README.md | 2 +- scripts/devnet-curio/docker-compose.yml | 8 +- scripts/devnet-curio/run_curio.sh | 2 +- scripts/devnet/.env | 4 +- scripts/devnet/README.md | 2 +- scripts/devnet/check.sh | 4 +- scripts/devnet/docker-compose.yml | 8 +- scripts/tests/api_compare/docker-compose.yml | 2 +- scripts/tests/api_compare/filter-list | 2 +- scripts/tests/api_compare/filter-list-offline | 18 +- scripts/tests/calibnet_eth_mapping_check.sh | 2 +- scripts/tests/calibnet_export_check.sh | 6 +- scripts/tests/calibnet_export_f3_check.sh | 8 +- scripts/tests/calibnet_kademlia_check.sh | 4 +- scripts/tests/calibnet_no_discovery_check.sh | 14 +- scripts/tests/calibnet_other_check.sh | 34 +-- .../tests/calibnet_stateless_mode_check.sh | 2 +- scripts/tests/harness.sh | 24 +- .../serialization-vectors/block_headers.json | 2 +- src/chain/mod.rs | 4 +- src/chain/snapshot_format.rs | 4 +- src/cid_collections/hash_map.rs | 2 +- src/cid_collections/mod.rs | 2 +- src/cli/main.rs | 2 +- src/cli/subcommands/f3_cmd.rs | 152 ++++++------- src/cli/subcommands/f3_cmd/tests.rs | 8 +- src/cli/subcommands/mod.rs | 8 +- src/cli_shared/cli/completion_cmd.rs | 2 +- src/cli_shared/cli/mod.rs | 4 +- src/cli_shared/snapshot.rs | 2 +- src/daemon/db_util.rs | 4 +- src/daemon/main.rs | 2 +- src/daemon/mod.rs | 12 +- src/db/car/mod.rs | 2 +- src/db/car/plain.rs | 2 +- src/f3/go_ffi.rs | 2 +- src/f3/mod.rs | 60 ++--- src/f3/snapshot.rs | 18 +- src/f3/snapshot/tests.rs | 6 +- src/health/endpoints.rs | 6 +- src/libp2p/discovery.rs | 4 +- src/lotus_json/sector_size.rs | 2 +- src/message_pool/msgpool/selection.rs | 2 +- src/message_pool/msgpool/test_provider.rs | 2 +- src/networks/mod.rs | 2 +- src/rpc/client.rs | 2 +- src/rpc/filter_list.rs | 12 +- src/rpc/methods/chain.rs | 6 +- src/rpc/methods/f3.rs | 214 +++++++++--------- src/rpc/methods/f3/types.rs | 126 +++++------ src/rpc/methods/f3/util.rs | 22 +- src/rpc/mod.rs | 30 +-- src/rpc/reflect/mod.rs | 4 +- src/rpc/types/mod.rs | 2 +- src/shim/state_tree.rs | 2 +- src/tool/subcommands/api_cmd.rs | 2 +- .../subcommands/api_cmd/api_compare_tests.rs | 12 +- .../api_cmd/test_snapshots_ignored.txt | 44 ++-- src/tool/subcommands/archive_cmd.rs | 32 +-- src/utils/db/mod.rs | 2 +- .../encoding/fallback_de_ipld_dagcbor.rs | 4 +- src/utils/net.rs | 4 +- 98 files changed, 832 insertions(+), 832 deletions(-) diff --git a/.github/workflows/docs-auto-update.yml b/.github/workflows/docs-auto-update.yml index e7b49ba47fac..9d06466fdbc0 100644 --- a/.github/workflows/docs-auto-update.yml +++ b/.github/workflows/docs-auto-update.yml @@ -1,4 +1,4 @@ -# This workflows, run daily, updates the Forest `CLI` usage docs, and submits a PR with the changes. +# This workflows, run daily, updates the Forest CLI usage docs, and submits a PR with the changes. name: Update Forest usage docs on: @@ -34,9 +34,9 @@ jobs: base: main branch: leshy/update-forest-docs token: ${{ steps.generate-token.outputs.token }} - commit-message: Update Forest `CLI` docs + commit-message: Update Forest CLI docs sign-commits: true - title: "[automated] Update Forest `CLI` docs" + title: "[automated] Update Forest CLI docs" body: | ### Changes - - Updates Forest `CLI` docs to the latest commit in the `main` branch. + - Updates Forest CLI docs to the latest commit in the `main` branch. diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index 8fc218fc86dd..5ffc2e5bf1f8 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -113,7 +113,7 @@ jobs: forest-cli-check: needs: - build-ubuntu - name: Forest `CLI` checks + name: Forest CLI checks runs-on: ubuntu-24.04 steps: - run: lscpu @@ -287,7 +287,7 @@ jobs: calibnet-export-check-v2: needs: - build-ubuntu - name: Snapshot export checks v2 with `F3` data + name: Snapshot export checks v2 with F3 data runs-on: ubuntu-24.04 steps: - run: lscpu diff --git a/CHANGELOG.md b/CHANGELOG.md index a0342c37b8f1..84086fc5e4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,13 +97,13 @@ Non-mandatory release. It introduces a couple of features around snapshot genera - [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `--format` flag to the `forest-cli snapshot export` subcommand. This allows exporting a Filecoin snapshot in v2 format(FRC-0108). -- [#5956](https://github.com/ChainSafe/forest/pull/5956) Add `forest-tool archive f3-header` subcommand for inspecting the header of a standalone `F3` snapshot(FRC-0108). +- [#5956](https://github.com/ChainSafe/forest/pull/5956) Add `forest-tool archive f3-header` subcommand for inspecting the header of a standalone F3 snapshot(FRC-0108). - [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `forest-tool archive metadata` subcommand for inspecting snapshot metadata of a Filecoin snapshot in v2 format(FRC-0108). - [#5859](https://github.com/ChainSafe/forest/pull/5859) Added size metrics for zstd frame cache and made max size configurable via `FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE` environment variable. -- [#5963](https://github.com/ChainSafe/forest/pull/5963) Added `forest-cli f3 ready` command for checking whether `F3` is in sync. +- [#5963](https://github.com/ChainSafe/forest/pull/5963) Added `forest-cli f3 ready` command for checking whether F3 is in sync. - [#5867](https://github.com/ChainSafe/forest/pull/5867) Added `--unordered` to `forest-cli snapshot export` for exporting `CAR` blocks in non-deterministic order for better performance with more parallelization. @@ -111,7 +111,7 @@ Non-mandatory release. It introduces a couple of features around snapshot genera - [#5946](https://github.com/ChainSafe/forest/pull/5946) Added `--verbose` to `forest-cli state compute` for printing epochs and tipset keys along with state roots. -- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a v1 Filecoin snapshot and an `F3` snapshot into a v2 Filecoin snapshot. +- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a v1 Filecoin snapshot and an F3 snapshot into a v2 Filecoin snapshot. - [#4976](https://github.com/ChainSafe/forest/issues/4976) Add support for the `Filecoin.EthSubscribe` and `Filecoin.EthUnsubscribe` API methods to enable subscriptions to Ethereum event types: `heads` and `logs`. @@ -119,7 +119,7 @@ Non-mandatory release. It introduces a couple of features around snapshot genera ### Changed -- [#5886](https://github.com/ChainSafe/forest/issues/5886) Updated `forest-tool archive metadata` to print `F3` snapshot header info when applicable. +- [#5886](https://github.com/ChainSafe/forest/issues/5886) Updated `forest-tool archive metadata` to print F3 snapshot header info when applicable. - [#5869](https://github.com/ChainSafe/forest/pull/5869) Updated `forest-cli snapshot export` to print average speed. @@ -211,7 +211,7 @@ important bug fixes. It also contains a breaking change regarding the `detach` m ## Forest v0.26.1 "Ijon Tichy" -This is a non-mandatory release for all node operators. It includes a fix for the `F3` on mainnet and a few other improvements. It also sets the initial power table CID for `F3` on mainnet. +This is a non-mandatory release for all node operators. It includes a fix for the F3 on mainnet and a few other improvements. It also sets the initial power table CID for F3 on mainnet. ### Breaking @@ -229,7 +229,7 @@ This is a non-mandatory release for all node operators. It includes a fix for th ### Fixed -- [#5609](https://github.com/ChainSafe/forest/pull/5609) Fixed an issue with `F3` on mainnet where the node would not join the KAD network. +- [#5609](https://github.com/ChainSafe/forest/pull/5609) Fixed an issue with F3 on mainnet where the node would not join the KAD network. ## Forest v0.25.3 "Sméagol" @@ -386,7 +386,7 @@ Non-mandatory release without network upgrades. It includes a number of potentia ### Fixed -- [#5111](https://github.com/ChainSafe/forest/issues/5111) Make `F3` work when the node Kademlia is disabled. +- [#5111](https://github.com/ChainSafe/forest/issues/5111) Make F3 work when the node Kademlia is disabled. - [#5122](https://github.com/ChainSafe/forest/issues/5122) Fix a bug in database garbage collection flow. @@ -455,16 +455,16 @@ methods, fixes (notably to the garbage collection), and other improvements. ### Added - [#5010](https://github.com/ChainSafe/forest/pull/5010) Added - `forest-cli f3 certs list` `CLI` command. + `forest-cli f3 certs list` CLI command. - [#4995](https://github.com/ChainSafe/forest/pull/4995) Added - `forest-cli f3 powertable get` `CLI` command. + `forest-cli f3 powertable get` CLI command. - [#5028](https://github.com/ChainSafe/forest/pull/5028) Added - `forest-cli f3 powertable get-proportion` `CLI` command. + `forest-cli f3 powertable get-proportion` CLI command. - [#5054](https://github.com/ChainSafe/forest/pull/5054) Added `--dump-dir` - option to `forest-tool api compare` `CLI` command. + option to `forest-tool api compare` CLI command. - [#4704](https://github.com/ChainSafe/forest/issues/4704) Add support for the `Filecoin.EthGetTransactionReceiptLimited` RPC method. @@ -498,7 +498,7 @@ methods, fixes (notably to the garbage collection), and other improvements. Mandatory release for mainnet node operators. It sets the upgrade epoch for the NV24 _Tuk Tuk_ upgrade to `4_461_240` which corresponds to -`Wed 20 Nov 23:00:00 UTC 2024`. No `F3` support is planned for the NV24, see +`Wed 20 Nov 23:00:00 UTC 2024`. No F3 support is planned for the NV24, see [this post](https://github.com/filecoin-project/core-devs/discussions/150#discussioncomment-11164504) for more details. @@ -512,13 +512,13 @@ for more details. ### Added - [#4937](https://github.com/ChainSafe/forest/pull/4937) Added - `forest-cli f3 manifest` `CLI` command. + `forest-cli f3 manifest` CLI command. - [#4949](https://github.com/ChainSafe/forest/pull/4949) Added - `forest-cli f3 status` `CLI` command. + `forest-cli f3 status` CLI command. - [#4949](https://github.com/ChainSafe/forest/pull/4949) Added - `forest-cli f3 certs get` `CLI` command. + `forest-cli f3 certs get` CLI command. - [#4706](https://github.com/ChainSafe/forest/issues/4706) Add support for the `Filecoin.EthSendRawTransaction` RPC method. @@ -539,20 +539,20 @@ for more details. ## Forest 0.21.1 "Songthaew Plus" This is an optional release for calibration network node operators. It enables -`F3` by default and includes initial power table CID on calibration network. +F3 by default and includes initial power table CID on calibration network. ### Breaking ### Added - [#4910](https://github.com/ChainSafe/forest/issues/4910) Add support for the - `Filecoin.`F3`ListParticipants` RPC method. + `Filecoin.F3ListParticipants` RPC method. - [#4920](https://github.com/ChainSafe/forest/issues/4920) Add support for the - `Filecoin.`F3`GetOrRenewParticipationTicket` RPC method. + `Filecoin.F3GetOrRenewParticipationTicket` RPC method. - [#4924](https://github.com/ChainSafe/forest/issues/4924) Add support for the - `Filecoin.`F3`GetManifest` RPC method. + `Filecoin.F3GetManifest` RPC method. - [#4917](https://github.com/ChainSafe/forest/issues/4917) Support `dnsaddr` in the bootstrap list. @@ -563,10 +563,10 @@ This is an optional release for calibration network node operators. It enables ### Changed - [#4920](https://github.com/ChainSafe/forest/issues/4920) Update - `Filecoin.`F3`Participate` RPC method to align with the spec change. + `Filecoin.F3Participate` RPC method to align with the spec change. - [#4920](https://github.com/ChainSafe/forest/issues/4920) Update - `Filecoin.`F3`ListParticipants` RPC method to align with the spec change. + `Filecoin.F3ListParticipants` RPC method to align with the spec change. ### Removed @@ -579,7 +579,7 @@ This is an optional release for calibration network node operators. It enables This is a mandatory release for calibration network node operators. It includes state migration for the NV24 _TukTuk_ upgrade at epoch `2078794` -2024-10-23T13:30:00Z. It also includes a number of new RPC methods, fixes and `F3` +2024-10-23T13:30:00Z. It also includes a number of new RPC methods, fixes and F3 support. ### Breaking @@ -596,10 +596,10 @@ support. `Filecoin.NetProtectList` RPC method. - [#4865](https://github.com/ChainSafe/forest/issues/4865) Add support for the - `Filecoin.`F3`IsRunning` RPC method. + `Filecoin.F3IsRunning` RPC method. - [#4878](https://github.com/ChainSafe/forest/issues/4878) Add support for the - `Filecoin.`F3`GetProgress` RPC method. + `Filecoin.F3GetProgress` RPC method. - [#4857](https://github.com/ChainSafe/forest/pull/4857) Add support for nv24 (TukTuk). @@ -1569,9 +1569,9 @@ Notable updates: Notable updates: -- `--compressed` option removed from `CLI`, snapshots are now always compressed. +- `--compressed` option removed from CLI, snapshots are now always compressed. - The `dir`, `list`, `prune` and `remove` snapshot commands have been removed - from the `CLI`. + from the CLI. - Snapshots are fetched to current directory by default. - Added new subcommand `forest-cli info show`. - `Filecoin.ChainSetHead` RPC endpoint and `forest-cli chain set-head` @@ -1585,7 +1585,7 @@ Notable updates: ### Breaking - [#2873](https://github.com/ChainSafe/forest/issues/2873) - - remove `--compressed` from the `CLI`. Snapshots are now always compressed. + - remove `--compressed` from the CLI. Snapshots are now always compressed. - Remove snapshot ops - snapshots fetched to the current directory by default. ### Added @@ -1749,9 +1749,9 @@ Notable updates: [#2576](https://github.com/ChainSafe/forest/issues/2576) - Revised how balances are displayed, defaulting to: [#2323](https://github.com/ChainSafe/forest/issues/2323) - - adding metric prefix when it's required, consequently `CLI` flag + - adding metric prefix when it's required, consequently CLI flag `--fixed-unit` added to force to show in original `FIL` unit - - 4 significant digits, consequently `CLI` flag `--exact-balance` added to force + - 4 significant digits, consequently CLI flag `--exact-balance` added to force full accuracy. - `stats` and `compression` keys in `parity_db` section were renamed to `enable_statistics` and `compression_type` respectively. @@ -1778,7 +1778,7 @@ Notable updates: ### Removed - Removed `--halt-after-import` and `--auto-download-snapshot` from - configuration. They are now strictly a `CLI` option. + configuration. They are now strictly a CLI option. [#2528](https://github.com/ChainSafe/forest/issues/2528) [#2573](https://github.com/ChainSafe/forest/issues/2573) @@ -1933,7 +1933,7 @@ Notable updates: - Resolve two security concerns by removing legacy code (RUSTSEC-2020-0071 and RUSTSEC-2021-0130). - Fixed Docker image and released it to GH container registry. -- Network selection (i.e. mainnet vs testnet) moved to a `CLI` flag rather than a +- Network selection (i.e. mainnet vs testnet) moved to a CLI flag rather than a compile-time flag. ## Forest v0.2.2 _alpha_ (2022-04-06) @@ -2185,7 +2185,7 @@ All changes: ([#1295](https://github.com/ChainSafe/forest/pull/1295)) - Remove redundant validation code and update error message to be same as in spec actors ([#1294](https://github.com/ChainSafe/forest/pull/1294)) -- `F3`: fix logic to be the same as in the spec actors +- F3: fix logic to be the same as in the spec actors ([#1292](https://github.com/ChainSafe/forest/pull/1292)) - Attempt to improve gh actions time ([#1319](https://github.com/ChainSafe/forest/pull/1319)) @@ -2216,7 +2216,7 @@ implementation. - It implements all core systems of the Filecoin protocol specification exposed through a command-line interface. - The set of functionalities for this first alpha-release include: Message Pool, - State Manager, Chain and Wallet `CLI` functionality, Prometheus Metrics, and a + State Manager, Chain and Wallet CLI functionality, Prometheus Metrics, and a JSON-RPC Server. To compile release binaries, checkout the `v0.1.0` tag and build with the @@ -2247,7 +2247,7 @@ All initial change sets: ([#1245](https://github.com/ChainSafe/forest/pull/1245)) (Afr Schoe) - `d7e816a7` Update Libp2p to 0.40.0-RC.1 ([#1243](https://github.com/ChainSafe/forest/pull/1243)) (Eric Tu) -- `a33328c9` Mpool `CLI` Commands +- `a33328c9` Mpool CLI Commands ([#1203](https://github.com/ChainSafe/forest/pull/1203)) (Connor Mullett) - `9d4b5291` Create new_issue.md ([#1193](https://github.com/ChainSafe/forest/pull/1193)) (Lee Raj) @@ -2305,9 +2305,9 @@ All initial change sets: ([#1190](https://github.com/ChainSafe/forest/pull/1190)) (Eric Tu) - `d88ea8d1` Added the check for config file via Env Var ([#1197](https://github.com/ChainSafe/forest/pull/1197)) (Elvis) -- `d4a1d044` Chain Sync `CLI` Commands +- `d4a1d044` Chain Sync CLI Commands ([#1175](https://github.com/ChainSafe/forest/pull/1175)) (Connor Mullett) -- `698cf3c3` Additional Net RPC API & `CLI` Methods +- `698cf3c3` Additional Net RPC API & CLI Methods ([#1167](https://github.com/ChainSafe/forest/pull/1167)) (Hunter Trujillo) - `32656db9` `auth api-info` ([#1172](https://github.com/ChainSafe/forest/pull/1172)) (Connor Mullett) @@ -2333,7 +2333,7 @@ All initial change sets: ([#1162](https://github.com/ChainSafe/forest/pull/1162)) (detailyang) - `992e69e3` FOR-15 fix approx_cmp in msg_chain.rs ([#1160](https://github.com/ChainSafe/forest/pull/1160)) (creativcoder) -- `34799734` Wallet `CLI` Implementation +- `34799734` Wallet CLI Implementation ([#1128](https://github.com/ChainSafe/forest/pull/1128)) (Connor Mullett) - `f698ba88` [Audit fixes] FOR-02: Inconsistent Deserialization of Address ID ([#1149](https://github.com/ChainSafe/forest/pull/1149)) (Hunter Trujillo) @@ -2359,7 +2359,7 @@ All initial change sets: ([#1122](https://github.com/ChainSafe/forest/pull/1122)) (Hunter Trujillo) - `81080179` Import/Export StateTree for Testing ([#1114](https://github.com/ChainSafe/forest/pull/1114)) (Eric Tu) -- `b75a4f31` Improve `CLI` printing and RPC error handling. +- `b75a4f31` Improve CLI printing and RPC error handling. ([#1121](https://github.com/ChainSafe/forest/pull/1121)) (Hunter Trujillo) - `a8931e2a` Enable Gossip Scoring ([#1115](https://github.com/ChainSafe/forest/pull/1115)) (Eric Tu) @@ -2889,7 +2889,7 @@ All initial change sets: ([#697](https://github.com/ChainSafe/forest/pull/697)) (nannick) - `548a4645` Print out conformance results and add log for skips ([#695](https://github.com/ChainSafe/forest/pull/695)) (Austin Abell) -- `0d7b16cc` Add `CLI` command to add Genesis Miner to Genesis Template +- `0d7b16cc` Add CLI command to add Genesis Miner to Genesis Template ([#644](https://github.com/ChainSafe/forest/pull/644)) (Stepan) - `0be6b76a` Chain syncing verification fixes ([#503](https://github.com/ChainSafe/forest/pull/503)) (Eric Tu) @@ -3013,7 +3013,7 @@ All initial change sets: ([#591](https://github.com/ChainSafe/forest/pull/591)) (Eric Tu) - `4783a670` Update cron actor ([#588](https://github.com/ChainSafe/forest/pull/588)) (Austin Abell) -- `c642d9a9` JSON client setup and chain `CLI` commands +- `c642d9a9` JSON client setup and chain CLI commands ([#572](https://github.com/ChainSafe/forest/pull/572)) (Dustin Brickwood) - `f80cfab7` Update account actor and params defaults/checks ([#587](https://github.com/ChainSafe/forest/pull/587)) (Austin Abell) @@ -3069,7 +3069,7 @@ All initial change sets: ([#526](https://github.com/ChainSafe/forest/pull/526)) (Austin Abell) - `a2cab731` Implementing Market Balance ([#524](https://github.com/ChainSafe/forest/pull/524)) (nannick) -- `7143e42b` Refactor `CLI` and implement fetch-params +- `7143e42b` Refactor CLI and implement fetch-params ([#516](https://github.com/ChainSafe/forest/pull/516)) (Austin Abell) - `95a2fcc1` Update proofs-api to 4.0.1 ([#523](https://github.com/ChainSafe/forest/pull/523)) (Austin Abell) @@ -3531,7 +3531,7 @@ All initial change sets: ([#69](https://github.com/ChainSafe/forest/pull/69)) (Dustin Brickwood) - `054f25d4` InitActor framework ([#76](https://github.com/ChainSafe/forest/pull/76)) (Austin Abell) -- `d75c8f2e` `CLI` cleanup ([#70](https://github.com/ChainSafe/forest/pull/70)) +- `d75c8f2e` CLI cleanup ([#70](https://github.com/ChainSafe/forest/pull/70)) (Gregory Markou) - `bbea6130` Add config file parsing ([#60](https://github.com/ChainSafe/forest/pull/60)) (Gregory Markou) diff --git a/README.md b/README.md index 65a3ac0c56c9..5695390b13cc 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Docker - works on Linux, macOS and Windows. ❯ docker run --init -it --rm --entrypoint forest-cli ghcr.io/chainsafe/forest:latest --help ``` -Next, run a Forest node in a `CLI` window. E.g. +Next, run a Forest node in a CLI window. E.g. [Run calibration network](https://docs.forest.chainsafe.io/getting_started/syncing/#calibnet) Thereafter, in another terminal, you will be able to use the `forest-cli` binary @@ -57,7 +57,7 @@ tag. ## Dependencies - Rust (toolchain version is specified in `rust-toolchain.toml`) -- Go for building `F3` sidecar module. (toolchain version is specified in +- Go for building F3 sidecar module. (toolchain version is specified in `go.work`) Install [rustup](https://rustup.rs/) @@ -235,16 +235,16 @@ without any prompts. ./target/release/forest --chain calibnet --auto-download-snapshot ``` -### Interacting with Forest via `CLI` +### Interacting with Forest via CLI When the Forest daemon is started, an admin token will be displayed and saved to data directory by default. (alternatively, use `--save-token ` flag to save it on disk). You will need this for commands that require a higher level of authorization (like a password). Forest, as mentioned above, uses multiaddresses for networking. This -is no different in the `CLI`. To set the host and the port to use, if not using +is no different in the CLI. To set the host and the port to use, if not using the default port or using a remote host, set the `FULLNODE_API_INFO` environment variable. This is also where you can set a token for authentication. Note that the token is -automatically set for `CLI` if it is invoked on the same host of the daemon. +automatically set for CLI if it is invoked on the same host of the daemon. ``` FULLNODE_API_INFO=":/ip4//tcp//http @@ -253,7 +253,7 @@ FULLNODE_API_INFO=":/ip4//tcp//http Note that if a token is not present in the FULLNODE_API_INFO env variable, the colon is removed. -Forest developers will prepend this variable to `CLI` commands over using `export` +Forest developers will prepend this variable to CLI commands over using `export` on Linux or its equivalent on Windows. This will look like the following: ``` diff --git a/build.rs b/build.rs index 706d85115b23..f467e5f161d2 100644 --- a/build.rs +++ b/build.rs @@ -14,7 +14,7 @@ fn main() { // Do not build f3-sidecar on docs.rs publishing // No proper version of Go compiler is available. - if !is_docs_rs() && !is_env_truthy("FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT") { + if !is_docs_rs() && !is_env_truthy("FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT") { println!("cargo:rustc-cfg=f3sidecar"); println!("cargo::rerun-if-changed=f3-sidecar"); unsafe { diff --git a/build/bootstrap/butterflynet b/build/bootstrap/butterflynet index 85316ed3a3f8..879c118f8e16 100644 --- a/build/bootstrap/butterflynet +++ b/build/bootstrap/butterflynet @@ -1,2 +1,2 @@ -/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKxHctsqQ41MZ64GYqz5r4DU`F3`Hkj9SMVEcHXdRqvWCAx +/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKxHctsqQ41MZ64GYqz5r4DUF3Hkj9SMVEcHXdRqvWCAx /dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWN69aMyMuf9VrsRir5gd3xkT5q5p9NGYLFSXBTn1xkVSN diff --git a/docs/README.md b/docs/README.md index 6e8b601d83b2..bd5e963c1fb8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,9 +56,9 @@ Available at the root (`/`), default location for anyone visiting the documentat Follows the [Diátaxis](https://diataxis.fr/) framework for structuring documentation. The site is divided into four types of documentation: tutorials (Getting Started), how-to guides (Guides), explanations (Knowledge Base) and reference (Reference). -#### `CLI` Docs +#### CLI Docs -These docs are automatically generated from the Forest `CLI`. See [script](/docs/docs/users/reference/cli.sh). +These docs are automatically generated from the Forest CLI. See [script](/docs/docs/users/reference/cli.sh). #### JSON-RPC Docs diff --git a/docs/dictionary.txt b/docs/dictionary.txt index 93cdc44b90a4..f8d0e617260b 100644 --- a/docs/dictionary.txt +++ b/docs/dictionary.txt @@ -1,5 +1,5 @@ 2k -`APIs` +APIs backend benchmarking blockstore @@ -14,7 +14,7 @@ chainsafe ChainSafe's changelog `CIDs` -`CLI` +CLI cli Cloudflare codebase @@ -29,7 +29,7 @@ DigitalOcean Drand enums Ethereum -`F3` +F3 f3 f3-sidecar FFI diff --git a/docs/docs/users/getting_started/install.md b/docs/docs/users/getting_started/install.md index da5b3b9235bc..09ac1184fae3 100644 --- a/docs/docs/users/getting_started/install.md +++ b/docs/docs/users/getting_started/install.md @@ -77,7 +77,7 @@ More information about Docker setup and usage can be found in the [Docker docume - Rust compiler (install via [rustup](https://rustup.rs/)) - OS `Base-Devel`/`Build-Essential` - Clang compiler -- Go for building `F3` sidecar module +- Go for building F3 sidecar module For Ubuntu, you can install the dependencies (excluding Rust) with: diff --git a/docs/docs/users/guides/advanced/backups.md b/docs/docs/users/guides/advanced/backups.md index 86cbfe276e09..f7b52bc566f8 100644 --- a/docs/docs/users/guides/advanced/backups.md +++ b/docs/docs/users/guides/advanced/backups.md @@ -57,6 +57,6 @@ up the entire Forest data directory. Note that this includes the whole blockstore, which, for mainnet, can reach hundreds of gigabytes. It is not recommended outside development. -### `CLI` reference +### CLI reference -Details on the `forest-tool backup` command and its subcommands can be found at the [`CLI` reference](../../reference/cli.md#forest-tool-backup). +Details on the `forest-tool backup` command and its subcommands can be found at the [CLI reference](../../reference/cli.md#forest-tool-backup). diff --git a/docs/docs/users/guides/advanced/generating_snapshots.md b/docs/docs/users/guides/advanced/generating_snapshots.md index bc6c4673718d..931f63fc335f 100644 --- a/docs/docs/users/guides/advanced/generating_snapshots.md +++ b/docs/docs/users/guides/advanced/generating_snapshots.md @@ -36,6 +36,6 @@ compressed. For mainnet, you should expect a file of over 70 GB. For calibnet, you should expect a file of over 5 GB. Note that the snapshot size grows over time. -### `CLI` reference +### CLI reference -Details on the `forest-cli snapshot export` command and its subcommands can be found at the [`CLI` reference](../../reference/cli.md#forest-cli-snapshot). +Details on the `forest-cli snapshot export` command and its subcommands can be found at the [CLI reference](../../reference/cli.md#forest-cli-snapshot). diff --git a/docs/docs/users/introduction.md b/docs/docs/users/introduction.md index f42b3e1bb5be..a4f610ffc04b 100644 --- a/docs/docs/users/introduction.md +++ b/docs/docs/users/introduction.md @@ -40,7 +40,7 @@ Forest consists of multiple binaries: - `forest-tool` - Utilities for maintaining and debugging Forest - `forest-wallet` - Manage the built-in wallet -Check out the [`CLI` docs](./reference/cli.md) for more details. +Check out the [CLI docs](./reference/cli.md) for more details. ## Roadmap Updates diff --git a/docs/docs/users/knowledge_base/docker_tips.md b/docs/docs/users/knowledge_base/docker_tips.md index 125c6ba4e2b9..1d61ecd94152 100644 --- a/docs/docs/users/knowledge_base/docker_tips.md +++ b/docs/docs/users/knowledge_base/docker_tips.md @@ -70,7 +70,7 @@ docker run --init -it --rm --entrypoint forest-tool ghcr.io/chainsafe/forest:lat docker run --init -it --rm --entrypoint forest-wallet ghcr.io/chainsafe/forest:latest --help ``` -Also see the [`CLI` documentation](../reference/cli.md) for more details about commands and +Also see the [CLI documentation](../reference/cli.md) for more details about commands and their usage. ### Run a Forest node with custom environment variables diff --git a/docs/docs/users/knowledge_base/jwt_handling.md b/docs/docs/users/knowledge_base/jwt_handling.md index 3a51637303df..628656d6db86 100644 --- a/docs/docs/users/knowledge_base/jwt_handling.md +++ b/docs/docs/users/knowledge_base/jwt_handling.md @@ -63,7 +63,7 @@ The admin token is assumed to be stored in `/tmp/token` for the following exampl ### via `forest-cli` -The most straightforward way to use tokens is to pass them to the `forest-cli` tool. This can be done either by passing it via the `--token` flag or by setting the `FULLNODE_API_INFO` environment variable. Note that the token is automatically set for `CLI` if it is invoked on the same host of the daemon. +The most straightforward way to use tokens is to pass them to the `forest-cli` tool. This can be done either by passing it via the `--token` flag or by setting the `FULLNODE_API_INFO` environment variable. Note that the token is automatically set for CLI if it is invoked on the same host of the daemon. ```bash forest-cli --token $(cat /tmp/token) shutdown diff --git a/docs/docs/users/knowledge_base/snapshot_service.md b/docs/docs/users/knowledge_base/snapshot_service.md index 1dc0459cb055..447f2db70a0b 100644 --- a/docs/docs/users/knowledge_base/snapshot_service.md +++ b/docs/docs/users/knowledge_base/snapshot_service.md @@ -36,7 +36,7 @@ Forest produces snapshots compatible with Lotus, with much faster generation tim This benchmark was performed on a bare metal server with the following specifications: -- `AMD EPYC 7`F3`2 8-Core Processor` +- `AMD EPYC 7F32 8-Core Processor` - `512 GiB RAM` - `4 TiB NVMe SSD` diff --git a/docs/docs/users/openrpc.json b/docs/docs/users/openrpc.json index 371c64fe1f9b..0812d957a7c9 100644 --- a/docs/docs/users/openrpc.json +++ b/docs/docs/users/openrpc.json @@ -6,18 +6,18 @@ }, "methods": [ { - "name": "`F3`.Finalize", + "name": "F3.Finalize", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSetKey" + "$ref": "#/components/schemas/F3TipSetKey" } } ], "result": { - "name": "`F3`.Finalize.Result", + "name": "F3.Finalize.Result", "required": true, "schema": { "type": "null" @@ -26,42 +26,42 @@ "paramStructure": "by-position" }, { - "name": "`F3`.GetHead", + "name": "F3.GetHead", "params": [], "result": { - "name": "`F3`.GetHead.Result", + "name": "F3.GetHead.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSet" + "$ref": "#/components/schemas/F3TipSet" } }, "paramStructure": "by-position" }, { - "name": "`F3`.GetParent", + "name": "F3.GetParent", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSetKey" + "$ref": "#/components/schemas/F3TipSetKey" } } ], "result": { - "name": "`F3`.GetParent.Result", + "name": "F3.GetParent.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSet" + "$ref": "#/components/schemas/F3TipSet" } }, "paramStructure": "by-position" }, { - "name": "`F3`.GetParticipatingMinerIDs", + "name": "F3.GetParticipatingMinerIDs", "params": [], "result": { - "name": "`F3`.GetParticipatingMinerIDs.Result", + "name": "F3.GetParticipatingMinerIDs.Result", "required": false, "schema": { "type": [ @@ -78,18 +78,18 @@ "paramStructure": "by-position" }, { - "name": "`F3`.GetPowerTable", + "name": "F3.GetPowerTable", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSetKey" + "$ref": "#/components/schemas/F3TipSetKey" } } ], "result": { - "name": "`F3`.GetPowerTable.Result", + "name": "F3.GetPowerTable.Result", "required": false, "schema": { "type": [ @@ -97,17 +97,17 @@ "null" ], "items": { - "$ref": "#/components/schemas/`F3`PowerEntry" + "$ref": "#/components/schemas/F3PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "`F3`.GetRawNetworkName", + "name": "F3.GetRawNetworkName", "params": [], "result": { - "name": "`F3`.GetRawNetworkName.Result", + "name": "F3.GetRawNetworkName.Result", "required": true, "schema": { "type": "string" @@ -116,27 +116,27 @@ "paramStructure": "by-position" }, { - "name": "`F3`.GetTipset", + "name": "F3.GetTipset", "params": [ { "name": "tipset_key", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSetKey" + "$ref": "#/components/schemas/F3TipSetKey" } } ], "result": { - "name": "`F3`.GetTipset.Result", + "name": "F3.GetTipset.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSet" + "$ref": "#/components/schemas/F3TipSet" } }, "paramStructure": "by-position" }, { - "name": "`F3`.GetTipsetByEpoch", + "name": "F3.GetTipsetByEpoch", "params": [ { "name": "epoch", @@ -148,16 +148,16 @@ } ], "result": { - "name": "`F3`.GetTipsetByEpoch.Result", + "name": "F3.GetTipsetByEpoch.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`TipSet" + "$ref": "#/components/schemas/F3TipSet" } }, "paramStructure": "by-position" }, { - "name": "`F3`.ProtectPeer", + "name": "F3.ProtectPeer", "params": [ { "name": "peer_id", @@ -168,7 +168,7 @@ } ], "result": { - "name": "`F3`.ProtectPeer.Result", + "name": "F3.ProtectPeer.Result", "required": true, "schema": { "type": "boolean" @@ -177,7 +177,7 @@ "paramStructure": "by-position" }, { - "name": "`F3`.SignMessage", + "name": "F3.SignMessage", "params": [ { "name": "pubkey", @@ -195,7 +195,7 @@ } ], "result": { - "name": "`F3`.SignMessage.Result", + "name": "F3.SignMessage.Result", "required": true, "schema": { "$ref": "#/components/schemas/Signature" @@ -1730,7 +1730,7 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetCertificate", + "name": "Filecoin.F3GetCertificate", "params": [ { "name": "instance", @@ -1743,7 +1743,7 @@ } ], "result": { - "name": "Filecoin.`F3`GetCertificate.Result", + "name": "Filecoin.F3GetCertificate.Result", "required": true, "schema": { "$ref": "#/components/schemas/FinalityCertificate" @@ -1752,7 +1752,7 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetECPowerTable", + "name": "Filecoin.F3GetECPowerTable", "params": [ { "name": "tipset_key", @@ -1769,7 +1769,7 @@ } ], "result": { - "name": "Filecoin.`F3`GetECPowerTable.Result", + "name": "Filecoin.F3GetECPowerTable.Result", "required": false, "schema": { "type": [ @@ -1777,14 +1777,14 @@ "null" ], "items": { - "$ref": "#/components/schemas/`F3`PowerEntry" + "$ref": "#/components/schemas/F3PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`Get`F3`PowerTable", + "name": "Filecoin.F3GetF3PowerTable", "params": [ { "name": "tipset_key", @@ -1801,7 +1801,7 @@ } ], "result": { - "name": "Filecoin.`F3`Get`F3`PowerTable.Result", + "name": "Filecoin.F3GetF3PowerTable.Result", "required": false, "schema": { "type": [ @@ -1809,17 +1809,17 @@ "null" ], "items": { - "$ref": "#/components/schemas/`F3`PowerEntry" + "$ref": "#/components/schemas/F3PowerEntry" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetLatestCertificate", + "name": "Filecoin.F3GetLatestCertificate", "params": [], "result": { - "name": "Filecoin.`F3`GetLatestCertificate.Result", + "name": "Filecoin.F3GetLatestCertificate.Result", "required": true, "schema": { "$ref": "#/components/schemas/FinalityCertificate" @@ -1828,19 +1828,19 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetManifest", + "name": "Filecoin.F3GetManifest", "params": [], "result": { - "name": "Filecoin.`F3`GetManifest.Result", + "name": "Filecoin.F3GetManifest.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`Manifest" + "$ref": "#/components/schemas/F3Manifest" } }, "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetOrRenewParticipationTicket", + "name": "Filecoin.F3GetOrRenewParticipationTicket", "params": [ { "name": "miner_address", @@ -1867,7 +1867,7 @@ } ], "result": { - "name": "Filecoin.`F3`GetOrRenewParticipationTicket.Result", + "name": "Filecoin.F3GetOrRenewParticipationTicket.Result", "required": true, "schema": { "$ref": "#/components/schemas/Base64String" @@ -1876,22 +1876,22 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`GetProgress", + "name": "Filecoin.F3GetProgress", "params": [], "result": { - "name": "Filecoin.`F3`GetProgress.Result", + "name": "Filecoin.F3GetProgress.Result", "required": true, "schema": { - "$ref": "#/components/schemas/`F3`InstanceProgress" + "$ref": "#/components/schemas/F3InstanceProgress" } }, "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`IsRunning", + "name": "Filecoin.F3IsRunning", "params": [], "result": { - "name": "Filecoin.`F3`IsRunning.Result", + "name": "Filecoin.F3IsRunning.Result", "required": true, "schema": { "type": "boolean" @@ -1900,10 +1900,10 @@ "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`ListParticipants", + "name": "Filecoin.F3ListParticipants", "params": [], "result": { - "name": "Filecoin.`F3`ListParticipants.Result", + "name": "Filecoin.F3ListParticipants.Result", "required": false, "schema": { "type": [ @@ -1911,14 +1911,14 @@ "null" ], "items": { - "$ref": "#/components/schemas/`F3`Participant" + "$ref": "#/components/schemas/F3Participant" } } }, "paramStructure": "by-position" }, { - "name": "Filecoin.`F3`Participate", + "name": "Filecoin.F3Participate", "params": [ { "name": "lease_ticket", @@ -1929,10 +1929,10 @@ } ], "result": { - "name": "Filecoin.`F3`Participate.Result", + "name": "Filecoin.F3Participate.Result", "required": true, "schema": { - "$ref": "#/components/schemas/Api`F3`ParticipationLease" + "$ref": "#/components/schemas/ApiF3ParticipationLease" } }, "paramStructure": "by-position" @@ -7130,8 +7130,8 @@ "s" ] }, - "Api`F3`ParticipationLease": { - "description": "defines the lease granted to a storage provider for\nparticipating in `F3` consensus, detailing the session identifier, issuer,\nsubject, and the expiration instance.", + "ApiF3ParticipationLease": { + "description": "defines the lease granted to a storage provider for\nparticipating in F3 consensus, detailing the session identifier, issuer,\nsubject, and the expiration instance.", "type": "object", "properties": { "FromInstance": { @@ -8788,7 +8788,7 @@ "SealedCID" ] }, - "`F3`InstanceProgress": { + "F3InstanceProgress": { "type": "object", "properties": { "ID": { @@ -8817,7 +8817,7 @@ "Phase" ] }, - "`F3`Manifest": { + "F3Manifest": { "type": "object", "properties": { "BootstrapEpoch": { @@ -8885,7 +8885,7 @@ "PartialMessageManager" ] }, - "`F3`Participant": { + "F3Participant": { "type": "object", "properties": { "FromInstance": { @@ -8910,7 +8910,7 @@ "ValidityTerm" ] }, - "`F3`PowerEntry": { + "F3PowerEntry": { "description": "PowerEntry represents a single entry in the PowerTable, including ActorID and its StoragePower and PubKey.", "type": "object", "properties": { @@ -8932,7 +8932,7 @@ "PubKey" ] }, - "`F3`TipSet": { + "F3TipSet": { "type": "object", "properties": { "beacon": { @@ -8945,7 +8945,7 @@ "format": "int64" }, "key": { - "$ref": "#/components/schemas/`F3`TipSetKey" + "$ref": "#/components/schemas/F3TipSetKey" }, "timestamp": { "description": "Block creation time, in seconds since the Unix epoch", @@ -8961,7 +8961,7 @@ "timestamp" ] }, - "`F3`TipSetKey": { + "F3TipSetKey": { "description": "TipSetKey is the canonically ordered concatenation of the block `CIDs` in a tipset.", "type": "string" }, diff --git a/docs/docs/users/reference/cli.md b/docs/docs/users/reference/cli.md index 20984cff31fe..317c9aa8c651 100644 --- a/docs/docs/users/reference/cli.md +++ b/docs/docs/users/reference/cli.md @@ -4,7 +4,7 @@ sidebar_position: 1 --- @@ -340,7 +340,7 @@ SUBCOMMANDS: info Print node info shutdown Shutdown Forest healthcheck Print healthcheck info - f3 Manages Filecoin Fast Finality (`F3`) interactions + f3 Manages Filecoin Fast Finality (F3) interactions wait-api Wait for lotus API to come online help Print this message or the help of the given subcommand(s) @@ -830,16 +830,16 @@ Options: ### `forest-cli f3` ``` -Manages Filecoin Fast Finality (`F3`) interactions +Manages Filecoin Fast Finality (F3) interactions Usage: forest-cli f3 Commands: - manifest Gets the current manifest used by `F3` - status Checks the `F3` status - certs Manages interactions with `F3` finality certificates [aliases: c] - powertable Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: pt] - ready Checks if `F3` is in sync + manifest Gets the current manifest used by F3 + status Checks the F3 status + certs Manages interactions with F3 finality certificates [aliases: c] + powertable Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: pt] + ready Checks if F3 is in sync help Print this message or the help of the given subcommand(s) Options: @@ -849,7 +849,7 @@ Options: ### `forest-cli f3 manifest` ``` -Gets the current manifest used by `F3` +Gets the current manifest used by F3 Usage: forest-cli f3 manifest [OPTIONS] @@ -870,7 +870,7 @@ Options: ### `forest-cli f3 status` ``` -Checks the `F3` status +Checks the F3 status Usage: forest-cli f3 status @@ -881,13 +881,13 @@ Options: ### `forest-cli f3 certs` ``` -Manages interactions with `F3` finality certificates +Manages interactions with F3 finality certificates Usage: forest-cli f3 certs Commands: - get Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified - list Lists a range of `F3` finality certificates + get Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified + list Lists a range of F3 finality certificates help Print this message or the help of the given subcommand(s) Options: @@ -897,7 +897,7 @@ Options: ### `forest-cli f3 certs get` ``` -Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified +Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified Usage: forest-cli f3 certs get [OPTIONS] [INSTANCE] @@ -922,7 +922,7 @@ Options: ### `forest-cli f3 certs list` ``` -Lists a range of `F3` finality certificates +Lists a range of F3 finality certificates Usage: forest-cli f3 certs list [OPTIONS] [RANGE] @@ -955,12 +955,12 @@ Options: ### `forest-cli f3 powertable` ``` -Gets `F3` power table at a specific instance ID or latest instance if none is specified +Gets F3 power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable Commands: - get Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: g] + get Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: g] get-proportion Gets the total proportion of power for a list of actors at a given instance [aliases: gp] help Print this message or the help of the given subcommand(s) @@ -971,7 +971,7 @@ Options: ### `forest-cli f3 powertable get` ``` -Gets `F3` power table at a specific instance ID or latest instance if none is specified +Gets F3 power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable get [OPTIONS] [INSTANCE] @@ -1002,17 +1002,17 @@ Options: ### `forest-cli f3 ready` ``` -Checks if `F3` is in sync +Checks if F3 is in sync Usage: forest-cli f3 ready [OPTIONS] Options: --wait - Wait until `F3` is in sync + Wait until F3 is in sync --threshold - The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync [default: 20] + The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync [default: 20] --no-progress-timeout - Exit after `F3` making no progress for this duration [default: 10m] + Exit after F3 making no progress for this duration [default: 10m] -h, --help Print help ``` @@ -1040,7 +1040,7 @@ SUBCOMMANDS: api API tooling net Network utilities shed Miscellaneous, semver-exempt commands for developer use - completion Completion Command for generating shell completions for the `CLI` + completion Completion Command for generating shell completions for the CLI help Print this message or the help of the given subcommand(s) OPTIONS: @@ -1067,7 +1067,7 @@ Options: ### `forest-tool completion` ``` -Completion Command for generating shell completions for the `CLI` +Completion Command for generating shell completions for the CLI Usage: forest-tool completion [OPTIONS] [BINARIES]... @@ -1403,11 +1403,11 @@ Usage: forest-tool archive Commands: info Show basic information about an archive metadata Show FRC-0108 metadata of an Filecoin snapshot archive - f3-header Show FRC-0108 header of a standalone `F3` snapshot + f3-header Show FRC-0108 header of a standalone F3 snapshot export Trim a snapshot of the chain and write it to `` checkpoints Print block headers at 30 day interval for a snapshot file merge Merge snapshot archives into a single file. The output snapshot refers to the heaviest tipset in the input set - merge-f3 Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format + merge-f3 Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format diff Show the difference between the canonical and computed state of a tipset sync-bucket Export lite and diff snapshots from one or more CAR files, and upload them to an `S3` bucket help Print this message or the help of the given subcommand(s) @@ -1468,12 +1468,12 @@ Options: ### `forest-tool archive f3-header` ``` -Show FRC-0108 header of a standalone `F3` snapshot +Show FRC-0108 header of a standalone F3 snapshot Usage: forest-tool archive f3-header Arguments: - Path to a standalone `F3` snapshot + Path to a standalone F3 snapshot Options: -h, --help Print help @@ -1513,13 +1513,13 @@ Options: ### `forest-tool archive merge-f3` ``` -Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format +Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format -Usage: forest-tool archive merge-f3 --v1 --f3 <`F3`> --output +Usage: forest-tool archive merge-f3 --v1 --f3 --output Options: --v1 Path to the v1 Filecoin snapshot - --f3 <`F3`> Path to the `F3` snapshot + --f3 Path to the F3 snapshot --output Path to the snapshot output file in `.forest.car.zst` format -h, --help Print help ``` diff --git a/docs/docs/users/reference/env_variables.md b/docs/docs/users/reference/env_variables.md index 04244f4be7cd..3457e8efd7c1 100644 --- a/docs/docs/users/reference/env_variables.md +++ b/docs/docs/users/reference/env_variables.md @@ -5,7 +5,7 @@ sidebar_position: 2 # Environment variables -Besides `CLI` options and the configuration values in the configuration file, +Besides CLI options and the configuration values in the configuration file, there are some environment variables that control the behavior of a `forest` process. @@ -32,14 +32,14 @@ process. | `RUST_LOG` | string | empty | `debug,forest_libp2p::service=info` | Allows for log level customization. | | `FOREST_IGNORE_DRAND` | 1 or true | empty | 1 | Ignore Drand validation. | | `FOREST_LIBP2P_METRICS_ENABLED` | 1 or true | empty | 1 | Include `libp2p` metrics in Forest's Prometheus output. | -| `FOREST_`F3`_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of `F3` sidecar. | -| `FOREST_`F3`_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the `F3` sidecar via FFI | -| `FOREST_`F3`_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the `F3` consensus to the node | -| `FOREST_`F3`_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in `F3` manifest | -| `FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in `F3` permanently | -| `FOREST_`F3`_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the `F3` initial power table CID | -| `FOREST_`F3`_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for `F3` | -| `FOREST_`F3`_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for `F3` | +| `FOREST_F3_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of F3 sidecar. | +| `FOREST_F3_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the F3 sidecar via FFI | +| `FOREST_F3_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the F3 consensus to the node | +| `FOREST_F3_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in F3 manifest | +| `FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in F3 permanently | +| `FOREST_F3_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the F3 initial power table CID | +| `FOREST_F3_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for F3 | +| `FOREST_F3_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for F3 | | `FOREST_DRAND_MAINNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_MAINNET` config | | `FOREST_DRAND_QUICKNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_QUICKNET` config | | `FOREST_TRACE_FILTER_MAX_RESULT` | positive integer | 500 | 1000 | Sets the maximum results returned per request by `trace_filter` | @@ -51,13 +51,13 @@ process. | `FOREST_DISABLE_BAD_BLOCK_CACHE` | 1 or true | empty | 1 | Whether or not to disable bad block cache | | `FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE` | positive integer | 268435456 | 536870912 | The default zstd frame cache max size in bytes | -### `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT` +### `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT` This is an environment variable that allows users to opt out of building the f3-sidecar. It's only useful when building the binary. By default, the Go f3-sidecar is built and linked into Forest binary unless environment -variable `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. +variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. ### `FOREST_DB_DEV_MODE` diff --git a/docs/docs/users/reference/generate_cli_md.sh b/docs/docs/users/reference/generate_cli_md.sh index d0261f6664bc..a3c482ee52db 100755 --- a/docs/docs/users/reference/generate_cli_md.sh +++ b/docs/docs/users/reference/generate_cli_md.sh @@ -16,7 +16,7 @@ sidebar_position: 1 --- diff --git a/docs/docs/users/reference/json_rpc_overview.md b/docs/docs/users/reference/json_rpc_overview.md index 0d6613fab78a..0f0697b04664 100644 --- a/docs/docs/users/reference/json_rpc_overview.md +++ b/docs/docs/users/reference/json_rpc_overview.md @@ -27,7 +27,7 @@ Until June 2025, the Lotus [V0](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v0-deprecated.md) and [V1](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v1-stable.md) -`APIs` served as the reference for Forest's implementation. +APIs served as the reference for Forest's implementation. Since June 2025, the [Common Node API](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0104.md) has been the standard for RPC methods across Filecoin clients, replacing the Lotus-specific API as the primary reference for V1 methods. @@ -39,7 +39,7 @@ An FIP to establish a canonical RPC API specification for general use [has been ## Connecting To A Node -By default, Forest exposes the RPC API on `localhost:2345`. See [`CLI` docs](./cli.md) for configuration options. +By default, Forest exposes the RPC API on `localhost:2345`. See [CLI docs](./cli.md) for configuration options. ### Authentication diff --git a/docs/docs/users/reference/metrics.md b/docs/docs/users/reference/metrics.md index 9933ab2621b0..9ad3cb27afb1 100644 --- a/docs/docs/users/reference/metrics.md +++ b/docs/docs/users/reference/metrics.md @@ -89,22 +89,22 @@ lru_cache_miss_total{kind="tipset"} 7046 ``` # HELP rpc_processing_time Duration of RPC method call in milliseconds. # TYPE rpc_processing_time histogram -rpc_processing_time_sum{method="`F3`.GetHead"} 0.7877869999999999 -rpc_processing_time_count{method="`F3`.GetHead"} 30 -rpc_processing_time_bucket{le="0.1",method="`F3`.GetHead"} 29 -rpc_processing_time_bucket{le="1.0",method="`F3`.GetHead"} 30 -rpc_processing_time_bucket{le="10.0",method="`F3`.GetHead"} 30 -rpc_processing_time_bucket{le="100.0",method="`F3`.GetHead"} 30 -rpc_processing_time_bucket{le="1000.0",method="`F3`.GetHead"} 30 -rpc_processing_time_bucket{le="+Inf",method="`F3`.GetHead"} 30 -rpc_processing_time_sum{method="`F3`.GetPowerTable"} 406.521251 -rpc_processing_time_count{method="`F3`.GetPowerTable"} 7 -rpc_processing_time_bucket{le="0.1",method="`F3`.GetPowerTable"} 0 -rpc_processing_time_bucket{le="1.0",method="`F3`.GetPowerTable"} 0 -rpc_processing_time_bucket{le="10.0",method="`F3`.GetPowerTable"} 4 -rpc_processing_time_bucket{le="100.0",method="`F3`.GetPowerTable"} 6 -rpc_processing_time_bucket{le="1000.0",method="`F3`.GetPowerTable"} 7 -rpc_processing_time_bucket{le="+Inf",method="`F3`.GetPowerTable"} 7 +rpc_processing_time_sum{method="F3.GetHead"} 0.7877869999999999 +rpc_processing_time_count{method="F3.GetHead"} 30 +rpc_processing_time_bucket{le="0.1",method="F3.GetHead"} 29 +rpc_processing_time_bucket{le="1.0",method="F3.GetHead"} 30 +rpc_processing_time_bucket{le="10.0",method="F3.GetHead"} 30 +rpc_processing_time_bucket{le="100.0",method="F3.GetHead"} 30 +rpc_processing_time_bucket{le="1000.0",method="F3.GetHead"} 30 +rpc_processing_time_bucket{le="+Inf",method="F3.GetHead"} 30 +rpc_processing_time_sum{method="F3.GetPowerTable"} 406.521251 +rpc_processing_time_count{method="F3.GetPowerTable"} 7 +rpc_processing_time_bucket{le="0.1",method="F3.GetPowerTable"} 0 +rpc_processing_time_bucket{le="1.0",method="F3.GetPowerTable"} 0 +rpc_processing_time_bucket{le="10.0",method="F3.GetPowerTable"} 4 +rpc_processing_time_bucket{le="100.0",method="F3.GetPowerTable"} 6 +rpc_processing_time_bucket{le="1000.0",method="F3.GetPowerTable"} 7 +rpc_processing_time_bucket{le="+Inf",method="F3.GetPowerTable"} 7 rpc_processing_time_sum{method="Filecoin.NetAddrsListen"} 434.141625 rpc_processing_time_count{method="Filecoin.NetAddrsListen"} 1 rpc_processing_time_bucket{le="0.1",method="Filecoin.NetAddrsListen"} 0 @@ -113,46 +113,46 @@ rpc_processing_time_bucket{le="10.0",method="Filecoin.NetAddrsListen"} 0 rpc_processing_time_bucket{le="100.0",method="Filecoin.NetAddrsListen"} 0 rpc_processing_time_bucket{le="1000.0",method="Filecoin.NetAddrsListen"} 1 rpc_processing_time_bucket{le="+Inf",method="Filecoin.NetAddrsListen"} 1 -rpc_processing_time_sum{method="`F3`.GetParticipatingMinerIDs"} 51.30074899999999 -rpc_processing_time_count{method="`F3`.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="0.1",method="`F3`.GetParticipatingMinerIDs"} 0 -rpc_processing_time_bucket{le="1.0",method="`F3`.GetParticipatingMinerIDs"} 39 -rpc_processing_time_bucket{le="10.0",method="`F3`.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="100.0",method="`F3`.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="1000.0",method="`F3`.GetParticipatingMinerIDs"} 58 -rpc_processing_time_bucket{le="+Inf",method="`F3`.GetParticipatingMinerIDs"} 58 -rpc_processing_time_sum{method="`F3`.GetTipset"} 0.282751 -rpc_processing_time_count{method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="0.1",method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="1.0",method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="10.0",method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="100.0",method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="1000.0",method="`F3`.GetTipset"} 8 -rpc_processing_time_bucket{le="+Inf",method="`F3`.GetTipset"} 8 -rpc_processing_time_sum{method="`F3`.Finalize"} 12.134668999999999 -rpc_processing_time_count{method="`F3`.Finalize"} 26 -rpc_processing_time_bucket{le="0.1",method="`F3`.Finalize"} 1 -rpc_processing_time_bucket{le="1.0",method="`F3`.Finalize"} 23 -rpc_processing_time_bucket{le="10.0",method="`F3`.Finalize"} 26 -rpc_processing_time_bucket{le="100.0",method="`F3`.Finalize"} 26 -rpc_processing_time_bucket{le="1000.0",method="`F3`.Finalize"} 26 -rpc_processing_time_bucket{le="+Inf",method="`F3`.Finalize"} 26 -rpc_processing_time_sum{method="`F3`.GetParent"} 0.306957 -rpc_processing_time_count{method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="0.1",method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="1.0",method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="10.0",method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="100.0",method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="1000.0",method="`F3`.GetParent"} 10 -rpc_processing_time_bucket{le="+Inf",method="`F3`.GetParent"} 10 -rpc_processing_time_sum{method="`F3`.ProtectPeer"} 0.164208 -rpc_processing_time_count{method="`F3`.ProtectPeer"} 1 -rpc_processing_time_bucket{le="0.1",method="`F3`.ProtectPeer"} 0 -rpc_processing_time_bucket{le="1.0",method="`F3`.ProtectPeer"} 1 -rpc_processing_time_bucket{le="10.0",method="`F3`.ProtectPeer"} 1 -rpc_processing_time_bucket{le="100.0",method="`F3`.ProtectPeer"} 1 -rpc_processing_time_bucket{le="1000.0",method="`F3`.ProtectPeer"} 1 -rpc_processing_time_bucket{le="+Inf",method="`F3`.ProtectPeer"} 1 +rpc_processing_time_sum{method="F3.GetParticipatingMinerIDs"} 51.30074899999999 +rpc_processing_time_count{method="F3.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="0.1",method="F3.GetParticipatingMinerIDs"} 0 +rpc_processing_time_bucket{le="1.0",method="F3.GetParticipatingMinerIDs"} 39 +rpc_processing_time_bucket{le="10.0",method="F3.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="100.0",method="F3.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="1000.0",method="F3.GetParticipatingMinerIDs"} 58 +rpc_processing_time_bucket{le="+Inf",method="F3.GetParticipatingMinerIDs"} 58 +rpc_processing_time_sum{method="F3.GetTipset"} 0.282751 +rpc_processing_time_count{method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="0.1",method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="1.0",method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="10.0",method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="100.0",method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="1000.0",method="F3.GetTipset"} 8 +rpc_processing_time_bucket{le="+Inf",method="F3.GetTipset"} 8 +rpc_processing_time_sum{method="F3.Finalize"} 12.134668999999999 +rpc_processing_time_count{method="F3.Finalize"} 26 +rpc_processing_time_bucket{le="0.1",method="F3.Finalize"} 1 +rpc_processing_time_bucket{le="1.0",method="F3.Finalize"} 23 +rpc_processing_time_bucket{le="10.0",method="F3.Finalize"} 26 +rpc_processing_time_bucket{le="100.0",method="F3.Finalize"} 26 +rpc_processing_time_bucket{le="1000.0",method="F3.Finalize"} 26 +rpc_processing_time_bucket{le="+Inf",method="F3.Finalize"} 26 +rpc_processing_time_sum{method="F3.GetParent"} 0.306957 +rpc_processing_time_count{method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="0.1",method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="1.0",method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="10.0",method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="100.0",method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="1000.0",method="F3.GetParent"} 10 +rpc_processing_time_bucket{le="+Inf",method="F3.GetParent"} 10 +rpc_processing_time_sum{method="F3.ProtectPeer"} 0.164208 +rpc_processing_time_count{method="F3.ProtectPeer"} 1 +rpc_processing_time_bucket{le="0.1",method="F3.ProtectPeer"} 0 +rpc_processing_time_bucket{le="1.0",method="F3.ProtectPeer"} 1 +rpc_processing_time_bucket{le="10.0",method="F3.ProtectPeer"} 1 +rpc_processing_time_bucket{le="100.0",method="F3.ProtectPeer"} 1 +rpc_processing_time_bucket{le="1000.0",method="F3.ProtectPeer"} 1 +rpc_processing_time_bucket{le="+Inf",method="F3.ProtectPeer"} 1 rpc_processing_time_sum{method="Filecoin.StateNetworkName"} 4.00525 rpc_processing_time_count{method="Filecoin.StateNetworkName"} 1 rpc_processing_time_bucket{le="0.1",method="Filecoin.StateNetworkName"} 0 diff --git a/documentation/src/developer_documentation/local_actions.md b/documentation/src/developer_documentation/local_actions.md index dbdccc314390..817589e0ff2c 100644 --- a/documentation/src/developer_documentation/local_actions.md +++ b/documentation/src/developer_documentation/local_actions.md @@ -28,7 +28,7 @@ is based on an older Ubuntu base. You can always edit this later in Let's consider running an integration test. At the time of writing, the usual workflow looks like this: -1. Build Forest daemon and `CLI` in one job. +1. Build Forest daemon and CLI in one job. 2. Upload the artifacts to GH. 3. In another job, download the artifacts to the test runner. 4. Run the integration test. @@ -144,7 +144,7 @@ download the artifacts. # Example run After all the remarks above are addressed, you can run the job locally. For -example, to run the integration test for the `CLI`: +example, to run the integration test for the CLI: ```shell act --secret-file act-secrets.env --env-file act.env -W .github/workflows/forest.yml -j forest-cli-check --artifact-server-path /tmp/artifacts/ --reuse @@ -183,32 +183,32 @@ INFO[0000] Start server on http://192.168.1.10:34567 [Integration tests/Build Ubuntu] 🐳 docker exec cmd=[node /var/run/act/actions/actions-upload-artifact@v3/dist/index.js] user= workdir= [Integration tests/Build Ubuntu] ✅ Success - Main actions/upload-artifact@v3 [Integration tests/Build Ubuntu] 🏁 Job succeeded -[Integration tests/Forest `CLI` checks] 🚀 Start image=catthehacker/ubuntu:act-latest -[Integration tests/Forest `CLI` checks] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false -[Integration tests/Forest `CLI` checks] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] -[Integration tests/Forest `CLI` checks] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] -[Integration tests/Forest `CLI` checks] ☁ git clone 'https://github.com/actions/download-artifact' # ref=v3 -[Integration tests/Forest `CLI` checks] ⭐ Run Main Checkout Sources -[Integration tests/Forest `CLI` checks] 🐳 docker cp src=/home/rumcajs/prj/forest/. dst=/home/rumcajs/prj/forest -[Integration tests/Forest `CLI` checks] ✅ Success - Main Checkout Sources -[Integration tests/Forest `CLI` checks] ⭐ Run Main actions/download-artifact@v3 -[Integration tests/Forest `CLI` checks] 🐳 docker cp src=/home/rumcajs/.cache/act/actions-download-artifact@v3/ dst=/var/run/act/actions/actions-download-artifact@v3/ -[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v3/dist/index.js] user= workdir= -[Integration tests/Forest `CLI` checks] ✅ Success - Main actions/download-artifact@v3 -[Integration tests/Forest `CLI` checks] ⚙ ::set-output:: download-path=/root/.cargo/bin -[Integration tests/Forest `CLI` checks] ⭐ Run Main Set permissions -[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= -[Integration tests/Forest `CLI` checks] ✅ Success - Main Set permissions -[Integration tests/Forest `CLI` checks] ⭐ Run Main install CA certificates -[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= -[Integration tests/Forest `CLI` checks] ✅ Success - Main install CA certificates -[Integration tests/Forest `CLI` checks] ⭐ Run Main Make sure everything is in PATH -[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=/root/.cargo/bin/ -[Integration tests/Forest `CLI` checks] ✅ Success - Main Make sure everything is in PATH -[Integration tests/Forest `CLI` checks] ⭐ Run Main forest-cli check -[Integration tests/Forest `CLI` checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5] user= workdir= -[Integration tests/Forest `CLI` checks] ✅ Success - Main forest-cli check -[Integration tests/Forest `CLI` checks] 🏁 Job succeeded +[Integration tests/Forest CLI checks] 🚀 Start image=catthehacker/ubuntu:act-latest +[Integration tests/Forest CLI checks] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false +[Integration tests/Forest CLI checks] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] +[Integration tests/Forest CLI checks] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] +[Integration tests/Forest CLI checks] ☁ git clone 'https://github.com/actions/download-artifact' # ref=v3 +[Integration tests/Forest CLI checks] ⭐ Run Main Checkout Sources +[Integration tests/Forest CLI checks] 🐳 docker cp src=/home/rumcajs/prj/forest/. dst=/home/rumcajs/prj/forest +[Integration tests/Forest CLI checks] ✅ Success - Main Checkout Sources +[Integration tests/Forest CLI checks] ⭐ Run Main actions/download-artifact@v3 +[Integration tests/Forest CLI checks] 🐳 docker cp src=/home/rumcajs/.cache/act/actions-download-artifact@v3/ dst=/var/run/act/actions/actions-download-artifact@v3/ +[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[node /var/run/act/actions/actions-download-artifact@v3/dist/index.js] user= workdir= +[Integration tests/Forest CLI checks] ✅ Success - Main actions/download-artifact@v3 +[Integration tests/Forest CLI checks] ⚙ ::set-output:: download-path=/root/.cargo/bin +[Integration tests/Forest CLI checks] ⭐ Run Main Set permissions +[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/2] user= workdir= +[Integration tests/Forest CLI checks] ✅ Success - Main Set permissions +[Integration tests/Forest CLI checks] ⭐ Run Main install CA certificates +[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/3] user= workdir= +[Integration tests/Forest CLI checks] ✅ Success - Main install CA certificates +[Integration tests/Forest CLI checks] ⭐ Run Main Make sure everything is in PATH +[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4] user= workdir=/root/.cargo/bin/ +[Integration tests/Forest CLI checks] ✅ Success - Main Make sure everything is in PATH +[Integration tests/Forest CLI checks] ⭐ Run Main forest-cli check +[Integration tests/Forest CLI checks] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5] user= workdir= +[Integration tests/Forest CLI checks] ✅ Success - Main forest-cli check +[Integration tests/Forest CLI checks] 🏁 Job succeeded ``` # Caveats diff --git a/f3-sidecar/README.md b/f3-sidecar/README.md index 523b5023231f..4253224e1f5c 100644 --- a/f3-sidecar/README.md +++ b/f3-sidecar/README.md @@ -22,9 +22,9 @@ Follow this [guide](https://go.dev/doc/install) to install or use one of the ver `mitmproxy --mode reverse:http://localhost:2345 --listen-port 8080` then `go run . -rpc http://127.0.0.1:8080/rpc/v1` -### How `F3` sidecar interacts with Forest +### How F3 sidecar interacts with Forest -An `F3` sidecar node is a standalone node that is a part of a p2p network and +An F3 sidecar node is a standalone node that is a part of a p2p network and participates in the f3 protocol. Besides what have been handled internally(e.g. p2p communications) in the @@ -40,7 +40,7 @@ Besides what have been handled internally(e.g. p2p communications) in the participating miners - it requires a backend that provides the actor IDs of the participating miners - it requires a p2p node as bootstrapper to discover more peers via Kademlia -- additionally, to power the `Filecoin.`F3`*` RPC methods in forest, a sidecar +- additionally, to power the `Filecoin.F3*` RPC methods in forest, a sidecar node runs an RPC server that implements the same RPC methods to which the associated forest node can delegate the RPC requests @@ -48,19 +48,19 @@ A brief diagram: ```mermaid flowchart TD - A[`F3` sidecar] -->|EC API calls| B(Forest) + A[F3 sidecar] -->|EC API calls| B(Forest) A --> |signer API calls| B A --> |read manifest params| B A --> |P2P bootstrap node| B - B --> |delegate `F3` RPC calls| A + B --> |delegate F3 RPC calls| A A --> |storage backend| C[level db] A --> |dynamic manifest backend| D[manifest p2p server] ``` -### To build and run `F3` sidecar within Forest via FFI +### To build and run F3 sidecar within Forest via FFI -By default, the Go `F3`-sidecar is built and linked into Forest binary unless -environment variable `FOREST_`F3`_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. +By default, the Go F3-sidecar is built and linked into Forest binary unless +environment variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. -`F3` sidecar is not started by default, set `FOREST_`F3`_SIDECAR_FFI_ENABLED=1` to +F3 sidecar is not started by default, set `FOREST_F3_SIDECAR_FFI_ENABLED=1` to opt in. diff --git a/f3-sidecar/api.go b/f3-sidecar/api.go index 051deee525fc..e11ac816e12a 100644 --- a/f3-sidecar/api.go +++ b/f3-sidecar/api.go @@ -15,7 +15,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" ) -type `F3`Api struct { +type F3Api struct { GetRawNetworkName func(context.Context) (string, error) GetTipsetByEpoch func(context.Context, int64) (TipSet, error) GetTipset func(context.Context, gpbft.TipSetKey) (TipSet, error) @@ -39,23 +39,23 @@ type VersionInfo struct { Version string } -type `F3`ServerHandler struct { - f3 *f3.`F3` +type F3ServerHandler struct { + f3 *f3.F3 } -func (h *`F3`ServerHandler) `F3`GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { +func (h *F3ServerHandler) F3GetCertificate(ctx context.Context, instance uint64) (*certs.FinalityCertificate, error) { return h.f3.GetCert(ctx, instance) } -func (h *`F3`ServerHandler) `F3`GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) { +func (h *F3ServerHandler) F3GetLatestCertificate(ctx context.Context) (*certs.FinalityCertificate, error) { return h.f3.GetLatestCert(ctx) } -func (h *`F3`ServerHandler) `F3`Get`F3`PowerTable(ctx context.Context, tsk []byte) (gpbft.PowerEntries, error) { +func (h *F3ServerHandler) F3GetF3PowerTable(ctx context.Context, tsk []byte) (gpbft.PowerEntries, error) { return h.f3.GetPowerTable(ctx, tsk) } -func (h *`F3`ServerHandler) `F3`ExportLatestSnapshot(ctx context.Context, path string) (_ *cid.Cid, err error) { +func (h *F3ServerHandler) F3ExportLatestSnapshot(ctx context.Context, path string) (_ *cid.Cid, err error) { cs, err := h.f3.GetCertStore() if err != nil { return nil, err @@ -84,7 +84,7 @@ func (h *`F3`ServerHandler) `F3`ExportLatestSnapshot(ctx context.Context, path s return &cid, nil } -// `F3`Get`F3`PowerTableByInstance retrieves the power table for a specific consensus instance. +// F3GetF3PowerTableByInstance retrieves the power table for a specific consensus instance. // It returns the power entries associated with the given instance number. // // Parameters: @@ -94,19 +94,19 @@ func (h *`F3`ServerHandler) `F3`ExportLatestSnapshot(ctx context.Context, path s // Returns: // - PowerEntries: The power distribution table for the specified instance // - error: Any error encountered during retrieval -func (h *`F3`ServerHandler) `F3`Get`F3`PowerTableByInstance(ctx context.Context, instance uint64) (gpbft.PowerEntries, error) { +func (h *F3ServerHandler) F3GetF3PowerTableByInstance(ctx context.Context, instance uint64) (gpbft.PowerEntries, error) { return h.f3.GetPowerTableByInstance(ctx, instance) } -func (h *`F3`ServerHandler) `F3`IsRunning(_ context.Context) bool { +func (h *F3ServerHandler) F3IsRunning(_ context.Context) bool { return h.f3.IsRunning() } -func (h *`F3`ServerHandler) `F3`GetProgress(_ context.Context) gpbft.InstanceProgress { +func (h *F3ServerHandler) F3GetProgress(_ context.Context) gpbft.InstanceProgress { return h.f3.Progress() } -func (h *`F3`ServerHandler) `F3`GetManifest(ctx context.Context) manifest.Manifest { +func (h *F3ServerHandler) F3GetManifest(ctx context.Context) manifest.Manifest { m := h.f3.Manifest() if !isCidDefined(m.InitialPowerTable) { if cert0, err := h.f3.GetCert(ctx, 0); err == nil { diff --git a/f3-sidecar/ec.go b/f3-sidecar/ec.go index 2728db931967..06b7964a7bc2 100644 --- a/f3-sidecar/ec.go +++ b/f3-sidecar/ec.go @@ -13,18 +13,18 @@ import ( type ForestEC struct { rpcEndpoint string isJwtProvided bool - f3api `F3`Api + f3api F3Api closer jsonrpc.ClientCloser } func NewForestEC(ctx context.Context, rpcEndpoint, jwt string) (ForestEC, error) { - f3api := `F3`Api{} + f3api := F3Api{} headers := make(http.Header) isJwtProvided := len(jwt) > 0 if isJwtProvided { headers.Add("Authorization", fmt.Sprintf("Bearer %s", jwt)) } - closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "`F3`", &f3api, headers) + closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "F3", &f3api, headers) if err != nil { return ForestEC{}, err } diff --git a/f3-sidecar/ffi_gen.go b/f3-sidecar/ffi_gen.go index 15566c5a32d9..aea26d966715 100644 --- a/f3-sidecar/ffi_gen.go +++ b/f3-sidecar/ffi_gen.go @@ -26,15 +26,15 @@ import ( "github.com/ihciah/rust2go/asmcall" ) -var Go`F3`NodeImpl Go`F3`Node +var GoF3NodeImpl GoF3Node -type Go`F3`Node interface { +type GoF3Node interface { run(rpc_endpoint *string, jwt *string, f3_rpc_endpoint *string, initial_power_table *string, bootstrap_epoch *int64, finality *int64, f3_root *string) bool import_snap(f3_rpc_endpoint *string, f3_root *string, snapshot_path *string) string } -//export CGo`F3`Node_run -func CGo`F3`Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C.StringRef, initial_power_table C.StringRef, bootstrap_epoch C.int64_t, finality C.int64_t, f3_root C.StringRef, slot *C.void, cb *C.void) { +//export CGoF3Node_run +func CGoF3Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint C.StringRef, initial_power_table C.StringRef, bootstrap_epoch C.int64_t, finality C.int64_t, f3_root C.StringRef, slot *C.void, cb *C.void) { _new_rpc_endpoint := newString(rpc_endpoint) _new_jwt := newString(jwt) _new_f3_rpc_endpoint := newString(f3_rpc_endpoint) @@ -42,7 +42,7 @@ func CGo`F3`Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint _new_bootstrap_epoch := newC_int64_t(bootstrap_epoch) _new_finality := newC_int64_t(finality) _new_f3_root := newString(f3_root) - resp := Go`F3`NodeImpl.run(&_new_rpc_endpoint, &_new_jwt, &_new_f3_rpc_endpoint, &_new_initial_power_table, &_new_bootstrap_epoch, &_new_finality, &_new_f3_root) + resp := GoF3NodeImpl.run(&_new_rpc_endpoint, &_new_jwt, &_new_f3_rpc_endpoint, &_new_initial_power_table, &_new_bootstrap_epoch, &_new_finality, &_new_f3_root) resp_ref, buffer := cvt_ref(cntC_bool, refC_bool)(&resp) asmcall.CallFuncG0P2(unsafe.Pointer(cb), unsafe.Pointer(&resp_ref), unsafe.Pointer(slot)) runtime.KeepAlive(resp_ref) @@ -50,12 +50,12 @@ func CGo`F3`Node_run(rpc_endpoint C.StringRef, jwt C.StringRef, f3_rpc_endpoint runtime.KeepAlive(buffer) } -//export CGo`F3`Node_import_snap -func CGo`F3`Node_import_snap(f3_rpc_endpoint C.StringRef, f3_root C.StringRef, snapshot_path C.StringRef, slot *C.void, cb *C.void) { +//export CGoF3Node_import_snap +func CGoF3Node_import_snap(f3_rpc_endpoint C.StringRef, f3_root C.StringRef, snapshot_path C.StringRef, slot *C.void, cb *C.void) { _new_f3_rpc_endpoint := newString(f3_rpc_endpoint) _new_f3_root := newString(f3_root) _new_snapshot_path := newString(snapshot_path) - resp := Go`F3`NodeImpl.import_snap(&_new_f3_rpc_endpoint, &_new_f3_root, &_new_snapshot_path) + resp := GoF3NodeImpl.import_snap(&_new_f3_rpc_endpoint, &_new_f3_root, &_new_snapshot_path) resp_ref, buffer := cvt_ref(cntString, refString)(&resp) asmcall.CallFuncG0P2(unsafe.Pointer(cb), unsafe.Pointer(&resp_ref), unsafe.Pointer(slot)) runtime.KeepAlive(resp_ref) diff --git a/f3-sidecar/ffi_impl.go b/f3-sidecar/ffi_impl.go index 45ef62150cdd..6bfb7f472e2f 100644 --- a/f3-sidecar/ffi_impl.go +++ b/f3-sidecar/ffi_impl.go @@ -24,7 +24,7 @@ func init() { checkError(err) err = logging.SetLogLevel("f3/sidecar", "debug") checkError(err) - Go`F3`NodeImpl = &f3Impl{ctx: context.Background()} + GoF3NodeImpl = &f3Impl{ctx: context.Background()} } type f3Impl struct { @@ -41,7 +41,7 @@ func (f3 *f3Impl) run(rpc_endpoint *string, jwt *string, f3_rpc_endpoint *string err = run(f3.ctx, *rpc_endpoint, *jwt, *f3_rpc_endpoint, *initial_power_table, *bootstrap_epoch, *finality, *db) if err != nil { nRetry += 1 - logger.Errorf("Unexpected `F3` failure, retrying(%d) in 10s... error=%s", nRetry, err) + logger.Errorf("Unexpected F3 failure, retrying(%d) in 10s... error=%s", nRetry, err) time.Sleep(10 * time.Second) } } diff --git a/f3-sidecar/go.sum b/f3-sidecar/go.sum index 0720c50df84d..8d65d50e5c23 100644 --- a/f3-sidecar/go.sum +++ b/f3-sidecar/go.sum @@ -53,7 +53,7 @@ github.com/filecoin-project/go-state-types v0.16.0 h1:ajIREDzTGfq71ofIQ29iZR1WXx github.com/filecoin-project/go-state-types v0.16.0/go.mod h1:YCESyrqnyu17y0MazbV6Uwma5+BrMvEKEQp5QWeIf9g= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= -github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJh`F3`1t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -71,7 +71,7 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58U`F3`b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -138,7 +138,7 @@ github.com/ipfs/go-block-format v0.2.2/go.mod h1:vmuefuWU6b+9kIU0vZJgpiJt1yicQz9 github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43D`F3`iPgn4GIN0mk= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= github.com/ipfs/go-datastore v0.8.3 h1:z391GsQyGKUIUof2tPoaZVeDknbt7fNHs6Gqjcw5Jo4= github.com/ipfs/go-datastore v0.8.3/go.mod h1:raxQ/CreIy9L6MxT71ItfMX12/ASN6EhXJoUFjICQ2M= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -476,13 +476,13 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -496,7 +496,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0`F3`1C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= @@ -597,7 +597,7 @@ google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZbl`F3`eUsNvo= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/f3-sidecar/import.go b/f3-sidecar/import.go index 3c80af2628fe..7acbbe0fdbb0 100644 --- a/f3-sidecar/import.go +++ b/f3-sidecar/import.go @@ -13,10 +13,10 @@ import ( ) func importSnap(ctx context.Context, rpcEndpoint string, f3Root string, snapshotPath string) (err error) { - logger.Infof("importing `F3` snapshot at %s", snapshotPath) + logger.Infof("importing F3 snapshot at %s", snapshotPath) - f3api := `F3`Api{} - closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "`F3`", &f3api, nil) + f3api := F3Api{} + closer, err := jsonrpc.NewClient(ctx, rpcEndpoint, "F3", &f3api, nil) if err != nil { return err } diff --git a/f3-sidecar/main.go b/f3-sidecar/main.go index b977d7897bd8..d94f71d50e70 100644 --- a/f3-sidecar/main.go +++ b/f3-sidecar/main.go @@ -32,11 +32,11 @@ func main() { var jwt string flag.StringVar(&jwt, "jwt", "", "the JWT token for invoking forest RPC methods that require WRITE and SIGN permission") var f3RpcEndpoint string - flag.StringVar(&f3RpcEndpoint, "f3-rpc", "127.0.0.1:23456", "The RPC endpoint `F3` sidecar listens on") + flag.StringVar(&f3RpcEndpoint, "f3-rpc", "127.0.0.1:23456", "The RPC endpoint F3 sidecar listens on") var initialPowerTable string flag.StringVar(&initialPowerTable, "initial-power-table", "", "The CID of the initial power table") var bootstrapEpoch int64 - flag.Int64Var(&bootstrapEpoch, "bootstrap", -1, "`F3` bootstrap epoch") + flag.Int64Var(&bootstrapEpoch, "bootstrap", -1, "F3 bootstrap epoch") var finality int64 flag.Int64Var(&finality, "finality", 900, "chain finality epochs") var f3Root string diff --git a/f3-sidecar/manifest.go b/f3-sidecar/manifest.go index c6040b01a3be..147dcfd024d6 100644 --- a/f3-sidecar/manifest.go +++ b/f3-sidecar/manifest.go @@ -11,31 +11,31 @@ import ( var Network2PredefinedManifestMappings map[gpbft.NetworkName]*manifest.Manifest = make(map[gpbft.NetworkName]*manifest.Manifest) func init() { - for _, bytes := range [][]byte{`F3`ManifestBytes2K, `F3`ManifestBytesButterfly, `F3`ManifestBytesCalibnet, `F3`ManifestBytesMainnet} { + for _, bytes := range [][]byte{F3ManifestBytes2K, F3ManifestBytesButterfly, F3ManifestBytesCalibnet, F3ManifestBytesMainnet} { m := loadManifest(bytes) Network2PredefinedManifestMappings[m.NetworkName] = m } } //go:embed f3manifest_2k.json -var `F3`ManifestBytes2K []byte +var F3ManifestBytes2K []byte //go:embed f3manifest_butterfly.json -var `F3`ManifestBytesButterfly []byte +var F3ManifestBytesButterfly []byte //go:embed f3manifest_calibnet.json -var `F3`ManifestBytesCalibnet []byte +var F3ManifestBytesCalibnet []byte //go:embed f3manifest_mainnet.json -var `F3`ManifestBytesMainnet []byte +var F3ManifestBytesMainnet []byte func loadManifest(bytes []byte) *manifest.Manifest { var m manifest.Manifest if err := json.Unmarshal(bytes, &m); err != nil { - logger.Panicf("failed to unmarshal `F3` manifest: %s", err) + logger.Panicf("failed to unmarshal F3 manifest: %s", err) } if err := m.Validate(); err != nil { - logger.Panicf("invalid `F3` manifest: %s", err) + logger.Panicf("invalid F3 manifest: %s", err) } return &m } diff --git a/f3-sidecar/p2p.go b/f3-sidecar/p2p.go index 319d1e01a0c5..c98d1666943a 100644 --- a/f3-sidecar/p2p.go +++ b/f3-sidecar/p2p.go @@ -56,7 +56,7 @@ func createP2PHost(ctx context.Context, networkName string) (*P2PHost, error) { pubsub.WithMessageIdFn(hashMsgId), // Bump the validation queue to accommodate the increase in gossipsub message // exchange rate as a result of f3. The size of 256 should offer enough headroom - // for slower `F3` validation while avoiding: 1) avoid excessive memory usage, 2) + // for slower F3 validation while avoiding: 1) avoid excessive memory usage, 2) // dropped consensus related messages and 3) cascading effect among other topics // since this config isn't topic-specific. // diff --git a/f3-sidecar/run.go b/f3-sidecar/run.go index c7cf4e6b184a..af7c8dae7f58 100644 --- a/f3-sidecar/run.go +++ b/f3-sidecar/run.go @@ -104,7 +104,7 @@ func run(ctx context.Context, rpcEndpoint string, jwt string, f3RpcEndpoint stri } rpcServer := jsonrpc.NewServer() - serverHandler := &`F3`ServerHandler{f3Module} + serverHandler := &F3ServerHandler{f3Module} rpcServer.Register("Filecoin", serverHandler) srv := &http.Server{ Handler: rpcServer, @@ -176,12 +176,12 @@ func run(ctx context.Context, rpcEndpoint string, jwt string, f3RpcEndpoint stri } } -func participate(ctx context.Context, f3Module *f3.`F3`, signer gpbft.Signer, msgToSign *gpbft.MessageBuilder, miner uint64) error { +func participate(ctx context.Context, f3Module *f3.F3, signer gpbft.Signer, msgToSign *gpbft.MessageBuilder, miner uint64) error { signatureBuilder, err := msgToSign.PrepareSigningInputs(gpbft.ActorID(miner)) if err != nil { if errors.Is(err, gpbft.ErrNoPower) { - // we don't have any power in `F3`, continue - return fmt.Errorf("no power to participate in `F3`: %+v", err) + // we don't have any power in F3, continue + return fmt.Errorf("no power to participate in F3: %+v", err) } else { return fmt.Errorf("preparing signing inputs: %+v", err) } @@ -190,7 +190,7 @@ func participate(ctx context.Context, f3Module *f3.`F3`, signer gpbft.Signer, ms if err != nil { logger.Warnf("signing message: %+v", err) } - logger.Debugf("miner with id %d is sending message in `F3`", miner) + logger.Debugf("miner with id %d is sending message in F3", miner) f3Module.Broadcast(ctx, signatureBuilder, payloadSig, vrfSig) return nil } diff --git a/f3-sidecar/utils.go b/f3-sidecar/utils.go index e900a92ce2cb..7d89126bd134 100644 --- a/f3-sidecar/utils.go +++ b/f3-sidecar/utils.go @@ -20,7 +20,7 @@ func getDatastore(f3Root string) (*leveldb.Datastore, error) { return leveldb.NewDatastore(filepath.Join(f3Root, "db"), nil) } -func waitRawNetworkName(ctx context.Context, f3api *`F3`Api) string { +func waitRawNetworkName(ctx context.Context, f3api *F3Api) string { for { rawNetwork, err := f3api.GetRawNetworkName(ctx) if err != nil { diff --git a/interop-tests/src/tests/go_app/go.sum b/interop-tests/src/tests/go_app/go.sum index be0a065f6f56..d9219f3e6f61 100644 --- a/interop-tests/src/tests/go_app/go.sum +++ b/interop-tests/src/tests/go_app/go.sum @@ -39,7 +39,7 @@ github.com/filecoin-project/go-clock v0.1.0 h1:SFbYIM75M8NnFm1yMHhN9Ahy3W5bEZV9g github.com/filecoin-project/go-clock v0.1.0/go.mod h1:4uB/O4PvOjlx1VCMdZ9MyDZXRm//gkj1ELEbxfI1AZs= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= -github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJh`F3`1t2eR1BIU0CYc12+BNAKwUTag= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -101,7 +101,7 @@ github.com/ipfs/boxo v0.34.0/go.mod h1:kzdH/ewDybtO3+M8MCVkpwnIIc/d2VISX95DFrY4v github.com/ipfs/go-block-format v0.2.2 h1:uecCTgRwDIXyZPgYspaLXoMiMmxQpSx2aq34eNc4YvQ= github.com/ipfs/go-block-format v0.2.2/go.mod h1:vmuefuWU6b+9kIU0vZJgpiJt1yicQz9baHXE8qR+KB8= github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= -github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43D`F3`iPgn4GIN0mk= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= github.com/ipfs/go-datastore v0.8.3 h1:z391GsQyGKUIUof2tPoaZVeDknbt7fNHs6Gqjcw5Jo4= github.com/ipfs/go-datastore v0.8.3/go.mod h1:raxQ/CreIy9L6MxT71ItfMX12/ASN6EhXJoUFjICQ2M= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -401,13 +401,13 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUh`F3`w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -418,7 +418,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0`F3`1C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= diff --git a/scripts/devnet-curio/.env b/scripts/devnet-curio/.env index 2c55c2742486..10c6452445be 100644 --- a/scripts/devnet-curio/.env +++ b/scripts/devnet-curio/.env @@ -10,8 +10,8 @@ LOTUS_P2P_PORT=1235 MINER_RPC_PORT=2345 FOREST_RPC_PORT=3456 FOREST_OFFLINE_RPC_PORT=3457 -`F3`_RPC_PORT=23456 -`F3`_FINALITY=10 +F3_RPC_PORT=23456 +F3_FINALITY=10 GENESIS_NETWORK_VERSION=25 SHARK_HEIGHT=-10 HYGGE_HEIGHT=-9 diff --git a/scripts/devnet-curio/README.md b/scripts/devnet-curio/README.md index c93f4ac8f93d..d14e2623b2e3 100644 --- a/scripts/devnet-curio/README.md +++ b/scripts/devnet-curio/README.md @@ -43,7 +43,7 @@ Remove the devnet: docker compose rm ``` -## Interacting with the devnet via `CLI` +## Interacting with the devnet via CLI Exec into the `forest` container: diff --git a/scripts/devnet-curio/docker-compose.yml b/scripts/devnet-curio/docker-compose.yml index 0c048df96e19..63e47efc8d3f 100644 --- a/scripts/devnet-curio/docker-compose.yml +++ b/scripts/devnet-curio/docker-compose.yml @@ -185,10 +185,10 @@ services: environment: - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - RUST_LOG=info,forest::blocks::header=trace - - FOREST_`F3`_SIDECAR_FFI_ENABLED=1 - - FOREST_`F3`_FINALITY=${`F3`_FINALITY} - - FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_`F3`_SIDECAR_RPC_ENDPOINT=127.0.0.1:${`F3`_RPC_PORT} + - FOREST_F3_SIDECAR_FFI_ENABLED=1 + - FOREST_F3_FINALITY=${F3_FINALITY} + - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} + - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} diff --git a/scripts/devnet-curio/run_curio.sh b/scripts/devnet-curio/run_curio.sh index b17a7e6f5cf0..868e31e14a3c 100644 --- a/scripts/devnet-curio/run_curio.sh +++ b/scripts/devnet-curio/run_curio.sh @@ -41,7 +41,7 @@ if [ ! -f "$CURIO_REPO_PATH"/.init.curio ]; then curio run --nosync --layers seal,post,gui & CURIO_PID=$! until curio cli --machine "$myip":12300 wait-api; do - echo "Waiting for the curio `CLI` to become ready..." + echo "Waiting for the curio CLI to become ready..." sleep 5 done curio cli --machine "$myip":12300 storage attach --init --seal --store "$CURIO_REPO_PATH" diff --git a/scripts/devnet/.env b/scripts/devnet/.env index 73a9195f115c..1ec6b23e7b18 100644 --- a/scripts/devnet/.env +++ b/scripts/devnet/.env @@ -8,8 +8,8 @@ LOTUS_P2P_PORT=1235 MINER_RPC_PORT=2345 FOREST_RPC_PORT=3456 FOREST_OFFLINE_RPC_PORT=3457 -`F3`_RPC_PORT=23456 -`F3`_FINALITY=10 +F3_RPC_PORT=23456 +F3_FINALITY=10 GENESIS_NETWORK_VERSION=18 SHARK_HEIGHT=-10 HYGGE_HEIGHT=-9 diff --git a/scripts/devnet/README.md b/scripts/devnet/README.md index 5c7f0e421f46..e6985a049500 100644 --- a/scripts/devnet/README.md +++ b/scripts/devnet/README.md @@ -38,7 +38,7 @@ Remove the devnet: docker compose rm ``` -## Interacting with the devnet via `CLI` +## Interacting with the devnet via CLI Exec into the `forest` container: diff --git a/scripts/devnet/check.sh b/scripts/devnet/check.sh index 4474fa0ba391..479965491bc8 100755 --- a/scripts/devnet/check.sh +++ b/scripts/devnet/check.sh @@ -21,7 +21,7 @@ function get_sync_height { function get_f3_latest_cert_instance { local port=$1 curl --silent -X POST -H "Content-Type: application/json" \ - --data '{"jsonrpc":"2.0","id":2,"method":"Filecoin.`F3`GetLatestCertificate","param":"null"}' \ + --data '{"jsonrpc":"2.0","id":2,"method":"Filecoin.F3GetLatestCertificate","param":"null"}' \ "http://127.0.0.1:${port}/rpc/v1" | jq '.result.GPBFTInstance' } @@ -54,7 +54,7 @@ if [ "$height" -ne 0 ]; then exit 1 fi -# Check the `F3` RPC +# Check the F3 RPC height=$(get_f3_latest_cert_instance ${FOREST_RPC_PORT}) if [ "$height" -lt 1 ]; then echo "latest cert instance should be greater than zero: $height" diff --git a/scripts/devnet/docker-compose.yml b/scripts/devnet/docker-compose.yml index 82151d5f030c..07572cab1104 100644 --- a/scripts/devnet/docker-compose.yml +++ b/scripts/devnet/docker-compose.yml @@ -193,10 +193,10 @@ services: environment: - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - RUST_LOG=info,forest::blocks::header=trace - - FOREST_`F3`_SIDECAR_FFI_ENABLED=1 - - FOREST_`F3`_FINALITY=${`F3`_FINALITY} - - FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_`F3`_SIDECAR_RPC_ENDPOINT=127.0.0.1:${`F3`_RPC_PORT} + - FOREST_F3_SIDECAR_FFI_ENABLED=1 + - FOREST_F3_FINALITY=${F3_FINALITY} + - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} + - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} diff --git a/scripts/tests/api_compare/docker-compose.yml b/scripts/tests/api_compare/docker-compose.yml index 5143e7ab9814..257f9a240481 100644 --- a/scripts/tests/api_compare/docker-compose.yml +++ b/scripts/tests/api_compare/docker-compose.yml @@ -200,7 +200,7 @@ services: lotus sync wait # After the sync is done, import the wallet for signing blocks. It might be already there, which will return an error. We ignore it. echo $MINER_WORKER_KEY | lotus wallet import || true - # Wait until `F3` certificate instance 100 is available + # Wait until F3 certificate instance 100 is available until lotus f3 c get 100; do sleep 5s; done diff --git a/scripts/tests/api_compare/filter-list b/scripts/tests/api_compare/filter-list index 7a5ee8a4963f..6e76f705cca3 100644 --- a/scripts/tests/api_compare/filter-list +++ b/scripts/tests/api_compare/filter-list @@ -1,4 +1,4 @@ # This list contains potentially broken methods (or tests) that are ignored. # They should be considered bugged, and not used until the root cause is resolved. # Disable until next Lotus release with go-f3 0.8.6 -!Filecoin.`F3`GetManifest +!Filecoin.F3GetManifest diff --git a/scripts/tests/api_compare/filter-list-offline b/scripts/tests/api_compare/filter-list-offline index 069939518fc9..50f62a6f7fe1 100644 --- a/scripts/tests/api_compare/filter-list-offline +++ b/scripts/tests/api_compare/filter-list-offline @@ -10,15 +10,15 @@ !Filecoin.NetProtectAdd !Filecoin.NetProtectRemove !Filecoin.NetProtectList -# Most `F3` methods are not avaiable on offline Forest RPC server -!Filecoin.`F3`GetManifest -!Filecoin.`F3`GetLatestCertificate -!Filecoin.`F3`ListParticipants -!Filecoin.`F3`GetProgress -!Filecoin.`F3`IsRunning -!Filecoin.`F3`GetCertificate -!Filecoin.`F3`GetOrRenewParticipationTicket -!Filecoin.`F3`Get`F3`PowerTable +# Most F3 methods are not avaiable on offline Forest RPC server +!Filecoin.F3GetManifest +!Filecoin.F3GetLatestCertificate +!Filecoin.F3ListParticipants +!Filecoin.F3GetProgress +!Filecoin.F3IsRunning +!Filecoin.F3GetCertificate +!Filecoin.F3GetOrRenewParticipationTicket +!Filecoin.F3GetF3PowerTable # CustomCheckFailed in Forest: https://github.com/ChainSafe/forest/actions/runs/9593268587/job/26453560366 !Filecoin.StateCall # These methods don't make sense in the context of an offline node diff --git a/scripts/tests/calibnet_eth_mapping_check.sh b/scripts/tests/calibnet_eth_mapping_check.sh index a2b0cc2a6b23..8803edd8c35f 100755 --- a/scripts/tests/calibnet_eth_mapping_check.sh +++ b/scripts/tests/calibnet_eth_mapping_check.sh @@ -14,7 +14,7 @@ NUM_TIPSETS=200 echo "Get Ethereum block hashes and transactions hashes from the last $NUM_TIPSETS tipsets" -OUTPUT=$($FOREST_`CLI`_PATH info show) +OUTPUT=$($FOREST_CLI_PATH info show) HEAD_EPOCH=$(echo "$OUTPUT" | sed -n 's/.*epoch: \([0-9]*\).*/\1/p') EPOCH=$((HEAD_EPOCH - 1)) diff --git a/scripts/tests/calibnet_export_check.sh b/scripts/tests/calibnet_export_check.sh index 7f8943af4f39..44163f757bcb 100755 --- a/scripts/tests/calibnet_export_check.sh +++ b/scripts/tests/calibnet_export_check.sh @@ -15,12 +15,12 @@ echo "Cleaning up the initial snapshot" rm --force --verbose ./*.{car,car.zst,sha256sum} echo "Exporting zstd compressed snapshot at genesis" -$FOREST_`CLI`_PATH snapshot export --tipset 0 --format "$format" +$FOREST_CLI_PATH snapshot export --tipset 0 --format "$format" echo "Exporting zstd compressed snapshot in $format format" -$FOREST_`CLI`_PATH snapshot export --format "$format" +$FOREST_CLI_PATH snapshot export --format "$format" -$FOREST_`CLI`_PATH shutdown --force +$FOREST_CLI_PATH shutdown --force for f in *.car.zst; do echo "Inspecting archive info $f" diff --git a/scripts/tests/calibnet_export_f3_check.sh b/scripts/tests/calibnet_export_f3_check.sh index 2dc7b394e781..8164799f90c1 100755 --- a/scripts/tests/calibnet_export_f3_check.sh +++ b/scripts/tests/calibnet_export_f3_check.sh @@ -12,13 +12,13 @@ forest_init_with_f3 echo "Cleaning up the initial snapshot" rm --force --verbose ./*.{car,car.zst,sha256sum} -echo "Wait for `F3` to sync" -timeout 10m $FOREST_`CLI`_PATH f3 ready --wait --no-progress-timeout 5m +echo "Wait for F3 to sync" +timeout 10m $FOREST_CLI_PATH f3 ready --wait --no-progress-timeout 5m echo "Exporting zstd compressed snapshot in v2 format" -$FOREST_`CLI`_PATH snapshot export --format v2 +$FOREST_CLI_PATH snapshot export --format v2 -$FOREST_`CLI`_PATH shutdown --force +$FOREST_CLI_PATH shutdown --force for f in *.car.zst; do echo "Inspecting archive info $f" diff --git a/scripts/tests/calibnet_kademlia_check.sh b/scripts/tests/calibnet_kademlia_check.sh index 60e5939d8bf7..db916312d6c1 100755 --- a/scripts/tests/calibnet_kademlia_check.sh +++ b/scripts/tests/calibnet_kademlia_check.sh @@ -8,7 +8,7 @@ source "$(dirname "$0")/harness.sh" forest_init_stateless # Example format: /ip4/127.0.0.1/tcp/41937/p2p/12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ -STATELESS_NODE_ADDRESS=$($FOREST_`CLI`_PATH net listen | tail -n 1) +STATELESS_NODE_ADDRESS=$($FOREST_CLI_PATH net listen | tail -n 1) echo "Stateless node address: $STATELESS_NODE_ADDRESS" # Example format: 12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ STATELESS_NODE_PEER_ID=$(echo "$STATELESS_NODE_ADDRESS" | cut --delimiter="/" --fields=7 --zero-terminated) @@ -31,6 +31,6 @@ until (( $(curl http://127.0.0.1:6117/metrics | grep full_peers | tail -n 1 | cu sleep 1s; done -FULLNODE_API_INFO="$(cat admin_token):/ip4/127.0.0.1/tcp/12345/http" $FOREST_`CLI`_PATH sync wait # allow the node to re-sync +FULLNODE_API_INFO="$(cat admin_token):/ip4/127.0.0.1/tcp/12345/http" $FOREST_CLI_PATH sync wait # allow the node to re-sync kill -KILL $FOREST_NODE_PID diff --git a/scripts/tests/calibnet_no_discovery_check.sh b/scripts/tests/calibnet_no_discovery_check.sh index 9f37b787e73d..68ac6ae81855 100755 --- a/scripts/tests/calibnet_no_discovery_check.sh +++ b/scripts/tests/calibnet_no_discovery_check.sh @@ -18,20 +18,20 @@ FOREST_NODE_PID=$! forest_wait_api # Verify that one of the seed nodes has been connected to -until $FOREST_`CLI`_PATH net peers | grep "calib"; do +until $FOREST_CLI_PATH net peers | grep "calib"; do sleep 1s; done -# Verify `F3` is getting certificates from the network -until [[ $($FOREST_`CLI`_PATH f3 certs get --output json | jq '.GPBFTInstance') -gt 100 ]]; do +# Verify F3 is getting certificates from the network +until [[ $($FOREST_CLI_PATH f3 certs get --output json | jq '.GPBFTInstance') -gt 100 ]]; do sleep 1s; done echo "Test subcommands: f3 status" -$FOREST_`CLI`_PATH f3 status +$FOREST_CLI_PATH f3 status echo "Test subcommands: f3 manifest" -$FOREST_`CLI`_PATH f3 manifest +$FOREST_CLI_PATH f3 manifest echo "Test subcommands: f3 certs get" -$FOREST_`CLI`_PATH f3 certs list +$FOREST_CLI_PATH f3 certs list echo "Test subcommands: f3 certs list" -$FOREST_`CLI`_PATH f3 certs get +$FOREST_CLI_PATH f3 certs get diff --git a/scripts/tests/calibnet_other_check.sh b/scripts/tests/calibnet_other_check.sh index 3e4b5556057e..872f1be03860 100755 --- a/scripts/tests/calibnet_other_check.sh +++ b/scripts/tests/calibnet_other_check.sh @@ -10,14 +10,14 @@ source "$(dirname "$0")/harness.sh" forest_import_non_calibnet_snapshot forest_init "$@" -echo "Running Go `F3` RPC client tests" +echo "Running Go F3 RPC client tests" go test -v ./f3-sidecar echo "Verifying the non calibnet snapshot (./test-snapshots/chain4.car) is being served properly." -$FOREST_`CLI`_PATH chain read-obj -c bafy2bzacedjrqan2fwfvhfopi64yickki7miiksecglpeiavf7xueytnzevlu +$FOREST_CLI_PATH chain read-obj -c bafy2bzacedjrqan2fwfvhfopi64yickki7miiksecglpeiavf7xueytnzevlu echo "Test subcommand: state compute at epoch 0" -cid=$($FOREST_`CLI`_PATH state compute --epoch 0) +cid=$($FOREST_CLI_PATH state compute --epoch 0) # Expected state root CID, same reported as in Lotus. This should break only if the network is reset. if [ "$cid" != "bafy2bzacecgqgzh3gxpariy3mzqb37y2vvxoaw5nwbrlzkhso6owus3zqckwe" ]; then echo "Unexpected state root CID: $cid" @@ -26,7 +26,7 @@ fi forest_check_db_stats echo "Run snapshot GC" -$FOREST_`CLI`_PATH chain prune snap +$FOREST_CLI_PATH chain prune snap forest_wait_api echo "Wait the node to sync" forest_wait_for_sync @@ -35,29 +35,29 @@ forest_check_db_stats echo "Test dev commands (which could brick the node/cause subsequent snapshots to fail)" echo "Test subcommand: chain set-head" -$FOREST_`CLI`_PATH chain set-head --epoch -10 --force +$FOREST_CLI_PATH chain set-head --epoch -10 --force echo "Test subcommand: chain head" -$FOREST_`CLI`_PATH chain head -$FOREST_`CLI`_PATH chain head --tipsets 10 -$FOREST_`CLI`_PATH chain head --tipsets 5 --format json | jq 'length == 5' +$FOREST_CLI_PATH chain head +$FOREST_CLI_PATH chain head --tipsets 10 +$FOREST_CLI_PATH chain head --tipsets 5 --format json | jq 'length == 5' echo "Test subcommand: info show" -$FOREST_`CLI`_PATH info show +$FOREST_CLI_PATH info show echo "Test subcommand: net info" -$FOREST_`CLI`_PATH net info +$FOREST_CLI_PATH net info -$FOREST_`CLI`_PATH sync wait # allow the node to re-sync +$FOREST_CLI_PATH sync wait # allow the node to re-sync echo "Test subcommand: healthcheck live" -$FOREST_`CLI`_PATH healthcheck live --wait +$FOREST_CLI_PATH healthcheck live --wait echo "Test subcommand: healthcheck healthy" -$FOREST_`CLI`_PATH healthcheck healthy --wait +$FOREST_CLI_PATH healthcheck healthy --wait echo "Test subcommand: healthcheck ready" -$FOREST_`CLI`_PATH healthcheck ready --wait +$FOREST_CLI_PATH healthcheck ready --wait echo "Test subcommand: state actor-cids" bundle_cid=$($FOREST_CLI_PATH state actor-cids --format json | jq -r '.Bundle["/"]') @@ -69,13 +69,13 @@ fi echo "Regression testing mempool select" gem install http --user-install -$FOREST_`CLI`_PATH chain head --format json -n 1000 | scripts/mpool_select_killer.rb +$FOREST_CLI_PATH chain head --format json -n 1000 | scripts/mpool_select_killer.rb echo "Test subcommand: state compute (batch)" -head_epoch=$($FOREST_`CLI`_PATH chain head --format json | jq ".[0].epoch") +head_epoch=$($FOREST_CLI_PATH chain head --format json | jq ".[0].epoch") if ! [[ "$head_epoch" =~ ^[0-9]+$ ]]; then echo "Failed to parse numeric head epoch from 'chain head --format json': $head_epoch" exit 1 fi start_epoch=$(( head_epoch > 900 ? head_epoch - 900 : 0 )) -$FOREST_`CLI`_PATH state compute --epoch "$start_epoch" -n 10 -v +$FOREST_CLI_PATH state compute --epoch "$start_epoch" -n 10 -v diff --git a/scripts/tests/calibnet_stateless_mode_check.sh b/scripts/tests/calibnet_stateless_mode_check.sh index 5644a0d253ad..0d4b602e89f1 100755 --- a/scripts/tests/calibnet_stateless_mode_check.sh +++ b/scripts/tests/calibnet_stateless_mode_check.sh @@ -8,7 +8,7 @@ source "$(dirname "$0")/harness.sh" forest_init_stateless # Example format: /ip4/127.0.0.1/tcp/41937/p2p/12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ -STATELESS_NODE_ADDRESS=$($FOREST_`CLI`_PATH net listen | tail -n 1) +STATELESS_NODE_ADDRESS=$($FOREST_CLI_PATH net listen | tail -n 1) echo "Stateless node address: $STATELESS_NODE_ADDRESS" # Example format: 12D3KooWAB9z7vZ1x1v9t4BViVkX1Hy1ScoRnWV2GgGy5ec6pfUZ STATELESS_NODE_PEER_ID=$(echo "$STATELESS_NODE_ADDRESS" | cut --delimiter="/" --fields=7 --zero-terminated) diff --git a/scripts/tests/harness.sh b/scripts/tests/harness.sh index 417e1dd7fc9e..212f2cf13637 100644 --- a/scripts/tests/harness.sh +++ b/scripts/tests/harness.sh @@ -7,7 +7,7 @@ export FOREST_CHAIN_INDEXER_ENABLED="1" export FOREST_ETH_MAPPINGS_RANGE="300" export FOREST_PATH="forest" -export FOREST_`CLI`_PATH="forest-cli" +export FOREST_CLI_PATH="forest-cli" export FOREST_WALLET_PATH="forest-wallet" export FOREST_TOOL_PATH="forest-tool" @@ -32,9 +32,9 @@ function forest_download_and_import_snapshot_with_f3 { aria2c -x5 https://forest-archive.chainsafe.dev/latest/calibnet/ -o v1.forest.car.zst echo "Inspecting v1 snapshot" $FOREST_TOOL_PATH archive info v1.forest.car.zst - echo "Downloading `F3` snapshot" + echo "Downloading F3 snapshot" aria2c -x5 https://forest-snapshots.fra1.cdn.digitaloceanspaces.com/f3/f3_snap_calibnet_622579.bin -o f3.bin - echo "Inspecting `F3` snapshot" + echo "Inspecting F3 snapshot" $FOREST_TOOL_PATH archive f3-header f3.bin echo "Generating v2 snapshot" $FOREST_TOOL_PATH archive merge-f3 --v1 v1.forest.car.zst --f3 f3.bin --output v2.forest.car.zst @@ -108,17 +108,17 @@ function forest_run_node_stateless_detached { function forest_wait_api { echo "Waiting for Forest API" - $FOREST_`CLI`_PATH wait-api --timeout 60s + $FOREST_CLI_PATH wait-api --timeout 60s } function forest_wait_for_sync { echo "Waiting for sync" - timeout 30m $FOREST_`CLI`_PATH sync wait + timeout 30m $FOREST_CLI_PATH sync wait } function forest_wait_for_healthcheck_ready { echo "Waiting for healthcheck ready" - timeout 30m $FOREST_`CLI`_PATH healthcheck ready --wait + timeout 30m $FOREST_CLI_PATH healthcheck ready --wait } function forest_init { @@ -140,7 +140,7 @@ function forest_init { forest_wait_for_sync forest_check_db_stats - DATA_DIR=$( $FOREST_`CLI`_PATH config dump | grep "data_dir" | cut -d' ' -f3- | tr -d '"' ) + DATA_DIR=$( $FOREST_CLI_PATH config dump | grep "data_dir" | cut -d' ' -f3- | tr -d '"' ) ADMIN_TOKEN=$(cat "${DATA_DIR}/token") FULLNODE_API_INFO="${ADMIN_TOKEN}:/ip4/127.0.0.1/tcp/2345/http" @@ -160,10 +160,10 @@ function forest_init_with_f3 { forest_wait_for_healthcheck_ready - echo "Print the latest `F3` certificate" - $FOREST_`CLI`_PATH f3 c get - echo "ensure `F3` certificate at instance 622000 has been imported" - $FOREST_`CLI`_PATH f3 c get 622000 + echo "Print the latest F3 certificate" + $FOREST_CLI_PATH f3 c get + echo "ensure F3 certificate at instance 622000 has been imported" + $FOREST_CLI_PATH f3 c get 622000 } function forest_init_stateless { @@ -190,7 +190,7 @@ function forest_print_logs_and_metrics { function forest_cleanup { if pkill -0 forest 2>/dev/null; then forest_print_logs_and_metrics - $FOREST_`CLI`_PATH shutdown --force || true + $FOREST_CLI_PATH shutdown --force || true timeout 10s sh -c "while pkill -0 forest 2>/dev/null; do sleep 1; done" fi } diff --git a/src/blocks/tests/serialization-vectors/block_headers.json b/src/blocks/tests/serialization-vectors/block_headers.json index 2f8d9af8bd89..e657c9bc4437 100644 --- a/src/blocks/tests/serialization-vectors/block_headers.json +++ b/src/blocks/tests/serialization-vectors/block_headers.json @@ -168,7 +168,7 @@ "block": { "Miner": "t01000", "Ticket": { - "VRFProof": "okj7pA7BvjdvYVUt3Bs8WkMGaRjcOphjJAZvZ40b37uFQe`F3`n3NU/c+0OnciKJE3BV61M8Oyw9sE523I70VGhZeC+9Bwnsq5WUHUfKKxAyjlA1c3OBveM5pJykZyidK1" + "VRFProof": "okj7pA7BvjdvYVUt3Bs8WkMGaRjcOphjJAZvZ40b37uFQeF3n3NU/c+0OnciKJE3BV61M8Oyw9sE523I70VGhZeC+9Bwnsq5WUHUfKKxAyjlA1c3OBveM5pJykZyidK1" }, "ElectionProof": { "WinCount": 1, diff --git a/src/chain/mod.rs b/src/chain/mod.rs index 1165a220eeab..ebea43686ffe 100644 --- a/src/chain/mod.rs +++ b/src/chain/mod.rs @@ -50,7 +50,7 @@ pub async fn export_from_head( Ok((head_ts, digest)) } -/// Exports a Filecoin snapshot in `v1` format +/// Exports a Filecoin snapshot in v1 format /// See pub async fn export( db: &Arc, @@ -63,7 +63,7 @@ pub async fn export( export_to_forest_car::(roots, None, db, tipset, lookup_depth, writer, options).await } -/// Exports a Filecoin snapshot in `v2` format +/// Exports a Filecoin snapshot in v2 format /// See pub async fn export_v2( db: &Arc, diff --git a/src/chain/snapshot_format.rs b/src/chain/snapshot_format.rs index d2289592373c..b59c6aa54eff 100644 --- a/src/chain/snapshot_format.rs +++ b/src/chain/snapshot_format.rs @@ -50,7 +50,7 @@ pub struct FilecoinSnapshotMetadata { pub version: FilecoinSnapshotVersion, /// Chain head tipset key pub head_tipset_key: NonEmpty, - /// `F3` snapshot `CID` + /// F3 snapshot `CID` pub f3_data: Option, } @@ -83,7 +83,7 @@ impl std::fmt::Display for FilecoinSnapshotMetadata { writeln!(f, "Head Tipset: {head_tipset_key_string}")?; write!( f, - "`F3` data: {}", + "F3 data: {}", self.f3_data .map(|c| c.to_string()) .unwrap_or_else(|| "not found".into()) diff --git a/src/cid_collections/hash_map.rs b/src/cid_collections/hash_map.rs index 8de5b3f6a778..63ef6cdc6b3c 100644 --- a/src/cid_collections/hash_map.rs +++ b/src/cid_collections/hash_map.rs @@ -133,7 +133,7 @@ impl CidHashMap { /// A view into a single entry in a map, which may either be vacant or occupied. /// -/// This `enum` is constructed using [`CidHashMap::entry`]. +/// This enum is constructed using [`CidHashMap::entry`]. #[allow(dead_code)] #[derive(Debug)] pub enum Entry<'a, V: 'a> { diff --git a/src/cid_collections/mod.rs b/src/cid_collections/mod.rs index 8ba93bb73d8f..85b6dde0c11c 100644 --- a/src/cid_collections/mod.rs +++ b/src/cid_collections/mod.rs @@ -28,7 +28,7 @@ pub use small_cid_vec::SmallCidNonEmptyVec; /// assert_eq!(std::mem::size_of::(), 96); /// ``` /// -/// If other types of CID become popular, they should be added to this `enum`. +/// If other types of CID become popular, they should be added to this enum. #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)] enum MaybeCompactedCid { Compact(CidV1DagCborBlake2b256), diff --git a/src/cli/main.rs b/src/cli/main.rs index d8a7578bb669..4e4aee964916 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -44,7 +44,7 @@ where Subcommand::Snapshot(cmd) => cmd.run(client).await, Subcommand::Shutdown(cmd) => cmd.run(client).await, Subcommand::Healthcheck(cmd) => cmd.run(client).await, - Subcommand::`F3`(cmd) => cmd.run(client).await, + Subcommand::F3(cmd) => cmd.run(client).await, Subcommand::WaitApi(cmd) => cmd.run(client).await, } } diff --git a/src/cli/subcommands/f3_cmd.rs b/src/cli/subcommands/f3_cmd.rs index 69d7a67ba737..2f2b29e04843 100644 --- a/src/cli/subcommands/f3_cmd.rs +++ b/src/cli/subcommands/f3_cmd.rs @@ -16,7 +16,7 @@ use crate::{ rpc::{ self, f3::{ - `F3`Get`F3`PowerTableByInstance, `F3`InstanceProgress, `F3`Manifest, `F3`PowerEntry, + F3GetF3PowerTableByInstance, F3InstanceProgress, F3Manifest, F3PowerEntry, FinalityCertificate, }, prelude::*, @@ -70,7 +70,7 @@ static TEMPLATES: LazyLock = LazyLock::new(|| { /// Output format #[derive(ValueEnum, Debug, Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] -pub enum `F3`OutputFormat { +pub enum F3OutputFormat { /// Text #[default] Text, @@ -78,58 +78,58 @@ pub enum `F3`OutputFormat { Json, } -/// Manages Filecoin Fast Finality (`F3`) interactions +/// Manages Filecoin Fast Finality (F3) interactions #[derive(Debug, Subcommand)] -pub enum `F3`Commands { - /// Gets the current manifest used by `F3` +pub enum F3Commands { + /// Gets the current manifest used by F3 Manifest { /// The output format. - #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] - output: `F3`OutputFormat, + #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] + output: F3OutputFormat, }, - /// Checks the `F3` status. + /// Checks the F3 status. Status, - /// Manages interactions with `F3` finality certificates. + /// Manages interactions with F3 finality certificates. #[command(subcommand, visible_alias = "c")] - Certs(`F3`CertsCommands), - /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. + Certs(F3CertsCommands), + /// Gets F3 power table at a specific instance ID or latest instance if none is specified. #[command(subcommand, name = "powertable", visible_alias = "pt")] - PowerTable(`F3`PowerTableCommands), - /// Checks if `F3` is in sync. + PowerTable(F3PowerTableCommands), + /// Checks if F3 is in sync. Ready { - /// Wait until `F3` is in sync. + /// Wait until F3 is in sync. #[arg(long)] wait: bool, - /// The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync. + /// The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync. #[arg(long, default_value_t = 20)] threshold: usize, - /// Exit after `F3` making no progress for this duration. + /// Exit after F3 making no progress for this duration. #[arg(long, default_value = "10m", requires = "wait")] no_progress_timeout: humantime::Duration, }, } -impl `F3`Commands { +impl F3Commands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Manifest { output } => { - let manifest = client.call(`F3`GetManifest::request(())?).await?; + let manifest = client.call(F3GetManifest::request(())?).await?; match output { - `F3`OutputFormat::Text => { + F3OutputFormat::Text => { println!("{}", render_manifest_template(&manifest)?); } - `F3`OutputFormat::Json => { + F3OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&manifest)?); } } Ok(()) } Self::Status => { - let is_running = client.call(`F3`IsRunning::request(())?).await?; + let is_running = client.call(F3IsRunning::request(())?).await?; println!("Running: {is_running}"); - let progress = client.call(`F3`GetProgress::request(())?).await?; + let progress = client.call(F3GetProgress::request(())?).await?; println!("{}", render_progress_template(&progress)?); - let manifest = client.call(`F3`GetManifest::request(())?).await?; + let manifest = client.call(F3GetManifest::request(())?).await?; println!("{}", render_manifest_template(&manifest)?); Ok(()) } @@ -140,19 +140,19 @@ impl `F3`Commands { threshold, no_progress_timeout, } => { - const EXIT_CODE_`F3`_NOT_IN_SYNC: i32 = 1; - const EXIT_CODE_`F3`_FAIL_TO_FETCH_HEAD: i32 = 2; - const EXIT_CODE_`F3`_NO_PROGRESS_TIMEOUT: i32 = 3; + const EXIT_CODE_F3_NOT_IN_SYNC: i32 = 1; + const EXIT_CODE_F3_FAIL_TO_FETCH_HEAD: i32 = 2; + const EXIT_CODE_F3_NO_PROGRESS_TIMEOUT: i32 = 3; - let is_running = client.call(`F3`IsRunning::request(())?).await?; + let is_running = client.call(F3IsRunning::request(())?).await?; if !is_running { - anyhow::bail!("`F3` is not running"); + anyhow::bail!("F3 is not running"); } async fn get_heads( client: &rpc::Client, ) -> anyhow::Result<(Tipset, FinalityCertificate)> { - let cert_head = client.call(`F3`GetLatestCertificate::request(())?).await?; + let cert_head = client.call(F3GetLatestCertificate::request(())?).await?; let chain_head = client.call(ChainHead::request(())?).await?; Ok((chain_head, cert_head)) } @@ -181,7 +181,7 @@ impl `F3`Commands { >= chain_head.epoch() { let text = format!( - "[+] `F3` is in sync. Chain head epoch: {}, `F3` head epoch: {}", + "[+] F3 is in sync. Chain head epoch: {}, F3 head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); @@ -190,26 +190,26 @@ impl `F3`Commands { break; } else { let text = format!( - "[-] `F3` is not in sync. Chain head epoch: {}, `F3` head epoch: {}", + "[-] F3 is not in sync. Chain head epoch: {}, F3 head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); pb.set_message(text); if !wait { pb.finish(); - std::process::exit(EXIT_CODE_`F3`_NOT_IN_SYNC); + std::process::exit(EXIT_CODE_F3_NOT_IN_SYNC); } } } Err(e) => { if !wait { - anyhow::bail!("Failed to check `F3` sync status: {e}"); + anyhow::bail!("Failed to check F3 sync status: {e}"); } num_consecutive_fetch_failtures += 1; if num_consecutive_fetch_failtures >= 3 { eprintln!("Warning: Failed to fetch heads: {e}. Exiting..."); - std::process::exit(EXIT_CODE_`F3`_FAIL_TO_FETCH_HEAD); + std::process::exit(EXIT_CODE_F3_FAIL_TO_FETCH_HEAD); } else { eprintln!("Warning: Failed to fetch heads: {e}. Retrying..."); } @@ -218,9 +218,9 @@ impl `F3`Commands { if last_progress + no_progress_timeout_duration < Instant::now() { eprintln!( - "Warning: `F3` made no progress in the past {no_progress_timeout}. Exiting..." + "Warning: F3 made no progress in the past {no_progress_timeout}. Exiting..." ); - std::process::exit(EXIT_CODE_`F3`_NO_PROGRESS_TIMEOUT); + std::process::exit(EXIT_CODE_F3_NO_PROGRESS_TIMEOUT); } } Ok(()) @@ -229,24 +229,24 @@ impl `F3`Commands { } } -/// Manages interactions with `F3` finality certificates. +/// Manages interactions with F3 finality certificates. #[derive(Debug, Subcommand)] -pub enum `F3`CertsCommands { - /// Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified. +pub enum F3CertsCommands { + /// Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified. Get { instance: Option, /// The output format. - #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] - output: `F3`OutputFormat, + #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] + output: F3OutputFormat, }, - /// Lists a range of `F3` finality certificates. + /// Lists a range of F3 finality certificates. List { /// Inclusive range of `from` and `to` instances in following notation: /// `..`. Either `` or `` may be omitted, but not both. range: Option, /// The output format. - #[arg(long, value_enum, default_value_t = `F3`OutputFormat::Text)] - output: `F3`OutputFormat, + #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] + output: F3OutputFormat, /// The maximum number of instances. A value less than 0 indicates no limit. #[arg(long, default_value_t = 10)] limit: i64, @@ -256,20 +256,20 @@ pub enum `F3`CertsCommands { }, } -impl `F3`CertsCommands { +impl F3CertsCommands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Get { instance, output } => { let cert = if let Some(instance) = instance { - client.call(`F3`GetCertificate::request((instance,))?).await? + client.call(F3GetCertificate::request((instance,))?).await? } else { - client.call(`F3`GetLatestCertificate::request(())?).await? + client.call(F3GetLatestCertificate::request(())?).await? }; match output { - `F3`OutputFormat::Text => { + F3OutputFormat::Text => { println!("{}", render_certificate_template(&cert)?); } - `F3`OutputFormat::Json => { + F3OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&cert)?); } } @@ -289,7 +289,7 @@ impl `F3`CertsCommands { let to = if let Some(i) = to_opt { i } else { - `F3`GetLatestCertificate::call(&client, ()).await?.instance + F3GetLatestCertificate::call(&client, ()).await?.instance }; anyhow::ensure!( to >= from, @@ -306,12 +306,12 @@ impl `F3`CertsCommands { Box::new((from..=to).rev().take(limit)) }; for i in range { - let cert = `F3`GetCertificate::call(&client, (i,)).await?; + let cert = F3GetCertificate::call(&client, (i,)).await?; match output { - `F3`OutputFormat::Text => { + F3OutputFormat::Text => { println!("{}", render_certificate_template(&cert)?); } - `F3`OutputFormat::Json => { + F3OutputFormat::Json => { println!("{}", serde_json::to_string_pretty(&cert)?); } } @@ -342,8 +342,8 @@ impl `F3`CertsCommands { } #[derive(Debug, Subcommand)] -pub enum `F3`PowerTableCommands { - /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. +pub enum F3PowerTableCommands { + /// Gets F3 power table at a specific instance ID or latest instance if none is specified. #[command(visible_alias = "g")] Get { /// instance ID. (default: latest) @@ -365,7 +365,7 @@ pub enum `F3`PowerTableCommands { }, } -impl `F3`PowerTableCommands { +impl F3PowerTableCommands { pub async fn run(self, client: rpc::Client) -> anyhow::Result<()> { match self { Self::Get { instance, ec } => { @@ -378,10 +378,10 @@ impl `F3`PowerTableCommands { for entry in power_table.iter() { scaled_total += scale_power(&entry.power, &total)?; } - let result = `F3`PowerTableGetCommandResult { + let result = F3PowerTableGetCommandResult { instance, from_ec: ec, - power_table: `F3`PowerTableCliJson { + power_table: F3PowerTableCliJson { cid: power_table_cid, entries: power_table, total, @@ -415,10 +415,10 @@ impl `F3`PowerTableCommands { } } - let result = `F3`PowerTableGetProportionCommandResult { + let result = F3PowerTableGetProportionCommandResult { instance, from_ec: ec, - power_table: `F3`PowerTableCliMinimalJson { + power_table: F3PowerTableCliMinimalJson { cid: power_table_cid, scaled_total, }, @@ -437,19 +437,19 @@ impl `F3`PowerTableCommands { client: &rpc::Client, instance: Option, ec: bool, - ) -> anyhow::Result<(u64, Cid, Vec<`F3`PowerEntry>)> { + ) -> anyhow::Result<(u64, Cid, Vec)> { let instance = if let Some(instance) = instance { instance } else { - let progress = `F3`GetProgress::call(client, ()).await?; + let progress = F3GetProgress::call(client, ()).await?; progress.id }; let (tsk, power_table_cid) = Self::get_power_table_tsk_by_instance(client, instance).await?; let power_table = if ec { - `F3`GetECPowerTable::call(client, (tsk.into(),)).await? + F3GetECPowerTable::call(client, (tsk.into(),)).await? } else { - `F3`Get`F3`PowerTableByInstance::call(client, (instance,)).await? + F3GetF3PowerTableByInstance::call(client, (instance,)).await? }; Ok((instance, power_table_cid, power_table)) } @@ -458,7 +458,7 @@ impl `F3`PowerTableCommands { client: &rpc::Client, instance: u64, ) -> anyhow::Result<(TipsetKey, Cid)> { - let manifest = `F3`GetManifest::call(client, ()).await?; + let manifest = F3GetManifest::call(client, ()).await?; if instance < manifest.initial_instance + manifest.committee_lookback { let epoch = manifest.bootstrap_epoch - manifest.ec.finality; let ts = ChainGetTipSetByHeight::call(client, (epoch, None.into())).await?; @@ -468,8 +468,8 @@ impl `F3`PowerTableCommands { )); } - let previous = `F3`GetCertificate::call(client, (instance.saturating_sub(1),)).await?; - let lookback = `F3`GetCertificate::call( + let previous = F3GetCertificate::call(client, (instance.saturating_sub(1),)).await?; + let lookback = F3GetCertificate::call( client, (instance.saturating_sub(manifest.committee_lookback),), ) @@ -479,7 +479,7 @@ impl `F3`PowerTableCommands { } } -fn render_manifest_template(template: &`F3`Manifest) -> anyhow::Result { +fn render_manifest_template(template: &F3Manifest) -> anyhow::Result { let mut context = tera::Context::from_serialize(template)?; context.insert( "initial_power_table_cid", @@ -552,7 +552,7 @@ fn render_certificate_template(template: &FinalityCertificate) -> anyhow::Result .to_owned()) } -fn render_progress_template(template: &`F3`InstanceProgress) -> anyhow::Result { +fn render_progress_template(template: &F3InstanceProgress) -> anyhow::Result { let mut context = tera::Context::from_serialize(template)?; context.insert("phase_string", template.phase_string()); Ok(TEMPLATES @@ -563,22 +563,22 @@ fn render_progress_template(template: &`F3`InstanceProgress) -> anyhow::Result, + entries: Vec, #[serde(with = "crate::lotus_json::stringify")] total: num::BigInt, scaled_total: i64, @@ -586,11 +586,11 @@ pub struct `F3`PowerTableCliJson { #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] -pub struct `F3`PowerTableGetProportionCommandResult { +pub struct F3PowerTableGetProportionCommandResult { instance: u64, #[serde(rename = "FromEC")] from_ec: bool, - power_table: `F3`PowerTableCliMinimalJson, + power_table: F3PowerTableCliMinimalJson, scaled_sum: i64, proportion: f64, not_found: Vec, @@ -599,7 +599,7 @@ pub struct `F3`PowerTableGetProportionCommandResult { #[serde_as] #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] -pub struct `F3`PowerTableCliMinimalJson { +pub struct F3PowerTableCliMinimalJson { #[serde(rename = "CID")] #[serde_as(as = "DisplayFromStr")] cid: Cid, diff --git a/src/cli/subcommands/f3_cmd/tests.rs b/src/cli/subcommands/f3_cmd/tests.rs index 2c182db1de39..172a04ba6d90 100644 --- a/src/cli/subcommands/f3_cmd/tests.rs +++ b/src/cli/subcommands/f3_cmd/tests.rs @@ -75,7 +75,7 @@ fn test_manifest_template() { "MaxCachedValidatedMessagesPerInstance": 25000 } }); - let manifest: `F3`Manifest = serde_json::from_value(lotus_json).unwrap(); + let manifest: F3Manifest = serde_json::from_value(lotus_json).unwrap(); println!("{}", render_manifest_template(&manifest).unwrap()); } @@ -86,7 +86,7 @@ fn test_progress_template() { "Round": 0, "Phase": 0 }); - let progress: `F3`InstanceProgress = serde_json::from_value(lotus_json).unwrap(); + let progress: F3InstanceProgress = serde_json::from_value(lotus_json).unwrap(); println!("{}", render_progress_template(&progress).unwrap()); } @@ -166,7 +166,7 @@ fn test_parse_range_valid() { ("10..9", Some(10), Some(9)), ]; for (range, expected_from, expected_to) in valid_cases { - let (from, to) = `F3`CertsCommands::parse_range_unvalidated(range).unwrap(); + let (from, to) = F3CertsCommands::parse_range_unvalidated(range).unwrap(); assert_eq!(from, expected_from); assert_eq!(to, expected_to); } @@ -176,6 +176,6 @@ fn test_parse_range_valid() { fn test_parse_range_invalid() { let invalid_cases = ["10..a", "a..20", "a..", "..b"]; for range in invalid_cases { - `F3`CertsCommands::parse_range_unvalidated(range).unwrap_err(); + F3CertsCommands::parse_range_unvalidated(range).unwrap_err(); } } diff --git a/src/cli/subcommands/mod.rs b/src/cli/subcommands/mod.rs index 4663dd638727..bbb39793a7e9 100644 --- a/src/cli/subcommands/mod.rs +++ b/src/cli/subcommands/mod.rs @@ -29,13 +29,13 @@ use tracing::error; pub(super) use self::{ auth_cmd::AuthCommands, chain_cmd::ChainCommands, config_cmd::ConfigCommands, - f3_cmd::`F3`Commands, healthcheck_cmd::HealthcheckCommand, mpool_cmd::MpoolCommands, + f3_cmd::F3Commands, healthcheck_cmd::HealthcheckCommand, mpool_cmd::MpoolCommands, net_cmd::NetCommands, shutdown_cmd::ShutdownCommand, snapshot_cmd::SnapshotCommands, state_cmd::StateCommands, sync_cmd::SyncCommands, wait_api_cmd::WaitApiCommand, }; use crate::cli::subcommands::info_cmd::InfoCommand; -/// `CLI` structure generated when interacting with Forest binary +/// CLI structure generated when interacting with Forest binary #[derive(Parser)] #[command(name = env!("CARGO_PKG_NAME"), bin_name = "forest-cli", author = env!("CARGO_PKG_AUTHORS"), version = FOREST_VERSION_STRING.as_str(), about = env!("CARGO_PKG_DESCRIPTION") )] @@ -94,9 +94,9 @@ pub enum Subcommand { #[command(subcommand)] Healthcheck(HealthcheckCommand), - /// Manages Filecoin Fast Finality (`F3`) interactions + /// Manages Filecoin Fast Finality (F3) interactions #[command(subcommand)] - `F3`(`F3`Commands), + F3(F3Commands), /// Wait for lotus API to come online WaitApi(WaitApiCommand), diff --git a/src/cli_shared/cli/completion_cmd.rs b/src/cli_shared/cli/completion_cmd.rs index 94c3440917ad..4c28f689aebd 100644 --- a/src/cli_shared/cli/completion_cmd.rs +++ b/src/cli_shared/cli/completion_cmd.rs @@ -8,7 +8,7 @@ use ahash::HashMap; use clap::{Command, CommandFactory}; use clap_complete::aot::{Shell, generate}; -/// Completion Command for generating shell completions for the `CLI` +/// Completion Command for generating shell completions for the CLI #[derive(Debug, clap::Args)] pub struct CompletionCommand { /// The binaries for which to generate completions (e.g., 'forest-cli,forest-tool,forest-wallet'). diff --git a/src/cli_shared/cli/mod.rs b/src/cli_shared/cli/mod.rs index d7251c6d7145..a74335eb6bf8 100644 --- a/src/cli_shared/cli/mod.rs +++ b/src/cli_shared/cli/mod.rs @@ -36,7 +36,7 @@ OPTIONS: {options} "; -/// `CLI` options +/// CLI options #[derive(Default, Debug, Parser)] pub struct CliOpts { /// A TOML file containing relevant configurations @@ -220,7 +220,7 @@ impl CliOpts { } } -/// `CLI` RPC options +/// CLI RPC options #[derive(Default, Debug, Parser)] pub struct CliRpcOpts { /// Admin token to interact with the node diff --git a/src/cli_shared/snapshot.rs b/src/cli_shared/snapshot.rs index 59ef857fafd0..f3a06bb40a0a 100644 --- a/src/cli_shared/snapshot.rs +++ b/src/cli_shared/snapshot.rs @@ -35,7 +35,7 @@ pub enum TrustedVendor { /// Create a filename in the "full" format. See [`parse`]. // Common between export, and [`fetch`]. -// Keep in sync with the `CLI` documentation for the `snapshot` sub-command. +// Keep in sync with the CLI documentation for the `snapshot` sub-command. pub fn filename( vendor: impl Display, chain: impl Display, diff --git a/src/daemon/db_util.rs b/src/daemon/db_util.rs index a66bf43fd786..666020166d80 100644 --- a/src/daemon/db_util.rs +++ b/src/daemon/db_util.rs @@ -253,8 +253,8 @@ pub async fn import_chain_as_forest_car( f3_root.display().to_string(), temp_f3_snap.path().display().to_string(), ) { - // Do not make it a hard error if anything is wrong with `F3` snapshot - tracing::error!("Failed to import `F3` snapshot: {e}"); + // Do not make it a hard error if anything is wrong with F3 snapshot + tracing::error!("Failed to import F3 snapshot: {e}"); } } diff --git a/src/daemon/main.rs b/src/daemon/main.rs index b71420c549bd..05f9d74c94d2 100644 --- a/src/daemon/main.rs +++ b/src/daemon/main.rs @@ -13,7 +13,7 @@ use std::ffi::OsString; use std::time::Duration; use tracing::info; -/// `CLI` structure generated when interacting with Forest binary +/// CLI structure generated when interacting with Forest binary #[derive(Parser)] #[command(name = env!("CARGO_PKG_NAME"), bin_name = "forest", author = env!("CARGO_PKG_AUTHORS"), version = FOREST_VERSION_STRING.as_str(), about = env!("CARGO_PKG_DESCRIPTION") )] diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index 4aa1ba1a2d3d..a0d611ce47b5 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -425,13 +425,13 @@ fn maybe_start_rpc_service( fn maybe_start_f3_service(opts: &CliOpts, config: &Config, ctx: &AppContext) -> anyhow::Result<()> { // already running - if crate::rpc::f3::`F3`_LEASE_MANAGER.get().is_some() { + if crate::rpc::f3::F3_LEASE_MANAGER.get().is_some() { return Ok(()); } if !config.client.enable_rpc { if crate::f3::is_sidecar_ffi_enabled(ctx.state_manager.chain_config()) { - tracing::warn!("`F3` sidecar is enabled but not run because RPC is disabled. ") + tracing::warn!("F3 sidecar is enabled but not run because RPC is disabled. ") } return Ok(()); } @@ -442,15 +442,15 @@ fn maybe_start_f3_service(opts: &CliOpts, config: &Config, ctx: &AppContext) -> let p2p_peer_id = ctx.p2p_peer_id; let admin_jwt = ctx.admin_jwt.clone(); tokio::task::spawn_blocking({ - crate::rpc::f3::`F3`_LEASE_MANAGER - .set(crate::rpc::f3::`F3`LeaseManager::new( + crate::rpc::f3::F3_LEASE_MANAGER + .set(crate::rpc::f3::F3LeaseManager::new( state_manager.chain_config().network.clone(), p2p_peer_id, )) - .expect("`F3` lease manager should not have been initialized before"); + .expect("F3 lease manager should not have been initialized before"); let chain_config = state_manager.chain_config().clone(); let f3_root = crate::f3::get_f3_root(config); - let crate::f3::`F3`Options { + let crate::f3::F3Options { chain_finality, bootstrap_epoch, initial_power_table, diff --git a/src/db/car/mod.rs b/src/db/car/mod.rs index e39c1d4ba5cd..efb97fc576ee 100644 --- a/src/db/car/mod.rs +++ b/src/db/car/mod.rs @@ -32,7 +32,7 @@ pub type CacheKey = u64; type FrameOffset = u64; -/// According to FRC-0108, `v2` snapshots have exactly one root pointing to metadata +/// According to FRC-0108, v2 snapshots have exactly one root pointing to metadata const V2_SNAPSHOT_ROOT_COUNT: usize = 1; pub static ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE: LazyLock = LazyLock::new(|| { diff --git a/src/db/car/plain.rs b/src/db/car/plain.rs index 86210c52b9a1..f69f5586ae2d 100644 --- a/src/db/car/plain.rs +++ b/src/db/car/plain.rs @@ -51,7 +51,7 @@ //! - [CAR documentation](https://ipld.io/specs/transport/car/carv1/#determinism) //! //! # Future work -//! - [`fadvise`](https://linux.die.net/man/2/posix_fadvise)-based `APIs` to pre-fetch parts of the +//! - [`fadvise`](https://linux.die.net/man/2/posix_fadvise)-based APIs to pre-fetch parts of the //! file, to improve random access performance. //! - Use an inner [`Blockstore`] for writes. //! - Use safe arithmetic for all operations - a malicious frame shouldn't cause a crash. diff --git a/src/f3/go_ffi.rs b/src/f3/go_ffi.rs index bae7d1c4f20d..144e162816e8 100644 --- a/src/f3/go_ffi.rs +++ b/src/f3/go_ffi.rs @@ -8,7 +8,7 @@ pub mod binding { } #[rust2go::r2g] -pub trait Go`F3`Node { +pub trait GoF3Node { fn run( rpc_endpoint: String, jwt: String, diff --git a/src/f3/mod.rs b/src/f3/mod.rs index 44f51a58d892..003fbb21016d 100644 --- a/src/f3/mod.rs +++ b/src/f3/mod.rs @@ -17,14 +17,14 @@ use cid::Cid; use crate::{networks::ChainConfig, utils::misc::env::is_env_set_and_truthy}; #[derive(Debug, Clone, Eq, PartialEq)] -pub struct `F3`Options { +pub struct F3Options { pub chain_finality: i64, pub bootstrap_epoch: i64, pub initial_power_table: Option, } pub fn get_f3_root(config: &crate::Config) -> PathBuf { - std::env::var("FOREST_`F3`_ROOT") + std::env::var("FOREST_F3_ROOT") .map(|p| Path::new(&p).to_path_buf()) .unwrap_or_else(|_| { config @@ -34,38 +34,38 @@ pub fn get_f3_root(config: &crate::Config) -> PathBuf { }) } -pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> `F3`Options { - let chain_finality = std::env::var("FOREST_`F3`_FINALITY") +pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> F3Options { + let chain_finality = std::env::var("FOREST_F3_FINALITY") .ok() .and_then(|v| match v.parse::() { Ok(f) if f > 0 => Some(f), _ => { tracing::warn!( - "Invalid FOREST_`F3`_FINALITY value {v}. A positive integer is expected." + "Invalid FOREST_F3_FINALITY value {v}. A positive integer is expected." ); None } }) .inspect(|i| { - tracing::info!("Using `F3` finality {i} set by FOREST_`F3`_FINALITY"); + tracing::info!("Using F3 finality {i} set by FOREST_F3_FINALITY"); }) .unwrap_or(chain_config.policy.chain_finality); - // This will be used post-bootstrap to hard-code the initial `F3`'s initial power table CID. + // This will be used post-bootstrap to hard-code the initial F3's initial power table CID. // Read from an environment variable for now before the hard-coded value is determined. - let initial_power_table = match std::env::var("FOREST_`F3`_INITIAL_POWER_TABLE") { + let initial_power_table = match std::env::var("FOREST_F3_INITIAL_POWER_TABLE") { Ok(i) if i.is_empty() => { - tracing::info!("`F3` initial power table cid is unset by FOREST_`F3`_INITIAL_POWER_TABLE"); + tracing::info!("F3 initial power table cid is unset by FOREST_F3_INITIAL_POWER_TABLE"); None } Ok(i) => { if let Ok(cid) = i.parse() { tracing::info!( - "Using `F3` initial power table cid {i} set by FOREST_`F3`_INITIAL_POWER_TABLE" + "Using F3 initial power table cid {i} set by FOREST_F3_INITIAL_POWER_TABLE" ); Some(cid) } else { tracing::warn!( - "Invalid power table cid {i} set by FOREST_`F3`_INITIAL_POWER_TABLE, fallback to chain config" + "Invalid power table cid {i} set by FOREST_F3_INITIAL_POWER_TABLE, fallback to chain config" ); chain_config.f3_initial_power_table } @@ -73,15 +73,15 @@ pub fn get_f3_sidecar_params(chain_config: &ChainConfig) -> `F3`Options { _ => chain_config.f3_initial_power_table, }; - let bootstrap_epoch = std::env::var("FOREST_`F3`_BOOTSTRAP_EPOCH") + let bootstrap_epoch = std::env::var("FOREST_F3_BOOTSTRAP_EPOCH") .ok() .and_then(|i| i.parse().ok()) .inspect(|i| { - tracing::info!("Using `F3` bootstrap epoch {i} set by FOREST_`F3`_BOOTSTRAP_EPOCH") + tracing::info!("Using F3 bootstrap epoch {i} set by FOREST_F3_BOOTSTRAP_EPOCH") }) .unwrap_or(chain_config.f3_bootstrap_epoch); - `F3`Options { + F3Options { chain_finality, bootstrap_epoch, initial_power_table, @@ -102,8 +102,8 @@ pub fn run_f3_sidecar_if_enabled( if is_sidecar_ffi_enabled(chain_config) { #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { - tracing::info!("Starting `F3` sidecar service ..."); - Go`F3`NodeImpl::run( + tracing::info!("Starting F3 sidecar service ..."); + GoF3NodeImpl::run( rpc_endpoint, jwt, f3_rpc_endpoint, @@ -127,34 +127,34 @@ pub fn import_f3_snapshot( #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { let sw = std::time::Instant::now(); - tracing::info!("Importing `F3` snapshot ..."); - let err = Go`F3`NodeImpl::import_snap(rpc_endpoint, f3_root, snapshot); + tracing::info!("Importing F3 snapshot ..."); + let err = GoF3NodeImpl::import_snap(rpc_endpoint, f3_root, snapshot); if !err.is_empty() { anyhow::bail!("{err}"); } tracing::info!( - "Imported `F3` snapshot, took {}", + "Imported F3 snapshot, took {}", humantime::format_duration(sw.elapsed()) ); } } else { - tracing::warn!("`F3` sidecar is disabled, skip importing the `F3` snapshot"); + tracing::warn!("F3 sidecar is disabled, skip importing the F3 snapshot"); } Ok(()) } -/// Whether `F3` sidecar via FFI is enabled. +/// Whether F3 sidecar via FFI is enabled. pub fn is_sidecar_ffi_enabled(chain_config: &ChainConfig) -> bool { // Respect the environment variable when set, and fallback to chain config when not set. let enabled = - is_env_set_and_truthy("FOREST_`F3`_SIDECAR_FFI_ENABLED").unwrap_or(chain_config.f3_enabled); + is_env_set_and_truthy("FOREST_F3_SIDECAR_FFI_ENABLED").unwrap_or(chain_config.f3_enabled); cfg_if::cfg_if! { if #[cfg(all(f3sidecar, not(feature = "no-f3-sidecar")))] { enabled } else { if enabled { - tracing::info!("Failed to enable `F3` sidecar, the Forest binary is not compiled with f3-sidecar Go lib"); + tracing::info!("Failed to enable F3 sidecar, the Forest binary is not compiled with f3-sidecar Go lib"); } false } @@ -171,7 +171,7 @@ mod tests { // No environment variable overrides assert_eq!( get_f3_sidecar_params(&chain_config), - `F3`Options { + F3Options { chain_finality: chain_config.policy.chain_finality, bootstrap_epoch: chain_config.f3_bootstrap_epoch, initial_power_table: chain_config.f3_initial_power_table, @@ -179,17 +179,17 @@ mod tests { ); unsafe { - std::env::set_var("FOREST_`F3`_FINALITY", "100"); + std::env::set_var("FOREST_F3_FINALITY", "100"); // A random CID std::env::set_var( - "FOREST_`F3`_INITIAL_POWER_TABLE", + "FOREST_F3_INITIAL_POWER_TABLE", "bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i", ); - std::env::set_var("FOREST_`F3`_BOOTSTRAP_EPOCH", "100"); + std::env::set_var("FOREST_F3_BOOTSTRAP_EPOCH", "100"); } assert_eq!( get_f3_sidecar_params(&chain_config), - `F3`Options { + F3Options { chain_finality: 100, bootstrap_epoch: 100, initial_power_table: Some( @@ -200,10 +200,10 @@ mod tests { } ); // Unset initial power table - unsafe { std::env::set_var("FOREST_`F3`_INITIAL_POWER_TABLE", "") }; + unsafe { std::env::set_var("FOREST_F3_INITIAL_POWER_TABLE", "") }; assert_eq!( get_f3_sidecar_params(&chain_config), - `F3`Options { + F3Options { chain_finality: 100, bootstrap_epoch: 100, initial_power_table: None, diff --git a/src/f3/snapshot.rs b/src/f3/snapshot.rs index 8ffafb1732a5..2b8a6d597500 100644 --- a/src/f3/snapshot.rs +++ b/src/f3/snapshot.rs @@ -4,7 +4,7 @@ #[cfg(test)] mod tests; -use crate::{rpc::f3::`F3`PowerEntry, utils::multihash::MultihashCode}; +use crate::{rpc::f3::F3PowerEntry, utils::multihash::MultihashCode}; use cid::Cid; use fvm_ipld_encoding::{IPLD_RAW, tuple::*}; use integer_encoding::VarIntReader as _; @@ -19,14 +19,14 @@ pub fn get_f3_snapshot_cid(f3_data: &mut impl Read) -> anyhow::Result { /// Defined in #[derive(Debug, Clone, Eq, PartialEq, Serialize_tuple, Deserialize_tuple)] -pub struct `F3`SnapshotHeader { +pub struct F3SnapshotHeader { pub version: u64, pub first_instance: u64, pub latest_instance: u64, - pub initial_power_table: Vec<`F3`PowerEntry>, + pub initial_power_table: Vec, } -impl `F3`SnapshotHeader { +impl F3SnapshotHeader { pub fn decode_from_snapshot(f3_snapshot: &mut impl Read) -> anyhow::Result { // Reasonable upper bound for snapshot header size (100MiB) const MAX_HEADER_SIZE: usize = 100 * 1024 * 1024; @@ -34,7 +34,7 @@ impl `F3`SnapshotHeader { let data_len = f3_snapshot.read_varint::()?; anyhow::ensure!( data_len <= MAX_HEADER_SIZE, - "`F3` snapshot header size {data_len} exceeds maximum allowed size {MAX_HEADER_SIZE}" + "F3 snapshot header size {data_len} exceeds maximum allowed size {MAX_HEADER_SIZE}" ); let mut data_bytes = vec![0; data_len]; f3_snapshot.read_exact(&mut data_bytes)?; @@ -42,10 +42,10 @@ impl `F3`SnapshotHeader { } } -impl std::fmt::Display for `F3`SnapshotHeader { +impl std::fmt::Display for F3SnapshotHeader { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - writeln!(f, "`F3` snapshot version: {}", self.version)?; - writeln!(f, "`F3` snapshot first instance: {}", self.first_instance)?; - write!(f, "`F3` snapshot last instance: {}", self.latest_instance) + writeln!(f, "F3 snapshot version: {}", self.version)?; + writeln!(f, "F3 snapshot first instance: {}", self.first_instance)?; + write!(f, "F3 snapshot last instance: {}", self.latest_instance) } } diff --git a/src/f3/snapshot/tests.rs b/src/f3/snapshot/tests.rs index 27a03e7b56e9..996acf1f05b6 100644 --- a/src/f3/snapshot/tests.rs +++ b/src/f3/snapshot/tests.rs @@ -3,12 +3,12 @@ use super::*; -const ENCODED_`F3`_SNAP_HEADER_HEX: &str = "8401001a00086e7d94831a00021b71480002fbe0000000005830aedb9e1f2f4e20a6a6327b9136b8472b16f1f56cec2b6d9341a12a97dc90a39e93f026baefeea09b7507e3bf1fc70981831a00022eff4800010ae80000000058308cc2fc55933c0413e763b63b10b131b3e53f57882e0c79231de0ada3227e01ed817d689e3150874170a4a2f6b590cd93831943eb48000103dcdf0000005830b2158a380b942e099ee4c7522921d638598ebb487f97c5d5ed06a29ba47f620513316f7a596b0a4d5aff7343275c212f83190fc84700faa80000000058308a9b00505fedc14edde52278ea229f4fe91e80890f5f8951200663e41f8034986f56ffd593f4e6a9a282a81ef8dfdc1c831a0002114a4700b2180000000058308c39f779f522b8de5836f7c421427f40556f934376e493a6e0fc0c72f8e35228fcf14e116fa73146ae4d88710c668e4083190ec64700948000000000583095748c4cd115988755c49578725996df98eb96c0447f2b4d5064d6562876745950d64ffb410b6db141b3a43e49a0d6908319ea7847003a90000000005830b5a56233aa1dcbffa5a2326e9b224826b3d540998e8dffea40ee238a7c7ed67e6cc9e21fad0e3e4af9dd00329063c9cd831945b047001fd0ec10000058308cddcf1d23cf25a361cd9a451eeed1d391aae84adc2220d3b2d6d9b6c929d487581ddbde3c53b6770b1b1b3dfe21e8bc831a0001c5b3470001980000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001e00a470001600000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001c2ad47000138000000005830a64817823ab8728463b34ee36b44761ffdab722762d675f76f631dcfc02affc95e9f54cd765b7bc98c1619991dfbe2f2831a0002307b4600b8000000005830962b2e0e92443cec526cac167a7f80f42bd907b68c17f2e93baff6232b8f4d396b43458810dd95aea41163b7cc047222831903f54600b0000000005830a37c98356d8fa32a1a8fcbd6a009395c4a34177aae9cd28c1c652963fbe445e95513e9f0c8281047ebcbf97cdd0aed0f831a00021051460090009000005830a57b3347936bc303bdf8fc232e701270db3817507562f0cd591114adeb5596c665f828510f52f678e213ad31f0eb6b3383190e7a460078000000005830b234c6533b5b40b7241345a9e9a06eea45877b510170ae9d221bfcdd577d482ead9eb1f74992f667e96459ff43b0e5218319049b460068000000005830a6c8a62aec6bff5b185c220aebe671af9cb24560fce4913c7edffd4368ba7af67a292ab8bfde1b326d6885b27976d59b831a0001bf50460040000000005830ad31d1d68bb36fc0e830ad5d452c7e676ff3277d3ad86a45bacbdfe15b5d89119434fa003031dd2f82907717aba10f9b8319048f46002800000000583097f447a28d7a7a3a489a1683d5a6eb7f0a96bac3b67d6dfeee43bb8ed3a8b223887d9defc6436b73e8b75b2ee2cf9b4f8319066b4600280000000058309561056d88ceb20291cb4770aab1613502bbf8bd226bb0b1ba132cf770bbd00120cc6c09ebf4f4c6ae0fab38d83c833d831a0002286b4600220000000058308018ef30920f5ef4420164b13a806958563fabd74a356537bd38796d0baf070d8c10f3ba57e34ee1ccbea1517bcff9c2"; +const ENCODED_F3_SNAP_HEADER_HEX: &str = "8401001a00086e7d94831a00021b71480002fbe0000000005830aedb9e1f2f4e20a6a6327b9136b8472b16f1f56cec2b6d9341a12a97dc90a39e93f026baefeea09b7507e3bf1fc70981831a00022eff4800010ae80000000058308cc2fc55933c0413e763b63b10b131b3e53f57882e0c79231de0ada3227e01ed817d689e3150874170a4a2f6b590cd93831943eb48000103dcdf0000005830b2158a380b942e099ee4c7522921d638598ebb487f97c5d5ed06a29ba47f620513316f7a596b0a4d5aff7343275c212f83190fc84700faa80000000058308a9b00505fedc14edde52278ea229f4fe91e80890f5f8951200663e41f8034986f56ffd593f4e6a9a282a81ef8dfdc1c831a0002114a4700b2180000000058308c39f779f522b8de5836f7c421427f40556f934376e493a6e0fc0c72f8e35228fcf14e116fa73146ae4d88710c668e4083190ec64700948000000000583095748c4cd115988755c49578725996df98eb96c0447f2b4d5064d6562876745950d64ffb410b6db141b3a43e49a0d6908319ea7847003a90000000005830b5a56233aa1dcbffa5a2326e9b224826b3d540998e8dffea40ee238a7c7ed67e6cc9e21fad0e3e4af9dd00329063c9cd831945b047001fd0ec10000058308cddcf1d23cf25a361cd9a451eeed1d391aae84adc2220d3b2d6d9b6c929d487581ddbde3c53b6770b1b1b3dfe21e8bc831a0001c5b3470001980000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001e00a470001600000000058308d1768b8b3c8fe31025ce52323dc1112bd2e3d1b39923cab98aa821283100fe3635eee56938b63eb60eef4e117c55013831a0001c2ad47000138000000005830a64817823ab8728463b34ee36b44761ffdab722762d675f76f631dcfc02affc95e9f54cd765b7bc98c1619991dfbe2f2831a0002307b4600b8000000005830962b2e0e92443cec526cac167a7f80f42bd907b68c17f2e93baff6232b8f4d396b43458810dd95aea41163b7cc047222831903f54600b0000000005830a37c98356d8fa32a1a8fcbd6a009395c4a34177aae9cd28c1c652963fbe445e95513e9f0c8281047ebcbf97cdd0aed0f831a00021051460090009000005830a57b3347936bc303bdf8fc232e701270db3817507562f0cd591114adeb5596c665f828510f52f678e213ad31f0eb6b3383190e7a460078000000005830b234c6533b5b40b7241345a9e9a06eea45877b510170ae9d221bfcdd577d482ead9eb1f74992f667e96459ff43b0e5218319049b460068000000005830a6c8a62aec6bff5b185c220aebe671af9cb24560fce4913c7edffd4368ba7af67a292ab8bfde1b326d6885b27976d59b831a0001bf50460040000000005830ad31d1d68bb36fc0e830ad5d452c7e676ff3277d3ad86a45bacbdfe15b5d89119434fa003031dd2f82907717aba10f9b8319048f46002800000000583097f447a28d7a7a3a489a1683d5a6eb7f0a96bac3b67d6dfeee43bb8ed3a8b223887d9defc6436b73e8b75b2ee2cf9b4f8319066b4600280000000058309561056d88ceb20291cb4770aab1613502bbf8bd226bb0b1ba132cf770bbd00120cc6c09ebf4f4c6ae0fab38d83c833d831a0002286b4600220000000058308018ef30920f5ef4420164b13a806958563fabd74a356537bd38796d0baf070d8c10f3ba57e34ee1ccbea1517bcff9c2"; #[test] pub fn test_f3_snap_header_serde() { - let encoded_block_bytes = hex::decode(ENCODED_`F3`_SNAP_HEADER_HEX).unwrap(); - let `F3`SnapshotHeader { + let encoded_block_bytes = hex::decode(ENCODED_F3_SNAP_HEADER_HEX).unwrap(); + let F3SnapshotHeader { version, first_instance, latest_instance, diff --git a/src/health/endpoints.rs b/src/health/endpoints.rs index 0287db64bd6f..1d1a5f3e57a9 100644 --- a/src/health/endpoints.rs +++ b/src/health/endpoints.rs @@ -8,7 +8,7 @@ use axum::extract::{self, Query}; use super::{AppError, ForestState}; use crate::chain_sync::NodeSyncStatus; use crate::networks::calculate_expected_epoch; -use crate::rpc::f3::`F3`IsRunning; +use crate::rpc::f3::F3IsRunning; /// Query parameter for verbose responses const VERBOSE_PARAM: &str = "verbose"; @@ -44,7 +44,7 @@ pub(crate) async fn livez( /// - The node is in sync with the network /// - The current epoch of the node is not too far behind the network /// - The RPC server is running if not disabled -/// - The `F3` side car is running if enabled +/// - The F3 side car is running if enabled /// /// If any of these conditions are not met, the nod is **not** ready to serve requests. pub(crate) async fn readyz( @@ -163,7 +163,7 @@ async fn check_f3_running(state: &ForestState, acc: &mut MessageAccumulator) -> if !crate::f3::is_sidecar_ffi_enabled(&state.chain_config) { acc.push_ok("f3 disabled"); true - } else if `F3`IsRunning::is_f3_running().await.unwrap_or_default() { + } else if F3IsRunning::is_f3_running().await.unwrap_or_default() { acc.push_ok("f3 running"); true } else { diff --git a/src/libp2p/discovery.rs b/src/libp2p/discovery.rs index 5309ed5ed49d..0294886a601a 100644 --- a/src/libp2p/discovery.rs +++ b/src/libp2p/discovery.rs @@ -35,7 +35,7 @@ use crate::{networks::GenesisNetworkName, utils::version::FOREST_VERSION_STRING} pub struct DerivedDiscoveryBehaviour { /// Kademlia discovery. kademlia: Toggle>, - /// Kademlia discovery for bootstrapping `F3` sidecar when the main Kademlia is disabled. + /// Kademlia discovery for bootstrapping F3 sidecar when the main Kademlia is disabled. kademlia_f3_sidecar: kad::Behaviour, /// Discovers nodes on the local network. mdns: Toggle, @@ -484,7 +484,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { trace!("Libp2p => Unhandled Kademlia event: {:?}", other) } }, - DerivedDiscoveryBehaviourEvent::Kademlia`F3`Sidecar(_) => {} + DerivedDiscoveryBehaviourEvent::KademliaF3Sidecar(_) => {} DerivedDiscoveryBehaviourEvent::Mdns(ev) => match ev { MdnsEvent::Discovered(list) => { if self.n_node_connected >= self.target_peer_count { diff --git a/src/lotus_json/sector_size.rs b/src/lotus_json/sector_size.rs index 74ad8f5a40a3..96c1fc22653c 100644 --- a/src/lotus_json/sector_size.rs +++ b/src/lotus_json/sector_size.rs @@ -6,7 +6,7 @@ use crate::shim::sector::SectorSize; #[derive(Serialize, Deserialize, JsonSchema)] #[schemars(rename = "SectorSize")] -// This should probably be a JSON Schema `enum` +// This should probably be a JSON Schema enum pub struct SectorSizeLotusJson(#[schemars(with = "u64")] SectorSize); impl HasLotusJson for SectorSize { diff --git a/src/message_pool/msgpool/selection.rs b/src/message_pool/msgpool/selection.rs index 24a3531b9cf2..83ee3c2d7028 100644 --- a/src/message_pool/msgpool/selection.rs +++ b/src/message_pool/msgpool/selection.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Contains routines for message selection `APIs`. +//! Contains routines for message selection APIs. //! Whenever a miner is ready to create a block for a tipset, it invokes the //! `select_messages` API which selects an appropriate set of messages such that //! it optimizes miner reward and chain capacity. See for more details diff --git a/src/message_pool/msgpool/test_provider.rs b/src/message_pool/msgpool/test_provider.rs index a5e6be07797f..36b8b3b40b19 100644 --- a/src/message_pool/msgpool/test_provider.rs +++ b/src/message_pool/msgpool/test_provider.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Contains mock implementations for testing internal `MessagePool` `APIs` +//! Contains mock implementations for testing internal `MessagePool` APIs use std::{convert::TryFrom, sync::Arc}; diff --git a/src/networks/mod.rs b/src/networks/mod.rs index ae2c49d7cb72..fc3723107de1 100644 --- a/src/networks/mod.rs +++ b/src/networks/mod.rs @@ -265,7 +265,7 @@ pub struct ChainConfig { // See FIP-0100 and https://github.com/filecoin-project/lotus/pull/12938 for why this exists pub upgrade_teep_initial_fil_reserved: Option, pub f3_enabled: bool, - // `F3`Consensus set whether `F3` should checkpoint tipsets finalized by `F3`. This flag has no effect if `F3` is not enabled. + // F3Consensus set whether F3 should checkpoint tipsets finalized by F3. This flag has no effect if F3 is not enabled. pub f3_consensus: bool, pub f3_bootstrap_epoch: i64, pub f3_initial_power_table: Option, diff --git a/src/rpc/client.rs b/src/rpc/client.rs index 1ea2c10bfb56..4c4a877eb661 100644 --- a/src/rpc/client.rs +++ b/src/rpc/client.rs @@ -5,7 +5,7 @@ //! - use [`jsonrpsee`] clients and primitives. //! - Support [`rpc::Request`](crate::rpc::Request). //! - Support different -//! - endpoint paths (`v0`, `v1`). +//! - endpoint paths (`v0`, v1). //! - communication protocols (`ws`, `http`). //! - Support per-request timeouts. diff --git a/src/rpc/filter_list.rs b/src/rpc/filter_list.rs index 4a489d44272b..7abbcd28f752 100644 --- a/src/rpc/filter_list.rs +++ b/src/rpc/filter_list.rs @@ -129,17 +129,17 @@ mod tests { let mut filter_file = tempfile::Builder::new().tempfile().unwrap(); write!( filter_file, - r#"# Allow all `F3` methods, except for `F3`.GetParent - `F3`. - !`F3`.GetParent + r#"# Allow all F3 methods, except for F3.GetParent + F3. + !F3.GetParent "# ) .unwrap(); let list = FilterList::new_from_file(filter_file.path()).unwrap(); - assert!(!list.authorize("`F3`.GetParent")); - assert!(list.authorize("`F3`.GetHead")); - assert!(list.authorize("`F3`.GetPowerTable")); + assert!(!list.authorize("F3.GetParent")); + assert!(list.authorize("F3.GetHead")); + assert!(list.authorize("F3.GetPowerTable")); assert!(!list.authorize("Filecoin.ChainExport")); } } diff --git a/src/rpc/methods/chain.rs b/src/rpc/methods/chain.rs index 6f264635c374..4ecc22cf871c 100644 --- a/src/rpc/methods/chain.rs +++ b/src/rpc/methods/chain.rs @@ -17,7 +17,7 @@ use crate::lotus_json::{HasLotusJson, LotusJson, lotus_json_with_self}; use crate::lotus_json::{assert_all_snapshots, assert_unchanged_via_json}; use crate::message::{ChainMessage, SignedMessage}; use crate::rpc::eth::{EthLog, eth_logs_with_filter, types::ApiHeaders, types::EthFilterSpec}; -use crate::rpc::f3::`F3`ExportLatestSnapshot; +use crate::rpc::f3::F3ExportLatestSnapshot; use crate::rpc::types::{ApiTipsetKey, Event}; use crate::rpc::{ApiPaths, Ctx, EthEventHandler, Permission, RpcMethod, ServerError}; use crate::shim::clock::ChainEpoch; @@ -378,11 +378,11 @@ impl RpcMethod<1> for ForestChainExport { .into_temp_path() }; let f3_snap = { - match `F3`ExportLatestSnapshot::run(f3_snap_tmp_path.display().to_string()).await + match F3ExportLatestSnapshot::run(f3_snap_tmp_path.display().to_string()).await { Ok(cid) => Some((cid, File::open(&f3_snap_tmp_path)?)), Err(e) => { - tracing::error!("Failed to export `F3` snapshot: {e}"); + tracing::error!("Failed to export F3 snapshot: {e}"); None } } diff --git a/src/rpc/methods/f3.rs b/src/rpc/methods/f3.rs index afae5d9aa3f6..73c0819ad208 100644 --- a/src/rpc/methods/f3.rs +++ b/src/rpc/methods/f3.rs @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! -//! This module contains `F3`(fast finality) related V1 RPC methods -//! as well as some internal RPC methods(`F3`.*) that power +//! This module contains F3(fast finality) related V1 RPC methods +//! as well as some internal RPC methods(F3.*) that power //! the go-f3 node in sidecar mode. //! @@ -11,7 +11,7 @@ mod types; mod util; pub use self::types::{ - `F3`InstanceProgress, `F3`LeaseManager, `F3`Manifest, `F3`PowerEntry, FinalityCertificate, + F3InstanceProgress, F3LeaseManager, F3Manifest, F3PowerEntry, FinalityCertificate, }; use self::{types::*, util::*}; use super::wallet::WalletSign; @@ -57,12 +57,12 @@ use std::{ sync::{Arc, LazyLock, OnceLock}, }; -pub static `F3`_LEASE_MANAGER: OnceLock<`F3`LeaseManager> = OnceLock::new(); +pub static F3_LEASE_MANAGER: OnceLock = OnceLock::new(); pub enum GetRawNetworkName {} impl RpcMethod<0> for GetRawNetworkName { - const NAME: &'static str = "`F3`.GetRawNetworkName"; + const NAME: &'static str = "F3.GetRawNetworkName"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -77,13 +77,13 @@ impl RpcMethod<0> for GetRawNetworkName { pub enum GetTipsetByEpoch {} impl RpcMethod<1> for GetTipsetByEpoch { - const NAME: &'static str = "`F3`.GetTipsetByEpoch"; + const NAME: &'static str = "F3.GetTipsetByEpoch"; const PARAM_NAMES: [&'static str; 1] = ["epoch"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ChainEpoch,); - type Ok = `F3`TipSet; + type Ok = F3TipSet; async fn handle( ctx: Ctx, @@ -100,13 +100,13 @@ impl RpcMethod<1> for GetTipsetByEpoch { pub enum GetTipset {} impl RpcMethod<1> for GetTipset { - const NAME: &'static str = "`F3`.GetTipset"; + const NAME: &'static str = "F3.GetTipset"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (`F3`TipSetKey,); - type Ok = `F3`TipSet; + type Params = (F3TipSetKey,); + type Ok = F3TipSet; async fn handle( ctx: Ctx, @@ -120,13 +120,13 @@ impl RpcMethod<1> for GetTipset { pub enum GetHead {} impl RpcMethod<0> for GetHead { - const NAME: &'static str = "`F3`.GetHead"; + const NAME: &'static str = "F3.GetHead"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = `F3`TipSet; + type Ok = F3TipSet; async fn handle(ctx: Ctx, _: Self::Params) -> Result { Ok(ctx.chain_store().heaviest_tipset().into()) @@ -135,13 +135,13 @@ impl RpcMethod<0> for GetHead { pub enum GetParent {} impl RpcMethod<1> for GetParent { - const NAME: &'static str = "`F3`.GetParent"; + const NAME: &'static str = "F3.GetParent"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (`F3`TipSetKey,); - type Ok = `F3`TipSet; + type Params = (F3TipSetKey,); + type Ok = F3TipSet; async fn handle( ctx: Ctx, @@ -160,7 +160,7 @@ impl GetPowerTable { async fn compute( ctx: &Ctx, ts: &Arc, - ) -> anyhow::Result> { + ) -> anyhow::Result> { // The RAM overhead on mainnet is ~14MiB const BLOCKSTORE_CACHE_CAP: usize = 65536; static BLOCKSTORE_CACHE: LazyLock = LazyLock::new(|| { @@ -454,12 +454,12 @@ impl GetPowerTable { anyhow::bail!("wrong type of worker address"); } let pub_key = waddr.payload_bytes(); - power_entries.push(`F3`PowerEntry { id, power, pub_key }); + power_entries.push(F3PowerEntry { id, power, pub_key }); } power_entries.sort(); if let Some(stats) = db.stats() { - tracing::debug!(epoch=%ts.epoch(), hit=%stats.hit(), miss=%stats.miss(),cache_len=%BLOCKSTORE_CACHE.len(), "`F3`.GetPowerTable blockstore read cache"); + tracing::debug!(epoch=%ts.epoch(), hit=%stats.hit(), miss=%stats.miss(),cache_len=%BLOCKSTORE_CACHE.len(), "F3.GetPowerTable blockstore read cache"); } Ok(power_entries) @@ -467,13 +467,13 @@ impl GetPowerTable { } impl RpcMethod<1> for GetPowerTable { - const NAME: &'static str = "`F3`.GetPowerTable"; + const NAME: &'static str = "F3.GetPowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; - type Params = (`F3`TipSetKey,); - type Ok = Vec<`F3`PowerEntry>; + type Params = (F3TipSetKey,); + type Ok = Vec; async fn handle( ctx: Ctx, @@ -483,14 +483,14 @@ impl RpcMethod<1> for GetPowerTable { let start = std::time::Instant::now(); let ts = ctx.chain_index().load_required_tipset(&tsk)?; let power_entries = Self::compute(&ctx, &ts).await?; - tracing::debug!(epoch=%ts.epoch(), %tsk, "`F3`.GetPowerTable, took {}", humantime::format_duration(start.elapsed())); + tracing::debug!(epoch=%ts.epoch(), %tsk, "F3.GetPowerTable, took {}", humantime::format_duration(start.elapsed())); Ok(power_entries) } } pub enum ProtectPeer {} impl RpcMethod<1> for ProtectPeer { - const NAME: &'static str = "`F3`.ProtectPeer"; + const NAME: &'static str = "F3.ProtectPeer"; const PARAM_NAMES: [&'static str; 1] = ["peer_id"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -517,7 +517,7 @@ impl RpcMethod<1> for ProtectPeer { pub enum GetParticipatingMinerIDs {} impl RpcMethod<0> for GetParticipatingMinerIDs { - const NAME: &'static str = "`F3`.GetParticipatingMinerIDs"; + const NAME: &'static str = "F3.GetParticipatingMinerIDs"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -526,9 +526,9 @@ impl RpcMethod<0> for GetParticipatingMinerIDs { type Ok = Vec; async fn handle(_: Ctx, _: Self::Params) -> Result { - let participants = `F3`ListParticipants::run().await?; + let participants = F3ListParticipants::run().await?; let mut ids: HashSet = participants.into_iter().map(|p| p.miner_id).collect(); - if let Some(permanent_miner_ids) = (*`F3`_PERMANENT_PARTICIPATING_MINER_IDS).clone() { + if let Some(permanent_miner_ids) = (*F3_PERMANENT_PARTICIPATING_MINER_IDS).clone() { ids.extend(permanent_miner_ids); } Ok(ids.into_iter().collect()) @@ -537,12 +537,12 @@ impl RpcMethod<0> for GetParticipatingMinerIDs { pub enum Finalize {} impl RpcMethod<1> for Finalize { - const NAME: &'static str = "`F3`.Finalize"; + const NAME: &'static str = "F3.Finalize"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Write; - type Params = (`F3`TipSetKey,); + type Params = (F3TipSetKey,); type Ok = (); async fn handle( @@ -550,7 +550,7 @@ impl RpcMethod<1> for Finalize { (f3_tsk,): Self::Params, ) -> Result { // Respect the environment variable when set, and fallback to chain config when not set. - let enabled = is_env_set_and_truthy("FOREST_`F3`_CONSENSUS_ENABLED") + let enabled = is_env_set_and_truthy("FOREST_F3_CONSENSUS_ENABLED") .unwrap_or(ctx.chain_config().f3_consensus); if !enabled { return Ok(()); @@ -571,12 +571,12 @@ impl RpcMethod<1> for Finalize { // When finalized_ts is not part of the current chain, // reset the current head to finalized_ts. // Note that when finalized_ts is newer than head or older than head - chain_finality, - // we don't reset the head to allow the chain or `F3` to catch up. + // we don't reset the head to allow the chain or F3 to catch up. if head.epoch() >= finalized_ts.epoch() && head.epoch() <= finalized_ts.epoch() + ctx.chain_config().policy.chain_finality { tracing::debug!( - "`F3` finalized tsk {} at epoch {}", + "F3 finalized tsk {} at epoch {}", finalized_ts.key(), finalized_ts.epoch() ); @@ -586,7 +586,7 @@ impl RpcMethod<1> for Finalize { .any(|ts| ts == finalized_ts) { tracing::info!( - "`F3` reset chain head to tsk {} at epoch {}", + "F3 reset chain head to tsk {} at epoch {}", finalized_ts.key(), finalized_ts.epoch() ); @@ -613,7 +613,7 @@ impl RpcMethod<1> for Finalize { pub enum SignMessage {} impl RpcMethod<2> for SignMessage { - const NAME: &'static str = "`F3`.SignMessage"; + const NAME: &'static str = "F3.SignMessage"; const PARAM_NAMES: [&'static str; 2] = ["pubkey", "message"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; @@ -631,27 +631,27 @@ impl RpcMethod<2> for SignMessage { } } -pub enum `F3`ExportLatestSnapshot {} +pub enum F3ExportLatestSnapshot {} -impl `F3`ExportLatestSnapshot { +impl F3ExportLatestSnapshot { pub async fn run(path: String) -> anyhow::Result { let client = get_rpc_http_client()?; let mut params = ArrayParams::new(); params.insert(path)?; let LotusJson(cid): LotusJson = client - .request("Filecoin.`F3`ExportLatestSnapshot", params) + .request("Filecoin.F3ExportLatestSnapshot", params) .await?; Ok(cid) } } -impl RpcMethod<1> for `F3`ExportLatestSnapshot { - const NAME: &'static str = "`F3`.ExportLatestSnapshot"; +impl RpcMethod<1> for F3ExportLatestSnapshot { + const NAME: &'static str = "F3.ExportLatestSnapshot"; const PARAM_NAMES: [&'static str; 1] = ["path"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; const DESCRIPTION: Option<&'static str> = - Some("Exports the latest `F3` snapshot to the specified path and returns its CID"); + Some("Exports the latest F3 snapshot to the specified path and returns its CID"); type Params = (String,); type Ok = Cid; @@ -665,9 +665,9 @@ impl RpcMethod<1> for `F3`ExportLatestSnapshot { } /// returns a finality certificate at given instance number -pub enum `F3`GetCertificate {} -impl RpcMethod<1> for `F3`GetCertificate { - const NAME: &'static str = "Filecoin.`F3`GetCertificate"; +pub enum F3GetCertificate {} +impl RpcMethod<1> for F3GetCertificate { + const NAME: &'static str = "Filecoin.F3GetCertificate"; const PARAM_NAMES: [&'static str; 1] = ["instance"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -688,9 +688,9 @@ impl RpcMethod<1> for `F3`GetCertificate { } /// returns the latest finality certificate -pub enum `F3`GetLatestCertificate {} -impl RpcMethod<0> for `F3`GetLatestCertificate { - const NAME: &'static str = "Filecoin.`F3`GetLatestCertificate"; +pub enum F3GetLatestCertificate {} +impl RpcMethod<0> for F3GetLatestCertificate { + const NAME: &'static str = "Filecoin.F3GetLatestCertificate"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -705,15 +705,15 @@ impl RpcMethod<0> for `F3`GetLatestCertificate { } } -pub enum `F3`GetECPowerTable {} -impl RpcMethod<1> for `F3`GetECPowerTable { - const NAME: &'static str = "Filecoin.`F3`GetECPowerTable"; +pub enum F3GetECPowerTable {} +impl RpcMethod<1> for F3GetECPowerTable { + const NAME: &'static str = "Filecoin.F3GetECPowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ApiTipsetKey,); - type Ok = Vec<`F3`PowerEntry>; + type Ok = Vec; async fn handle( ctx: Ctx, @@ -724,21 +724,21 @@ impl RpcMethod<1> for `F3`GetECPowerTable { } } -pub enum `F3`Get`F3`PowerTable {} -impl RpcMethod<1> for `F3`Get`F3`PowerTable { - const NAME: &'static str = "Filecoin.`F3`Get`F3`PowerTable"; +pub enum F3GetF3PowerTable {} +impl RpcMethod<1> for F3GetF3PowerTable { + const NAME: &'static str = "Filecoin.F3GetF3PowerTable"; const PARAM_NAMES: [&'static str; 1] = ["tipset_key"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (ApiTipsetKey,); - type Ok = Vec<`F3`PowerEntry>; + type Ok = Vec; async fn handle( ctx: Ctx, (ApiTipsetKey(tsk_opt),): Self::Params, ) -> Result { - let tsk: `F3`TipSetKey = tsk_opt + let tsk: F3TipSetKey = tsk_opt .unwrap_or_else(|| ctx.chain_store().heaviest_tipset().key().clone()) .into(); let client = get_rpc_http_client()?; @@ -749,9 +749,9 @@ impl RpcMethod<1> for `F3`Get`F3`PowerTable { } } -pub enum `F3`Get`F3`PowerTableByInstance {} -impl RpcMethod<1> for `F3`Get`F3`PowerTableByInstance { - const NAME: &'static str = "Filecoin.`F3`Get`F3`PowerTableByInstance"; +pub enum F3GetF3PowerTableByInstance {} +impl RpcMethod<1> for F3GetF3PowerTableByInstance { + const NAME: &'static str = "Filecoin.F3GetF3PowerTableByInstance"; const PARAM_NAMES: [&'static str; 1] = ["instance"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -759,7 +759,7 @@ impl RpcMethod<1> for `F3`Get`F3`PowerTableByInstance { Some("Gets the power table (committee) used to validate the specified instance"); type Params = (u64,); - type Ok = Vec<`F3`PowerEntry>; + type Ok = Vec; async fn handle( _ctx: Ctx, @@ -773,9 +773,9 @@ impl RpcMethod<1> for `F3`Get`F3`PowerTableByInstance { } } -pub enum `F3`IsRunning {} +pub enum F3IsRunning {} -impl `F3`IsRunning { +impl F3IsRunning { pub async fn is_f3_running() -> anyhow::Result { let client = get_rpc_http_client()?; let response = client.request(Self::NAME, ArrayParams::new()).await?; @@ -783,8 +783,8 @@ impl `F3`IsRunning { } } -impl RpcMethod<0> for `F3`IsRunning { - const NAME: &'static str = "Filecoin.`F3`IsRunning"; +impl RpcMethod<0> for F3IsRunning { + const NAME: &'static str = "Filecoin.F3IsRunning"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; @@ -797,92 +797,92 @@ impl RpcMethod<0> for `F3`IsRunning { } } -/// See -pub enum `F3`GetProgress {} +/// See +pub enum F3GetProgress {} -impl `F3`GetProgress { - async fn run() -> anyhow::Result<`F3`InstanceProgress> { +impl F3GetProgress { + async fn run() -> anyhow::Result { let client = get_rpc_http_client()?; - let response: LotusJson<`F3`InstanceProgress> = + let response: LotusJson = client.request(Self::NAME, ArrayParams::new()).await?; Ok(response.into_inner()) } } -impl RpcMethod<0> for `F3`GetProgress { - const NAME: &'static str = "Filecoin.`F3`GetProgress"; +impl RpcMethod<0> for F3GetProgress { + const NAME: &'static str = "Filecoin.F3GetProgress"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = `F3`InstanceProgress; + type Ok = F3InstanceProgress; async fn handle(_: Ctx, (): Self::Params) -> Result { Ok(Self::run().await?) } } -/// See -pub enum `F3`GetManifest {} +/// See +pub enum F3GetManifest {} -impl `F3`GetManifest { - async fn run() -> anyhow::Result<`F3`Manifest> { +impl F3GetManifest { + async fn run() -> anyhow::Result { let client = get_rpc_http_client()?; - let response: LotusJson<`F3`Manifest> = + let response: LotusJson = client.request(Self::NAME, ArrayParams::new()).await?; Ok(response.into_inner()) } } -impl RpcMethod<0> for `F3`GetManifest { - const NAME: &'static str = "Filecoin.`F3`GetManifest"; +impl RpcMethod<0> for F3GetManifest { + const NAME: &'static str = "Filecoin.F3GetManifest"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = `F3`Manifest; + type Ok = F3Manifest; async fn handle(_: Ctx, (): Self::Params) -> Result { Ok(Self::run().await?) } } -/// returns the list of miner addresses that are currently participating in `F3` via this node. -pub enum `F3`ListParticipants {} -impl RpcMethod<0> for `F3`ListParticipants { - const NAME: &'static str = "Filecoin.`F3`ListParticipants"; +/// returns the list of miner addresses that are currently participating in F3 via this node. +pub enum F3ListParticipants {} +impl RpcMethod<0> for F3ListParticipants { + const NAME: &'static str = "Filecoin.F3ListParticipants"; const PARAM_NAMES: [&'static str; 0] = []; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Read; type Params = (); - type Ok = Vec<`F3`Participant>; + type Ok = Vec; async fn handle(_: Ctx, _: Self::Params) -> Result { Ok(Self::run().await?) } } -impl `F3`ListParticipants { - async fn run() -> anyhow::Result> { - let current_instance = `F3`GetProgress::run().await?.id; - Ok(`F3`_LEASE_MANAGER +impl F3ListParticipants { + async fn run() -> anyhow::Result> { + let current_instance = F3GetProgress::run().await?.id; + Ok(F3_LEASE_MANAGER .get() - .context("`F3` lease manager is not initialized")? + .context("F3 lease manager is not initialized")? .get_active_participants(current_instance) .values() - .map(`F3`Participant::from) + .map(F3Participant::from) .collect()) } } /// retrieves or renews a participation ticket necessary for a miner to engage in -/// the `F3` consensus process for the given number of instances. -pub enum `F3`GetOrRenewParticipationTicket {} -impl RpcMethod<3> for `F3`GetOrRenewParticipationTicket { - const NAME: &'static str = "Filecoin.`F3`GetOrRenewParticipationTicket"; +/// the F3 consensus process for the given number of instances. +pub enum F3GetOrRenewParticipationTicket {} +impl RpcMethod<3> for F3GetOrRenewParticipationTicket { + const NAME: &'static str = "Filecoin.F3GetOrRenewParticipationTicket"; const PARAM_NAMES: [&'static str; 3] = ["miner_address", "previous_lease_ticket", "instances"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; @@ -899,49 +899,49 @@ impl RpcMethod<3> for `F3`GetOrRenewParticipationTicket { None } else { Some( - fvm_ipld_encoding::from_slice::<`F3`ParticipationLease>(&previous_lease_ticket) + fvm_ipld_encoding::from_slice::(&previous_lease_ticket) .context("the previous lease ticket is invalid")?, ) }; - let lease = `F3`_LEASE_MANAGER + let lease = F3_LEASE_MANAGER .get() - .context("`F3` lease manager is not initialized")? + .context("F3 lease manager is not initialized")? .get_or_renew_participation_lease(id, previous_lease, instances) .await?; Ok(fvm_ipld_encoding::to_vec(&lease)?) } } -/// enrolls a storage provider in the `F3` consensus process using a +/// enrolls a storage provider in the F3 consensus process using a /// provided participation ticket. This ticket grants a temporary lease that enables -/// the provider to sign transactions as part of the `F3` consensus. -pub enum `F3`Participate {} -impl RpcMethod<1> for `F3`Participate { - const NAME: &'static str = "Filecoin.`F3`Participate"; +/// the provider to sign transactions as part of the F3 consensus. +pub enum F3Participate {} +impl RpcMethod<1> for F3Participate { + const NAME: &'static str = "Filecoin.F3Participate"; const PARAM_NAMES: [&'static str; 1] = ["lease_ticket"]; const API_PATHS: BitFlags = ApiPaths::all(); const PERMISSION: Permission = Permission::Sign; type Params = (Vec,); - type Ok = `F3`ParticipationLease; + type Ok = F3ParticipationLease; async fn handle( _: Ctx, (lease_ticket,): Self::Params, ) -> Result { - let lease: `F3`ParticipationLease = + let lease: F3ParticipationLease = fvm_ipld_encoding::from_slice(&lease_ticket).context("invalid lease ticket")?; - let current_instance = `F3`GetProgress::run().await?.id; - `F3`_LEASE_MANAGER + let current_instance = F3GetProgress::run().await?.id; + F3_LEASE_MANAGER .get() - .context("`F3` lease manager is not initialized")? + .context("F3 lease manager is not initialized")? .participate(&lease, current_instance)?; Ok(lease) } } pub fn get_f3_rpc_endpoint() -> Cow<'static, str> { - if let Ok(host) = std::env::var("FOREST_`F3`_SIDECAR_RPC_ENDPOINT") { + if let Ok(host) = std::env::var("FOREST_F3_SIDECAR_RPC_ENDPOINT") { Cow::Owned(host) } else { Cow::Borrowed("127.0.0.1:23456") diff --git a/src/rpc/methods/f3/types.rs b/src/rpc/methods/f3/types.rs index 6f001425c37c..d0ca18cd767c 100644 --- a/src/rpc/methods/f3/types.rs +++ b/src/rpc/methods/f3/types.rs @@ -30,30 +30,30 @@ const MAX_LEASE_INSTANCES: u64 = 5; /// TipSetKey is the canonically ordered concatenation of the block `CIDs` in a tipset. #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] -pub struct `F3`TipSetKey( +pub struct F3TipSetKey( #[schemars(with = "String")] #[serde(with = "base64_standard")] pub Vec, ); -lotus_json_with_self!(`F3`TipSetKey); +lotus_json_with_self!(F3TipSetKey); -impl From<&TipsetKey> for `F3`TipSetKey { +impl From<&TipsetKey> for F3TipSetKey { fn from(tsk: &TipsetKey) -> Self { let bytes = tsk.iter().flat_map(|cid| cid.to_bytes()).collect(); Self(bytes) } } -impl From for `F3`TipSetKey { +impl From for F3TipSetKey { fn from(tsk: TipsetKey) -> Self { (&tsk).into() } } -impl TryFrom<`F3`TipSetKey> for TipsetKey { +impl TryFrom for TipsetKey { type Error = anyhow::Error; - fn try_from(tsk: `F3`TipSetKey) -> Result { + fn try_from(tsk: F3TipSetKey) -> Result { static BLOCK_HEADER_CID_LEN: LazyLock = LazyLock::new(|| { let buf = [0_u8; 256]; let cid = Cid::new_v1( @@ -76,8 +76,8 @@ impl TryFrom<`F3`TipSetKey> for TipsetKey { } #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, JsonSchema)] -pub struct `F3`TipSet { - pub key: `F3`TipSetKey, +pub struct F3TipSet { + pub key: F3TipSetKey, /// The verifiable oracle randomness used to elect this block's author leader #[schemars(with = "String")] #[serde(with = "base64_standard")] @@ -88,9 +88,9 @@ pub struct `F3`TipSet { /// Block creation time, in seconds since the Unix epoch pub timestamp: u64, } -lotus_json_with_self!(`F3`TipSet); +lotus_json_with_self!(F3TipSet); -impl From for `F3`TipSet { +impl From for F3TipSet { fn from(ts: Tipset) -> Self { let key = ts.key().into(); let beacon = { @@ -112,7 +112,7 @@ impl From for `F3`TipSet { } } -impl From> for `F3`TipSet { +impl From> for F3TipSet { fn from(ts: Arc) -> Self { Arc::unwrap_or_clone(ts).into() } @@ -136,7 +136,7 @@ lotus_json_with_self!(ECTipSet); /// PowerEntry represents a single entry in the PowerTable, including ActorID and its StoragePower and PubKey. #[derive(Debug, Clone, Serialize_tuple, Deserialize_tuple, Eq, PartialEq)] -pub struct `F3`PowerEntry { +pub struct F3PowerEntry { pub id: ActorID, #[serde(with = "bigint_ser")] pub power: num::BigInt, @@ -146,7 +146,7 @@ pub struct `F3`PowerEntry { #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] -pub struct `F3`PowerEntryLotusJson { +pub struct F3PowerEntryLotusJson { #[serde(rename = "ID")] pub id: ActorID, #[schemars(with = "String")] @@ -157,8 +157,8 @@ pub struct `F3`PowerEntryLotusJson { pub pub_key: Vec, } -impl HasLotusJson for `F3`PowerEntry { - type LotusJson = `F3`PowerEntryLotusJson; +impl HasLotusJson for F3PowerEntry { + type LotusJson = F3PowerEntryLotusJson; #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { @@ -182,10 +182,10 @@ impl HasLotusJson for `F3`PowerEntry { fn into_lotus_json(self) -> Self::LotusJson { let Self { id, power, pub_key } = self; - `F3`PowerEntryLotusJson { id, power, pub_key } + F3PowerEntryLotusJson { id, power, pub_key } } - fn from_lotus_json(`F3`PowerEntryLotusJson { id, power, pub_key }: Self::LotusJson) -> Self { + fn from_lotus_json(F3PowerEntryLotusJson { id, power, pub_key }: Self::LotusJson) -> Self { Self { id, power, pub_key } } } @@ -193,7 +193,7 @@ impl HasLotusJson for `F3`PowerEntry { /// Entries are sorted descending order of their power, where entries with equal power are /// sorted by ascending order of their ID. /// This ordering is guaranteed to be stable, since a valid PowerTable cannot contain entries with duplicate IDs -impl Ord for `F3`PowerEntry { +impl Ord for F3PowerEntry { fn cmp(&self, other: &Self) -> Ordering { match other.power.cmp(&self.power) { Ordering::Equal => self.id.cmp(&other.id), @@ -202,7 +202,7 @@ impl Ord for `F3`PowerEntry { } } -impl PartialOrd for `F3`PowerEntry { +impl PartialOrd for F3PowerEntry { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } @@ -210,7 +210,7 @@ impl PartialOrd for `F3`PowerEntry { #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct `F3`InstanceProgress { +pub struct F3InstanceProgress { #[serde(rename = "ID")] pub id: u64, pub round: u64, @@ -223,9 +223,9 @@ pub struct `F3`InstanceProgress { )] pub input: Vec, } -lotus_json_with_self!(`F3`InstanceProgress); +lotus_json_with_self!(F3InstanceProgress); -impl `F3`InstanceProgress { +impl F3InstanceProgress { pub fn phase_string(&self) -> &'static str { match self.phase { 0 => "INITIAL", @@ -332,7 +332,7 @@ pub struct PartialMessageManagerConfig { #[serde_as] #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct `F3`Manifest { +pub struct F3Manifest { pub protocol_version: u64, pub initial_instance: u64, pub bootstrap_epoch: i64, @@ -352,9 +352,9 @@ pub struct `F3`Manifest { pub chain_exchange: ChainExchangeConfig, pub partial_message_manager: PartialMessageManagerConfig, } -lotus_json_with_self!(`F3`Manifest); +lotus_json_with_self!(F3Manifest); -impl `F3`Manifest { +impl F3Manifest { pub fn get_eth_return_from_message_receipt(receipt: &Receipt) -> anyhow::Result> { anyhow::ensure!( receipt.exit_code().is_success(), @@ -437,7 +437,7 @@ impl `F3`Manifest { let mut deflater = DeflateDecoder::new(compressed_manifest_bytes); let mut manifest_bytes = vec![]; deflater.read_to_end(&mut manifest_bytes)?; - let manifest: `F3`Manifest = serde_json::from_slice(&manifest_bytes)?; + let manifest: F3Manifest = serde_json::from_slice(&manifest_bytes)?; anyhow::ensure!( manifest.bootstrap_epoch >= 0 && manifest.bootstrap_epoch as u64 == activation_epoch, "bootstrap epoch does not match: {} != {activation_epoch}", @@ -447,7 +447,7 @@ impl `F3`Manifest { } } -impl TryFrom<&Receipt> for `F3`Manifest { +impl TryFrom<&Receipt> for F3Manifest { type Error = anyhow::Error; fn try_from(receipt: &Receipt) -> Result { @@ -456,7 +456,7 @@ impl TryFrom<&Receipt> for `F3`Manifest { } } -impl TryFrom for `F3`Manifest { +impl TryFrom for F3Manifest { type Error = anyhow::Error; fn try_from(receipt: Receipt) -> Result { @@ -545,17 +545,17 @@ impl FinalityCertificate { #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct `F3`Participant { +pub struct F3Participant { #[serde(rename = "MinerID")] pub miner_id: u64, pub from_instance: u64, pub validity_term: u64, } -lotus_json_with_self!(`F3`Participant); +lotus_json_with_self!(F3Participant); -impl From<`F3`ParticipationLease> for `F3`Participant { - fn from(value: `F3`ParticipationLease) -> Self { - let `F3`ParticipationLease { +impl From for F3Participant { + fn from(value: F3ParticipationLease) -> Self { + let F3ParticipationLease { miner_id, from_instance, validity_term, @@ -569,9 +569,9 @@ impl From<`F3`ParticipationLease> for `F3`Participant { } } -impl From<&`F3`ParticipationLease> for `F3`Participant { - fn from(value: &`F3`ParticipationLease) -> Self { - let &`F3`ParticipationLease { +impl From<&F3ParticipationLease> for F3Participant { + fn from(value: &F3ParticipationLease) -> Self { + let &F3ParticipationLease { miner_id, from_instance, validity_term, @@ -586,11 +586,11 @@ impl From<&`F3`ParticipationLease> for `F3`Participant { } /// defines the lease granted to a storage provider for -/// participating in `F3` consensus, detailing the session identifier, issuer, +/// participating in F3 consensus, detailing the session identifier, issuer, /// subject, and the expiration instance. #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] -pub struct Api`F3`ParticipationLease { +pub struct ApiF3ParticipationLease { /// the name of the network this lease belongs to. #[schemars(with = "String")] pub network: NetworkChain, @@ -609,7 +609,7 @@ pub struct Api`F3`ParticipationLease { #[serde_as] #[derive(PartialEq, Debug, Clone, Serialize_tuple, Deserialize_tuple)] #[serde(rename_all = "PascalCase")] -pub struct `F3`ParticipationLease { +pub struct F3ParticipationLease { #[serde_as(as = "DisplayFromStr")] pub network: NetworkChain, #[serde_as(as = "DisplayFromStr")] @@ -619,8 +619,8 @@ pub struct `F3`ParticipationLease { pub validity_term: u64, } -impl HasLotusJson for `F3`ParticipationLease { - type LotusJson = Api`F3`ParticipationLease; +impl HasLotusJson for F3ParticipationLease { + type LotusJson = ApiF3ParticipationLease; #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { @@ -662,7 +662,7 @@ impl HasLotusJson for `F3`ParticipationLease { } } -impl `F3`ParticipationLease { +impl F3ParticipationLease { pub fn validate( &self, network: &NetworkChain, @@ -690,13 +690,13 @@ impl `F3`ParticipationLease { } #[derive(Debug)] -pub struct `F3`LeaseManager { +pub struct F3LeaseManager { network: NetworkChain, peer_id: PeerId, - leases: RwLock>, + leases: RwLock>, } -impl `F3`LeaseManager { +impl F3LeaseManager { pub fn new(network: NetworkChain, peer_id: PeerId) -> Self { Self { network, @@ -708,7 +708,7 @@ impl `F3`LeaseManager { pub fn get_active_participants( &self, current_instance: u64, - ) -> HashMap { + ) -> HashMap { self.leases .read() .iter() @@ -725,16 +725,16 @@ impl `F3`LeaseManager { pub async fn get_or_renew_participation_lease( &self, id: u64, - previous_lease: Option<`F3`ParticipationLease>, + previous_lease: Option, instances: u64, - ) -> anyhow::Result<`F3`ParticipationLease> { + ) -> anyhow::Result { anyhow::ensure!(instances > 0, "instances should be positive"); anyhow::ensure!( instances <= MAX_LEASE_INSTANCES, "instances {instances} exceeds the maximum allowed value {MAX_LEASE_INSTANCES}" ); - let current_instance = super::`F3`GetProgress::run().await?.id; + let current_instance = super::F3GetProgress::run().await?.id; if let Some(previous_lease) = previous_lease { // A previous ticket is present. To avoid overlapping lease across multiple // instances for the same participant check its validity and only proceed to @@ -757,8 +757,8 @@ impl `F3`LeaseManager { participant: u64, from_instance: u64, instances: u64, - ) -> `F3`ParticipationLease { - `F3`ParticipationLease { + ) -> F3ParticipationLease { + F3ParticipationLease { issuer: self.peer_id, network: self.network.clone(), miner_id: participant, @@ -769,7 +769,7 @@ impl `F3`LeaseManager { pub fn participate( &self, - lease: &`F3`ParticipationLease, + lease: &F3ParticipationLease, current_instance: u64, ) -> anyhow::Result<()> { lease.validate(&self.network, &self.peer_id, current_instance)?; @@ -785,7 +785,7 @@ impl `F3`LeaseManager { "the from instance should never decrease" ); } else { - tracing::info!("started participating in `F3` for miner {}", lease.miner_id); + tracing::info!("started participating in F3 for miner {}", lease.miner_id); } self.leases.write().insert(lease.miner_id, lease.clone()); Ok(()) @@ -799,15 +799,15 @@ mod tests { #[test] fn decode_f3_participation_lease_ticket_from_lotus() { - // ticket is generated from a Lotus node by calling `Filecoin.`F3`GetOrRenewParticipationTicket` + // ticket is generated from a Lotus node by calling `Filecoin.F3GetOrRenewParticipationTicket` // params: ["t01000", "", 1] let ticket = "hW5jYWxpYnJhdGlvbm5ldHg0MTJEM0tvb1dKV0VxZzRLcXpxQUJMeU0yMUtBbWFKYzNqdFBzWEJrNmJNNllyN1BLSGczSxkD6AAB"; let ticket_bytes = BASE64_STANDARD.decode(ticket).unwrap(); - let lease: `F3`ParticipationLease = + let lease: F3ParticipationLease = fvm_ipld_encoding::from_slice(ticket_bytes.as_slice()).unwrap(); assert_eq!( lease, - `F3`ParticipationLease { + F3ParticipationLease { network: NetworkChain::Calibnet, issuer: PeerId::from_str("12D3KooWJWEqg4KqzqABLyM21KAmaJc3jtPsXBk6bM6Yr7PKHg3K") .unwrap(), @@ -820,7 +820,7 @@ mod tests { #[test] fn f3_participation_lease_ticket_serde_roundtrip() { - let lease = `F3`ParticipationLease { + let lease = F3ParticipationLease { network: NetworkChain::Calibnet, issuer: PeerId::from_str("12D3KooWJWEqg4KqzqABLyM21KAmaJc3jtPsXBk6bM6Yr7PKHg3K") .unwrap(), @@ -829,7 +829,7 @@ mod tests { validity_term: 1, }; let ticket = fvm_ipld_encoding::to_vec(&lease).unwrap(); - let decoded: `F3`ParticipationLease = fvm_ipld_encoding::from_slice(&ticket).unwrap(); + let decoded: F3ParticipationLease = fvm_ipld_encoding::from_slice(&ticket).unwrap(); assert_eq!(lease, decoded); } @@ -839,7 +839,7 @@ mod tests { let peer_id = PeerId::random(); let miner = 1000; - let lm = `F3`LeaseManager::new(network, peer_id); + let lm = F3LeaseManager::new(network, peer_id); let lease = lm.new_participation_lease(miner, 10, 2); assert!( @@ -941,7 +941,7 @@ mod tests { "MaxCachedValidatedMessagesPerInstance": 25000 } }); - let manifest: `F3`Manifest = serde_json::from_value(lotus_json.clone()).unwrap(); + let manifest: F3Manifest = serde_json::from_value(lotus_json.clone()).unwrap(); let serialized = serde_json::to_value(manifest.clone()).unwrap(); assert_eq!(lotus_json, serialized); } @@ -1015,13 +1015,13 @@ mod tests { #[test] fn test_f3_manifest_parse_contract_return() { - // The solidity contract: https://github.com/filecoin-project/f3-activation-contract/blob/063cd51a46f61b717375fe5675a6ddc73f4d8626/contracts/`F3`Parameters.sol + // The solidity contract: https://github.com/filecoin-project/f3-activation-contract/blob/063cd51a46f61b717375fe5675a6ddc73f4d8626/contracts/F3Parameters.sol let eth_return_hex = include_str!("contract_return.hex").trim(); let eth_return = hex::decode(eth_return_hex).unwrap(); - let manifest = `F3`Manifest::parse_contract_return(ð_return).unwrap(); + let manifest = F3Manifest::parse_contract_return(ð_return).unwrap(); assert_eq!( manifest, - serde_json::from_str::<`F3`Manifest>(include_str!("contract_manifest_golden.json")) + serde_json::from_str::(include_str!("contract_manifest_golden.json")) .unwrap(), ); } diff --git a/src/rpc/methods/f3/util.rs b/src/rpc/methods/f3/util.rs index 1e071e87a137..5c9571f047e8 100644 --- a/src/rpc/methods/f3/util.rs +++ b/src/rpc/methods/f3/util.rs @@ -4,27 +4,27 @@ use super::*; use std::sync::LazyLock; -const `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY: &str = - "FOREST_`F3`_PERMANENT_PARTICIPATING_MINER_ADDRESSES"; +const F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY: &str = + "FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES"; -pub static `F3`_PERMANENT_PARTICIPATING_MINER_IDS: LazyLock>> = +pub static F3_PERMANENT_PARTICIPATING_MINER_IDS: LazyLock>> = LazyLock::new(get_f3_permanent_participating_miner_ids); /// loads f3 permanent participating miner IDs. /// Note that this environment variable should only be used for testing purpose. fn get_f3_permanent_participating_miner_ids() -> Option> { - if let Ok(permanent_addrs) = std::env::var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY) { + if let Ok(permanent_addrs) = std::env::var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY) { let mut ids = HashSet::default(); for addr_str in permanent_addrs.split(",") { let Ok(addr) = Address::from_str(addr_str.trim()) else { tracing::warn!( - "Failed to parse miner address {addr_str} set in {`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY}" + "Failed to parse miner address {addr_str} set in {F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY}" ); continue; }; let Ok(id) = addr.id() else { tracing::warn!( - "miner address {addr_str} set in {`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY} is not an id address" + "miner address {addr_str} set in {F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY} is not an id address" ); continue; }; @@ -44,30 +44,30 @@ mod tests { fn test_get_f3_permanent_participating_miner_ids() { unsafe { // empty - std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, ""); + std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, ""); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 valid address - std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000"); + std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000"); assert_eq!( get_f3_permanent_participating_miner_ids(), Some(HashSet::from_iter([1000])), ); // 1 invalid address - std::env::set_var(`F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "tf1000"); + std::env::set_var(F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "tf1000"); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 bls address std::env::set_var( - `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, + F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t3sw466j35hqjbch5x7tcr7ona6idsgzypoturfci2ajqsfrrwhp7ty3ythtd7x646adaidnvxpdr5b2ftcciq", ); assert!(get_f3_permanent_participating_miner_ids().is_none()); // 1 valid address and 1 invalid address with extra whitespaces std::env::set_var( - `F3`_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, + F3_PERMANENT_PARTICIPATING_MINER_IDS_ENV_KEY, "t01000, t3sw466j35hqjbch5x7tcr7ona6idsgzypoturfci2ajqsfrrwhp7ty3ythtd7x646adaidnvxpdr5b2ftcciq, ", ); assert_eq!( diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs index 36df678a528e..18f74be28beb 100644 --- a/src/rpc/mod.rs +++ b/src/rpc/mod.rs @@ -275,18 +275,18 @@ macro_rules! for_each_rpc_method { // f3 $callback!($crate::rpc::f3::GetRawNetworkName); - $callback!($crate::rpc::f3::`F3`GetCertificate); - $callback!($crate::rpc::f3::`F3`GetECPowerTable); - $callback!($crate::rpc::f3::`F3`Get`F3`PowerTable); - $callback!($crate::rpc::f3::`F3`Get`F3`PowerTableByInstance); - $callback!($crate::rpc::f3::`F3`IsRunning); - $callback!($crate::rpc::f3::`F3`GetProgress); - $callback!($crate::rpc::f3::`F3`GetManifest); - $callback!($crate::rpc::f3::`F3`ListParticipants); - $callback!($crate::rpc::f3::`F3`GetLatestCertificate); - $callback!($crate::rpc::f3::`F3`GetOrRenewParticipationTicket); - $callback!($crate::rpc::f3::`F3`Participate); - $callback!($crate::rpc::f3::`F3`ExportLatestSnapshot); + $callback!($crate::rpc::f3::F3GetCertificate); + $callback!($crate::rpc::f3::F3GetECPowerTable); + $callback!($crate::rpc::f3::F3GetF3PowerTable); + $callback!($crate::rpc::f3::F3GetF3PowerTableByInstance); + $callback!($crate::rpc::f3::F3IsRunning); + $callback!($crate::rpc::f3::F3GetProgress); + $callback!($crate::rpc::f3::F3GetManifest); + $callback!($crate::rpc::f3::F3ListParticipants); + $callback!($crate::rpc::f3::F3GetLatestCertificate); + $callback!($crate::rpc::f3::F3GetOrRenewParticipationTicket); + $callback!($crate::rpc::f3::F3Participate); + $callback!($crate::rpc::f3::F3ExportLatestSnapshot); $callback!($crate::rpc::f3::GetHead); $callback!($crate::rpc::f3::GetParent); $callback!($crate::rpc::f3::GetParticipatingMinerIDs); @@ -352,14 +352,14 @@ pub fn collect_rpc_method_info() -> Vec<(&'static str, Permission)> { /// All the methods live in their own folder /// /// # Handling types -/// - If a `struct` or `enum` is only used in the RPC API, it should live in `src/rpc`. +/// - If a `struct` or enum is only used in the RPC API, it should live in `src/rpc`. /// - If it is used in only one API vertical (i.e `auth` or `chain`), then it should live /// in either: /// - `src/rpc/methods/auth.rs` (if there are only a few). /// - `src/rpc/methods/auth/types.rs` (if there are so many that they would cause clutter). /// - If it is used _across_ API verticals, it should live in `src/rpc/types.rs` /// -/// # Interactions with the [`lotus_json`] `APIs` +/// # Interactions with the [`lotus_json`] APIs /// - Types may have fields which must go through [`LotusJson`], /// and MUST reflect that in their [`JsonSchema`]. /// You have two options for this: @@ -516,7 +516,7 @@ where let keystore = state.keystore.clone(); let mut module = create_module(state.clone()); - // register eth subscription `APIs` + // register eth subscription APIs let eth_pubsub = EthPubSub::new(state.clone()); module.merge(eth_pubsub.into_rpc())?; diff --git a/src/rpc/reflect/mod.rs b/src/rpc/reflect/mod.rs index 47e1202c682a..540edb9d27b2 100644 --- a/src/rpc/reflect/mod.rs +++ b/src/rpc/reflect/mod.rs @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! Forest wishes to provide [OpenRPC](http://open-rpc.org) definitions for -//! Filecoin `APIs`. +//! Filecoin APIs. //! To do this, it needs: //! - [JSON Schema](https://json-schema.org/) definitions for all the argument //! and return types. //! - The number of arguments ([arity](https://en.wikipedia.org/wiki/Arity)) and //! names of those arguments for each RPC method. //! -//! As a secondary objective, we wish to provide an RPC client for our `CLI`, and +//! As a secondary objective, we wish to provide an RPC client for our CLI, and //! internal tests against Lotus. //! //! The [`RpcMethod`] trait encapsulates all the above at a single site. diff --git a/src/rpc/types/mod.rs b/src/rpc/types/mod.rs index f09bf0466ac4..e198abd27fa6 100644 --- a/src/rpc/types/mod.rs +++ b/src/rpc/types/mod.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -//! Types that are shared _between_ `APIs`. +//! Types that are shared _between_ APIs. //! //! If a type here is used by only one API, it should be relocated. diff --git a/src/shim/state_tree.rs b/src/shim/state_tree.rs index 8e9610e15f0a..da5910cde9f7 100644 --- a/src/shim/state_tree.rs +++ b/src/shim/state_tree.rs @@ -374,7 +374,7 @@ where .with_context(|| format!("failed to find actor: {addr}"))?; // A workaround to implement `if state.Version() >= types.StateTreeVersion5` - // When state tree version is not available in rust `APIs` + // When state tree version is not available in rust APIs if !matches!(self, Self::FvmV2(_) | Self::V0(_)) && let Some(address) = actor.delegated_address { diff --git a/src/tool/subcommands/api_cmd.rs b/src/tool/subcommands/api_cmd.rs index 01e9e19e4f4f..09331bc44980 100644 --- a/src/tool/subcommands/api_cmd.rs +++ b/src/tool/subcommands/api_cmd.rs @@ -219,7 +219,7 @@ pub enum ApiCommands { /// that rely on internal state. /// /// Inputs: - /// - `--to`, `--from`: delegated Filecoin (`f4`) addresses + /// - `--to`, `--from`: delegated Filecoin (f4) addresses /// - `--payload`: calldata in hex (accepts optional `0x` prefix) /// - `--topic`: `32‑byte` event topic in hex /// - `--filter`: run only tests that interact with a specific RPC method diff --git a/src/tool/subcommands/api_cmd/api_compare_tests.rs b/src/tool/subcommands/api_cmd/api_compare_tests.rs index e888802550cc..e958147c64d6 100644 --- a/src/tool/subcommands/api_cmd/api_compare_tests.rs +++ b/src/tool/subcommands/api_cmd/api_compare_tests.rs @@ -2001,17 +2001,17 @@ fn f3_tests() -> anyhow::Result> { vec![], 3, ))?), - RpcTest::identity(`F3`IsRunning::request(())?), - RpcTest::identity(`F3`GetCertificate::request((0,))?), - RpcTest::identity(`F3`GetCertificate::request((100,))?), - RpcTest::identity(`F3`GetManifest::request(())?), + RpcTest::identity(F3IsRunning::request(())?), + RpcTest::identity(F3GetCertificate::request((0,))?), + RpcTest::identity(F3GetCertificate::request((100,))?), + RpcTest::identity(F3GetManifest::request(())?), ]) } fn f3_tests_with_tipset(tipset: &Tipset) -> anyhow::Result> { Ok(vec![ - RpcTest::identity(`F3`GetECPowerTable::request((tipset.key().into(),))?), - RpcTest::identity(`F3`Get`F3`PowerTable::request((tipset.key().into(),))?), + RpcTest::identity(F3GetECPowerTable::request((tipset.key().into(),))?), + RpcTest::identity(F3GetF3PowerTable::request((tipset.key().into(),))?), ]) } diff --git a/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt b/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt index 6af8accf7607..3a679e3e0d03 100644 --- a/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt +++ b/src/tool/subcommands/api_cmd/test_snapshots_ignored.txt @@ -1,14 +1,14 @@ -`F3`.ExportLatestSnapshot -`F3`.Finalize -`F3`.GetHead -`F3`.GetParent -`F3`.GetParticipatingMinerIDs -`F3`.GetPowerTable -`F3`.GetRawNetworkName -`F3`.GetTipset -`F3`.GetTipsetByEpoch -`F3`.ProtectPeer -`F3`.SignMessage +F3.ExportLatestSnapshot +F3.Finalize +F3.GetHead +F3.GetParent +F3.GetParticipatingMinerIDs +F3.GetPowerTable +F3.GetRawNetworkName +F3.GetTipset +F3.GetTipsetByEpoch +F3.ProtectPeer +F3.SignMessage Filecoin.AuthNew Filecoin.AuthVerify Filecoin.ChainExport @@ -21,17 +21,17 @@ Filecoin.EthSendRawTransaction Filecoin.EthSubscribe Filecoin.EthSyncing Filecoin.EthUnsubscribe -Filecoin.`F3`GetCertificate -Filecoin.`F3`GetECPowerTable -Filecoin.`F3`Get`F3`PowerTable -Filecoin.`F3`Get`F3`PowerTableByInstance -Filecoin.`F3`GetLatestCertificate -Filecoin.`F3`GetManifest -Filecoin.`F3`GetOrRenewParticipationTicket -Filecoin.`F3`GetProgress -Filecoin.`F3`IsRunning -Filecoin.`F3`ListParticipants -Filecoin.`F3`Participate +Filecoin.F3GetCertificate +Filecoin.F3GetECPowerTable +Filecoin.F3GetF3PowerTable +Filecoin.F3GetF3PowerTableByInstance +Filecoin.F3GetLatestCertificate +Filecoin.F3GetManifest +Filecoin.F3GetOrRenewParticipationTicket +Filecoin.F3GetProgress +Filecoin.F3IsRunning +Filecoin.F3ListParticipants +Filecoin.F3Participate Filecoin.GasEstimateFeeCap Filecoin.GasEstimateGasPremium Filecoin.GasEstimateMessageGas diff --git a/src/tool/subcommands/archive_cmd.rs b/src/tool/subcommands/archive_cmd.rs index 2d6f94d00bd0..fb338c89c27e 100644 --- a/src/tool/subcommands/archive_cmd.rs +++ b/src/tool/subcommands/archive_cmd.rs @@ -35,7 +35,7 @@ use crate::cid_collections::CidHashSet; use crate::cli_shared::{snapshot, snapshot::TrustedVendor}; use crate::daemon::bundle::load_actor_bundles; use crate::db::car::{AnyCar, ManyCar, forest::DEFAULT_FOREST_CAR_COMPRESSION_LEVEL}; -use crate::f3::snapshot::`F3`SnapshotHeader; +use crate::f3::snapshot::F3SnapshotHeader; use crate::interpreter::VMTrace; use crate::ipld::{stream_chain, stream_graph}; use crate::networks::{ChainConfig, NetworkChain, butterflynet, calibnet, mainnet}; @@ -98,9 +98,9 @@ pub enum ArchiveCommands { /// Path to an archive (`.car` or `.car.zst`). snapshot: PathBuf, }, - /// Show FRC-0108 header of a standalone `F3` snapshot. - `F3`Header { - /// Path to a standalone `F3` snapshot. + /// Show FRC-0108 header of a standalone F3 snapshot. + F3Header { + /// Path to a standalone F3 snapshot. snapshot: PathBuf, }, /// Trim a snapshot of the chain and write it to `` @@ -150,12 +150,12 @@ pub enum ArchiveCommands { #[arg(long, default_value_t = false)] force: bool, }, - /// Merge a v1 Filecoin snapshot with an `F3` snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format - Merge`F3` { + /// Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format + MergeF3 { /// Path to the v1 Filecoin snapshot #[arg(long = "v1")] filecoin_v1: PathBuf, - /// Path to the `F3` snapshot + /// Path to the F3 snapshot #[arg(long)] f3: PathBuf, /// Path to the snapshot output file in `.forest.car.zst` format @@ -226,7 +226,7 @@ impl ArchiveCommands { let mut f3_data = store .get_reader(f3_cid)? .with_context(|| format!("f3 data not found, cid: {f3_cid}"))?; - let f3_snap_header = `F3`SnapshotHeader::decode_from_snapshot(&mut f3_data)?; + let f3_snap_header = F3SnapshotHeader::decode_from_snapshot(&mut f3_data)?; println!("{f3_snap_header}"); } } else { @@ -236,14 +236,14 @@ impl ArchiveCommands { } Ok(()) } - Self::`F3`Header { snapshot } => { + Self::F3Header { snapshot } => { let mut r = BufReader::new(File::open(&snapshot).with_context(|| { - format!("failed to open `F3` snapshot '{}'", snapshot.display()) + format!("failed to open F3 snapshot '{}'", snapshot.display()) })?); let f3_snap_header = - `F3`SnapshotHeader::decode_from_snapshot(&mut r).with_context(|| { + F3SnapshotHeader::decode_from_snapshot(&mut r).with_context(|| { format!( - "failed to decode `F3` snapshot header from '{}'", + "failed to decode F3 snapshot header from '{}'", snapshot.display() ) })?; @@ -281,7 +281,7 @@ impl ArchiveCommands { output_path, force, } => merge_snapshots(snapshot_files, output_path, force).await, - Self::Merge`F3` { + Self::MergeF3 { filecoin_v1, f3, output, @@ -918,7 +918,7 @@ async fn bucket_has_diff_snapshot( const FOREST_ARCHIVE_S3_ENDPOINT: &str = "https://2238a825c5aca59233eab1f221f7aefb.r2.cloudflarestorage.com"; -/// Check if the AWS `CLI` is installed and correctly configured. +/// Check if the AWS CLI is installed and correctly configured. fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { let status = std::process::Command::new("aws") .arg("help") @@ -928,7 +928,7 @@ fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { if !status.success() { bail!( - "'aws help' failed with status code: {}. Please ensure that the AWS `CLI` is installed and configured.", + "'aws help' failed with status code: {}. Please ensure that the AWS CLI is installed and configured.", status ); } @@ -948,7 +948,7 @@ fn check_aws_config(endpoint: &str) -> anyhow::Result<()> { Ok(()) } -/// Use the AWS `CLI` to upload a snapshot file to the `S3` bucket. +/// Use the AWS CLI to upload a snapshot file to the `S3` bucket. fn upload_to_forest_bucket(path: PathBuf, network: &str, tag: &str) -> anyhow::Result<()> { let status = std::process::Command::new("aws") .args([ diff --git a/src/utils/db/mod.rs b/src/utils/db/mod.rs index 7ed036d8a742..4fa80757f0f5 100644 --- a/src/utils/db/mod.rs +++ b/src/utils/db/mod.rs @@ -53,7 +53,7 @@ pub trait BlockstoreExt: Blockstore { impl BlockstoreExt for T {} -/// Extension methods for [`CborStore`] that omits default multihash code from its `APIs` +/// Extension methods for [`CborStore`] that omits default multihash code from its APIs pub trait CborStoreExt: CborStore { /// Default multihash code is [`cid::multihash::Code::Blake2b256`] /// See diff --git a/src/utils/encoding/fallback_de_ipld_dagcbor.rs b/src/utils/encoding/fallback_de_ipld_dagcbor.rs index f32116ee923a..de35641ecfb2 100644 --- a/src/utils/encoding/fallback_de_ipld_dagcbor.rs +++ b/src/utils/encoding/fallback_de_ipld_dagcbor.rs @@ -32,7 +32,7 @@ mod cbor4ii_nonpub { pub const NULL: u8 = 0xf6; // simple(22) pub const UNDEFINED: u8 = 0xf7; // simple(23) pub const F16: u8 = 0xf9; - pub const `F3`2: u8 = 0xfa; + pub const F32: u8 = 0xfa; pub const F64: u8 = 0xfb; pub const BREAK: u8 = 0xff; } @@ -234,7 +234,7 @@ impl<'de, R: dec::Read<'de>> serde::Deserializer<'de> for &mut Deserializer { de.reader.advance(1); visitor.visit_none() } - marker::`F3`2 => de.deserialize_f32(visitor), + marker::F32 => de.deserialize_f32(visitor), marker::F64 => de.deserialize_f64(visitor), _ => Err(DecodeError::Unsupported { byte }), }, diff --git a/src/utils/net.rs b/src/utils/net.rs index b29de02c20f4..8016cc05f327 100644 --- a/src/utils/net.rs +++ b/src/utils/net.rs @@ -21,8 +21,8 @@ use tracing::info; use url::Url; pub fn global_http_client() -> reqwest::Client { - static `CLI`ENT: LazyLock = LazyLock::new(reqwest::Client::new); - `CLI`ENT.clone() + static CLIENT: LazyLock = LazyLock::new(reqwest::Client::new); + CLIENT.clone() } /// Download a file via IPFS HTTP gateway in trustless mode. From 1b6f8151e3ec4abfd0223281f0a03876bed46f8a Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 19 Sep 2025 09:46:51 +0100 Subject: [PATCH 18/34] chore: fixing spellcheck --- .config/forest.dic | 5 +++-- docs/docs/users/guides/running_with_gateway.md | 4 ++-- src/chain/mod.rs | 4 ++-- src/cli/subcommands/snapshot_cmd.rs | 2 +- src/cli/subcommands/state_cmd.rs | 2 +- src/db/car/mod.rs | 2 +- src/rpc/client.rs | 2 +- src/rpc/error.rs | 2 +- src/tool/subcommands/archive_cmd.rs | 4 ++-- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index 3387270c42d6..da79b55029e7 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,6 +1,6 @@ 136 Algorand/M -API/SM +APIs args arity async @@ -23,6 +23,7 @@ CARv2/SM CBOR ChainSafe/M CID/SM +CLI clonable Cloudflare codebase @@ -40,7 +41,7 @@ DevOps DNS EIP EIP155 -enum +enum/S EOF eth Ethereum diff --git a/docs/docs/users/guides/running_with_gateway.md b/docs/docs/users/guides/running_with_gateway.md index 8200fe05fd3e..50b2c23181b7 100644 --- a/docs/docs/users/guides/running_with_gateway.md +++ b/docs/docs/users/guides/running_with_gateway.md @@ -28,7 +28,7 @@ For more information on configuring Lotus Gateway, refer to [Lotus Gateway docum There is not much configuration needed to run Lotus Gateway with Forest. -1. You must export the `FULLNODE_API_INFO` environment variable with the Forest node admin JWT token and its multiaddress. You can find the Forest JWT token in its initialization logs and under the chosen file if you have set the `--save-token ` flag. The multiaddress is the same as the one you would use to connect to the Forest node. +1. You must export the `FULLNODE_API_INFO` environment variable with the Forest node admin JWT token and its multi-address. You can find the Forest JWT token in its initialization logs and under the chosen file if you have set the `--save-token ` flag. The multi-address is the same as the one you would use to connect to the Forest node. 2. Choose a port for the Lotus Gateway to listen on. The default is `2346`, but you can choose any port not already in use. If necessary, open the port in your firewall. 3. Ensure the Forest node is running and accessible from the Lotus Gateway. @@ -43,7 +43,7 @@ That's it! Forest should now be available only through the Lotus Gateway. You ca curl http://localhost:5432/rpc/v1 -X POST -H "Content-Type: application/json" --data '{"method":"Filecoin.ChainHead","params":[], "id":1,"jsonrpc":"2.0"}' ``` -## 🌲Forest + 🪷 Lotus Gateway + 🐳 Docker Compose = ❤️ +## 🌲 Forest + 🪷 Lotus Gateway + 🐳 Docker Compose = ❤️ If you want to run Forest and Lotus Gateway in a Docker container, you can use Docker Compose. Ensure you have [docker](https://www.docker.com/) installed. This will: diff --git a/src/chain/mod.rs b/src/chain/mod.rs index ebea43686ffe..1165a220eeab 100644 --- a/src/chain/mod.rs +++ b/src/chain/mod.rs @@ -50,7 +50,7 @@ pub async fn export_from_head( Ok((head_ts, digest)) } -/// Exports a Filecoin snapshot in v1 format +/// Exports a Filecoin snapshot in `v1` format /// See pub async fn export( db: &Arc, @@ -63,7 +63,7 @@ pub async fn export( export_to_forest_car::(roots, None, db, tipset, lookup_depth, writer, options).await } -/// Exports a Filecoin snapshot in v2 format +/// Exports a Filecoin snapshot in `v2` format /// See pub async fn export_v2( db: &Arc, diff --git a/src/cli/subcommands/snapshot_cmd.rs b/src/cli/subcommands/snapshot_cmd.rs index cbcda5b20835..99ed85761d51 100644 --- a/src/cli/subcommands/snapshot_cmd.rs +++ b/src/cli/subcommands/snapshot_cmd.rs @@ -37,7 +37,7 @@ pub enum SnapshotCommands { /// How many state-roots to include. Lower limit is 900 for `calibnet` and `mainnet`. #[arg(short, long)] depth: Option, - /// Export snapshot in the experimental v2 format(FRC-0108). + /// Export snapshot in the experimental `v2` format(FRC-0108). #[arg(long, value_enum, default_value_t = FilecoinSnapshotVersion::V1)] format: FilecoinSnapshotVersion, }, diff --git a/src/cli/subcommands/state_cmd.rs b/src/cli/subcommands/state_cmd.rs index 273cffc4e489..a6a4adcde5b8 100644 --- a/src/cli/subcommands/state_cmd.rs +++ b/src/cli/subcommands/state_cmd.rs @@ -43,7 +43,7 @@ pub enum StateCommands { /// Actor address to read the state of actor_address: StrictAddress, }, - /// Returns the built-in actor bundle CIDs for the current network + /// Returns the built-in actor bundle `CIDs` for the current network ActorCids { /// Format output #[arg(long, default_value = "text")] diff --git a/src/db/car/mod.rs b/src/db/car/mod.rs index efb97fc576ee..e39c1d4ba5cd 100644 --- a/src/db/car/mod.rs +++ b/src/db/car/mod.rs @@ -32,7 +32,7 @@ pub type CacheKey = u64; type FrameOffset = u64; -/// According to FRC-0108, v2 snapshots have exactly one root pointing to metadata +/// According to FRC-0108, `v2` snapshots have exactly one root pointing to metadata const V2_SNAPSHOT_ROOT_COUNT: usize = 1; pub static ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE: LazyLock = LazyLock::new(|| { diff --git a/src/rpc/client.rs b/src/rpc/client.rs index 4c4a877eb661..1ea2c10bfb56 100644 --- a/src/rpc/client.rs +++ b/src/rpc/client.rs @@ -5,7 +5,7 @@ //! - use [`jsonrpsee`] clients and primitives. //! - Support [`rpc::Request`](crate::rpc::Request). //! - Support different -//! - endpoint paths (`v0`, v1). +//! - endpoint paths (`v0`, `v1`). //! - communication protocols (`ws`, `http`). //! - Support per-request timeouts. diff --git a/src/rpc/error.rs b/src/rpc/error.rs index c3c62cbcedfe..6636f4afe28d 100644 --- a/src/rpc/error.rs +++ b/src/rpc/error.rs @@ -60,7 +60,7 @@ impl ServerError { pub fn known_code(&self) -> ErrorCode { self.inner.code().into() } - /// We are only including this method to get the JSON Schemas for our OpenRPC + /// We are only including this method to get the JSON `Schemas` for our OpenRPC /// machinery pub fn stubbed_for_openrpc() -> Self { Self::new( diff --git a/src/tool/subcommands/archive_cmd.rs b/src/tool/subcommands/archive_cmd.rs index fb338c89c27e..e5e053f9538c 100644 --- a/src/tool/subcommands/archive_cmd.rs +++ b/src/tool/subcommands/archive_cmd.rs @@ -150,9 +150,9 @@ pub enum ArchiveCommands { #[arg(long, default_value_t = false)] force: bool, }, - /// Merge a v1 Filecoin snapshot with an F3 snapshot into a v2 Filecoin snapshot in `.forest.car.zst` format + /// Merge a `v1` Filecoin snapshot with an F3 snapshot into a `v2` Filecoin snapshot in `.forest.car.zst` format MergeF3 { - /// Path to the v1 Filecoin snapshot + /// Path to the `v1` Filecoin snapshot #[arg(long = "v1")] filecoin_v1: PathBuf, /// Path to the F3 snapshot From a88f3c9192f553703e1978a0aca214e9aaee4ed9 Mon Sep 17 00:00:00 2001 From: signor1 Date: Mon, 6 Oct 2025 11:00:21 +0100 Subject: [PATCH 19/34] fix: resolve spellcheck issues across documentation and config files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Clean up .config/forest.dic: remove 6 duplicate entries (Github/GitHub, ParityDb/ParityDB, RocksDb/RocksDB, F3, JWT, P2P, Implementers, Preloaded), update count to 230 - Add emoji regex pattern to .config/spellcheck.toml to handle emoji sequences - Exclude .github directory from markdown spellcheck in Makefile - Fix inconsistent spellings: Github → GitHub, Devops → DevOps - Standardize contractions: It's → It is for formal documentation - Fix CHANGELOG.md formatting: add backticks around version numbers (v1, v2, v6, etc.) - Update docs/docs/users/guides/gc.md: replace ~ with 'approximately' for clarity - Fix import quote style in docs/docs/users/getting_started/install.md --- .config/forest.dic | 109 ++++++++++++++++-- .config/spellcheck.toml | 16 ++- CHANGELOG.md | 62 +++++----- Makefile | 2 +- docs/dictionary.txt | 6 +- docs/docs/users/getting_started/install.md | 4 +- docs/docs/users/guides/gc.md | 2 +- .../users/guides/interacting_with_wallets.md | 2 +- docs/docs/users/knowledge_base/docker_tips.md | 2 +- .../docs/users/reference/json_rpc_overview.md | 2 +- 10 files changed, 157 insertions(+), 50 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index da79b55029e7..ae96bf682132 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,35 +1,48 @@ -136 +230 +2k Algorand/M APIs args arity async attoFIL +autogenerated +automagically +backend +backfilling benchmark/GD +benchmarking bitfield bitswap BLAKE2b blockchain/M blockstore/SM BLS +bootstrapper/SM butterflynet +calibnet calldata callee -calibnet canonicalization CAR/SM CARv1/SM CARv2/SM CBOR +chain_follower +ChainNotify ChainSafe/M +changelog CID/SM CLI clonable Cloudflare codebase codec +Composable +config cron crypto +Curio CurrentEpoch daemon daemonize @@ -38,101 +51,183 @@ deserialize/D destructuring devnet DevOps +Devs +DHT +Diataxis +Diátaxis +DigitalOcean DNS +Dockerfile/SM +Docusaurus +draggable +Drand +Drilldown/SM +Drilldowns +eg EIP EIP155 +entrypoint/SM enum/S EOF eth Ethereum EVM exa -F3 +f3 f4 FFI FIL +Filecoin's Filecoin/M +FilecoinEC Filops +FilOz +FilOz's FIP +FIPs +followable +fortnightly FVM GC GiB +GitHub +Glif +Grafana +GraphQL HAMT +hardcoded hasher healthcheck +hide_title +hotfix +HttpJsonRpc +implementer/SM implementor/SM +infeasible +interop/SM +io IP IPFS IPLD JSON -JWT +jwt +JWTs Kademlia +keypair/SM +keystore/SM Kubernetes libp2p liveness localhost localhost's +LRU +M1 +M2 +macOS mainnet MDNS +MDX mempool Merkle +MessageSeqNo MiB middleware milliGas multiaddr/SM multihash +multiline multisig mutex +namespace/SM +NetworkEvent/SM +NV22 +NV23 +NV24 +NVMe +NVXX +onwards OpenRPC overallocation -P2P +p2p param/SM -ParityDb ParityDB parsable +peerstore/SM performant PoC pointer/SM PoSt pre-commit +preloaded +ProveCommitSector +pubsub +Q4 R2 +README +reimplemented +repo/SM RLP +RocksDB RPC schema/SM SECP SECP256k1 +SecP256k1 seekable serializable serializer/SM +sharded +sidebar_position skippable statediff stateful +stateroot/SM stderr stdout struct/SM +subcommand/SM +swappiness synchronizer +SyncStateMachine syscall/S +TabItem/SM +Tabs TCP +Teardown testnet +theme/SM tipset/SM +TipSetBundle tipsetkey/S TOML +toolchain/SM trie truthy TTY +UI/SM uncompress unrepresentable untrusted URL UUID +V0 +V1 validator/S varint +vendored verifier verifreg VM/SM +VPS VRF wasm +Wasm wasmtime +webapp WebSocket +WIP +WPoStDisputeWindow WPoStProvingPeriodDeadlines -zstd \ No newline at end of file +WSL2 +YugabyteDB +zstd diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index b7de9b332d93..1a0e7c336540 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -6,13 +6,27 @@ lang = "en_US" search_dirs = ["."] skip_os_lookups = true use_builtin = true -tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=" +tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=~" extra_dictionaries = ["forest.dic", "en_US.dic"] [hunspell.quirks] transform_regex = [ # 10.7% "^[0-9_]+(?:\\.[0-9]*)?%$", + # Template variables like {{ env.WORKFLOW_URL }} + "\\{\\{[^}]+\\}\\}", + # YAML frontmatter keys like sidebar_position + "^[a-z_]+:.*$", + # Numbers with underscores like 30_000 + "^[0-9_]+$", + # Plus signs and other operators + "^[+\\-*/=]+$", + # Tilde symbol + "^~+$", + # Import statements like @theme/Tabs + "@theme/.*", + # Emoji sequences (literal emojis) + "^[🌲🪷🐳❤️🐋]+$", ] allow_concatenation = false allow_dashes = false diff --git a/CHANGELOG.md b/CHANGELOG.md index c2145f07880b..b4dfbe06a51c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,11 +101,11 @@ Non-mandatory release. It introduces a couple of features around snapshot genera ### Added -- [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `--format` flag to the `forest-cli snapshot export` subcommand. This allows exporting a Filecoin snapshot in v2 format(FRC-0108). +- [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `--format` flag to the `forest-cli snapshot export` subcommand. This allows exporting a Filecoin snapshot in `v2` format(FRC-0108). - [#5956](https://github.com/ChainSafe/forest/pull/5956) Add `forest-tool archive f3-header` subcommand for inspecting the header of a standalone F3 snapshot(FRC-0108). -- [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `forest-tool archive metadata` subcommand for inspecting snapshot metadata of a Filecoin snapshot in v2 format(FRC-0108). +- [#5835](https://github.com/ChainSafe/forest/issues/5835) Add `forest-tool archive metadata` subcommand for inspecting snapshot metadata of a Filecoin snapshot in `v2` format(FRC-0108). - [#5859](https://github.com/ChainSafe/forest/pull/5859) Added size metrics for zstd frame cache and made max size configurable via `FOREST_ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE` environment variable. @@ -117,7 +117,7 @@ Non-mandatory release. It introduces a couple of features around snapshot genera - [#5946](https://github.com/ChainSafe/forest/pull/5946) Added `--verbose` to `forest-cli state compute` for printing epochs and tipset keys along with state roots. -- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a v1 Filecoin snapshot and an F3 snapshot into a v2 Filecoin snapshot. +- [#5886](https://github.com/ChainSafe/forest/issues/5886) Add `forest-tool archive merge-f3` subcommand for merging a `v1` Filecoin snapshot and an F3 snapshot into a `v2` Filecoin snapshot. - [#4976](https://github.com/ChainSafe/forest/issues/4976) Add support for the `Filecoin.EthSubscribe` and `Filecoin.EthUnsubscribe` API methods to enable subscriptions to Ethereum event types: `heads` and `logs`. @@ -831,7 +831,7 @@ most notably, garbage collection fix. ### Added - [#4473](https://github.com/ChainSafe/forest/pull/4473) Add support for NV23 - _Waffle_ network upgrade (FIP-0085, FIP-0091, v14 actors). + _Waffle_ network upgrade (FIP-0085, FIP-0091, `v14` actors). - [#4352](https://github.com/ChainSafe/forest/pull/4352) Add support for the `Filecoin.StateGetClaim` RPC method. @@ -2144,54 +2144,54 @@ All changes: - Fix snapshot get in docs ([#1353](https://github.com/ChainSafe/forest/pull/1353)) - Fix market logic ([#1356](https://github.com/ChainSafe/forest/pull/1356)) -- V6: fix market and power actors to match go +- `V6`: fix market and power actors to match go ([#1348](https://github.com/ChainSafe/forest/pull/1348)) -- F28 fix ([#1343](https://github.com/ChainSafe/forest/pull/1343)) -- Fix: F25 ([#1342](https://github.com/ChainSafe/forest/pull/1342)) +- `F28` fix ([#1343](https://github.com/ChainSafe/forest/pull/1343)) +- Fix: `F25` ([#1342](https://github.com/ChainSafe/forest/pull/1342)) - Ci: --ignore RUSTSEC-2021-0130 ([#1350](https://github.com/ChainSafe/forest/pull/1350)) -- Drand v14 update: fix fetching around null tipsets +- Drand `v14` update: fix fetching around null tipsets ([#1339](https://github.com/ChainSafe/forest/pull/1339)) -- Fix v6 market actor bug +- Fix `v6` market actor bug ([#1341](https://github.com/ChainSafe/forest/pull/1341)) -- F27 fix ([#1328](https://github.com/ChainSafe/forest/pull/1328)) -- F17 fix ([#1324](https://github.com/ChainSafe/forest/pull/1324)) +- `F27` fix ([#1328](https://github.com/ChainSafe/forest/pull/1328)) +- `F17` fix ([#1324](https://github.com/ChainSafe/forest/pull/1324)) - Laudiacay/actors review f23 ([#1325](https://github.com/ChainSafe/forest/pull/1325)) - Fix market actor publish_storage_deals ([#1327](https://github.com/ChainSafe/forest/pull/1327)) - Remove .swp ([#1326](https://github.com/ChainSafe/forest/pull/1326)) -- F24 fix ([#1323](https://github.com/ChainSafe/forest/pull/1323)) -- F9 fix ([#1315](https://github.com/ChainSafe/forest/pull/1315)) -- F20: Fix expiration set validation order +- `F24` fix ([#1323](https://github.com/ChainSafe/forest/pull/1323)) +- `F9` fix ([#1315](https://github.com/ChainSafe/forest/pull/1315)) +- `F20`: Fix expiration set validation order ([#1322](https://github.com/ChainSafe/forest/pull/1322)) -- F13 fix ([#1313](https://github.com/ChainSafe/forest/pull/1313)) -- F21 fix ([#1311](https://github.com/ChainSafe/forest/pull/1311)) -- F11 fix ([#1312](https://github.com/ChainSafe/forest/pull/1312)) -- F15 fix ([#1314](https://github.com/ChainSafe/forest/pull/1314)) -- F18, F19 fix ([#1321](https://github.com/ChainSafe/forest/pull/1321)) -- Nv14: implement v6 actors +- `F13` fix ([#1313](https://github.com/ChainSafe/forest/pull/1313)) +- `F21` fix ([#1311](https://github.com/ChainSafe/forest/pull/1311)) +- `F11` fix ([#1312](https://github.com/ChainSafe/forest/pull/1312)) +- `F15` fix ([#1314](https://github.com/ChainSafe/forest/pull/1314)) +- `F18`, `F19` fix ([#1321](https://github.com/ChainSafe/forest/pull/1321)) +- Nv14: implement `v6` actors ([#1260](https://github.com/ChainSafe/forest/pull/1260)) - Add to troubleshooting docs ([#1282](https://github.com/ChainSafe/forest/pull/1282)) -- F12 fix ([#1290](https://github.com/ChainSafe/forest/pull/1290)) -- F1 fix ([#1293](https://github.com/ChainSafe/forest/pull/1293)) -- F16: Fix improper use of assert macro +- `F12` fix ([#1290](https://github.com/ChainSafe/forest/pull/1290)) +- `F1` fix ([#1293](https://github.com/ChainSafe/forest/pull/1293)) +- `F16`: Fix improper use of assert macro ([#1310](https://github.com/ChainSafe/forest/pull/1310)) -- F14: Fix missing continue statement +- `F14`: Fix missing continue statement ([#1309](https://github.com/ChainSafe/forest/pull/1309)) -- F10 fix ([#1308](https://github.com/ChainSafe/forest/pull/1308)) -- F7: Fix incorrect error codes +- `F10` fix ([#1308](https://github.com/ChainSafe/forest/pull/1308)) +- `F7`: Fix incorrect error codes ([#1297](https://github.com/ChainSafe/forest/pull/1297)) -- F8: Add missing decrement for miner_count +- `F8`: Add missing decrement for miner_count ([#1298](https://github.com/ChainSafe/forest/pull/1298)) -- F6: Fix incorrect error code +- `F6`: Fix incorrect error code ([#1296](https://github.com/ChainSafe/forest/pull/1296)) -- F5: Fix proposal check in market actor +- `F5`: Fix proposal check in market actor ([#1295](https://github.com/ChainSafe/forest/pull/1295)) - Remove redundant validation code and update error message to be same as in spec actors ([#1294](https://github.com/ChainSafe/forest/pull/1294)) -- F3: fix logic to be the same as in the spec actors +- `F3`: fix logic to be the same as in the spec actors ([#1292](https://github.com/ChainSafe/forest/pull/1292)) - Attempt to improve gh actions time ([#1319](https://github.com/ChainSafe/forest/pull/1319)) @@ -2199,7 +2199,7 @@ All changes: ([#1316](https://github.com/ChainSafe/forest/pull/1316)) - Ci: add gh actions workflows ([#1317](https://github.com/ChainSafe/forest/pull/1317)) -- Fix: audit issue F2 ([#1289](https://github.com/ChainSafe/forest/pull/1289)) +- Fix: audit issue `F2` ([#1289](https://github.com/ChainSafe/forest/pull/1289)) - Update codeowners ([#1306](https://github.com/ChainSafe/forest/pull/1306)) - Add Guillaume to code owners ([#1283](https://github.com/ChainSafe/forest/pull/1283)) diff --git a/Makefile b/Makefile index ea9eff31584c..3c52ce47b60c 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ deny: spellcheck: cargo spellcheck --code 1 || (echo "See .config/spellcheck.md for tips"; false) - find . \( -path "./documentation" -o -path "./node_modules" -o -path "./.git" -o -path "./target" \) -prune -o -name "*.md" -type f -print0 | xargs -0 -r cargo spellcheck --code 1 --cfg .config/spellcheck.toml || (echo "See .config/spellcheck.md for tips"; false) + find . \( -path "./documentation" -o -path "./node_modules" -o -path "./.git" -o -path "./target" -o -path "./.github" \) -prune -o -name "*.md" -type f -print0 | xargs -0 -r cargo spellcheck --code 1 --cfg .config/spellcheck.toml || (echo "See .config/spellcheck.md for tips"; false) lint: license clean lint-clippy cargo fmt --all --check diff --git a/docs/dictionary.txt b/docs/dictionary.txt index f8d0e617260b..ea49e502f75c 100644 --- a/docs/dictionary.txt +++ b/docs/dictionary.txt @@ -22,7 +22,7 @@ config Datacap datacap devnet -Devops +DevOps Devs DHT DigitalOcean @@ -44,7 +44,7 @@ FIPs FVM GC GiB -Github +GitHub Grafana hardcoded hotfix @@ -113,8 +113,6 @@ testnet Tipset tipset tipsets -V0 -V1 VPS WIP zstd diff --git a/docs/docs/users/getting_started/install.md b/docs/docs/users/getting_started/install.md index 09ac1184fae3..e25f2d17606c 100644 --- a/docs/docs/users/getting_started/install.md +++ b/docs/docs/users/getting_started/install.md @@ -3,8 +3,8 @@ title: Installing sidebar_position: 2 --- -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; diff --git a/docs/docs/users/guides/gc.md b/docs/docs/users/guides/gc.md index 7000b975d9bc..a8baf920acdf 100644 --- a/docs/docs/users/guides/gc.md +++ b/docs/docs/users/guides/gc.md @@ -58,7 +58,7 @@ During the GC process, Forest consumes extra RAM and disk space temporarily: - While traversing reachable blocks, it uses 32 bytes of RAM per reachable block. - While exporting a lite snapshot, it uses extra disk space before cleaning up parity-db and stale CAR snapshots. -For a typical ~80 GiB mainnet snapshot, this results in ~2.5 GiB of additional RAM and ~80 GiB disk space usage. +For a typical 80 GiB mainnet snapshot, this results in approximately 2.5 GiB of additional RAM and 80 GiB disk space usage. ### Syncing Pauses or Performance Overheads diff --git a/docs/docs/users/guides/interacting_with_wallets.md b/docs/docs/users/guides/interacting_with_wallets.md index 2970a84bdf8c..3503ef4c4c53 100644 --- a/docs/docs/users/guides/interacting_with_wallets.md +++ b/docs/docs/users/guides/interacting_with_wallets.md @@ -9,7 +9,7 @@ The Forest client provides two types of wallets: 1. **Local wallet (only accessible by you)**: This wallet is recommended for day-to-day use due to its higher security. Since it is only accessible by you, it minimizes exposure and reduces the likelihood of compromise. -2. **Node wallet (accessible by the Forest node)**: This wallet is managed by the Forest node and is included for backward compatibility with Lotus. It’s less secure as the node may have direct access to it for network operations. This could potentially expose it to unauthorized access or other network-related vulnerabilities. +2. **Node wallet (accessible by the Forest node)**: This wallet is managed by the Forest node and is included for backward compatibility with Lotus. It is less secure as the node may have direct access to it for network operations. This could potentially expose it to unauthorized access or other network-related vulnerabilities. In the following sections, we will be using the wallet in its local mode. diff --git a/docs/docs/users/knowledge_base/docker_tips.md b/docs/docs/users/knowledge_base/docker_tips.md index 1d61ecd94152..bd196c2396ea 100644 --- a/docs/docs/users/knowledge_base/docker_tips.md +++ b/docs/docs/users/knowledge_base/docker_tips.md @@ -3,7 +3,7 @@ title: Docker Tips & Tricks sidebar_position: 3 --- -# Forest in Docker🌲❤️🐋 +# Forest in Docker 🌲❤️🐋 ## Prerequisites diff --git a/docs/docs/users/reference/json_rpc_overview.md b/docs/docs/users/reference/json_rpc_overview.md index 0f0697b04664..00fe1230df2e 100644 --- a/docs/docs/users/reference/json_rpc_overview.md +++ b/docs/docs/users/reference/json_rpc_overview.md @@ -14,7 +14,7 @@ This API is still a WIP, with more methods being added continuously. :::note Need a specific method? Let us know on -[Github](https://github.com/ChainSafe/forest/issues) or Filecoin Slack +[GitHub](https://github.com/ChainSafe/forest/issues) or Filecoin Slack (`#fil-forest-help`) 🙏 ::: From ed51cf4e85b3378c1e2ba58c9befc801cc5731d0 Mon Sep 17 00:00:00 2001 From: signor1 Date: Mon, 6 Oct 2025 11:17:07 +0100 Subject: [PATCH 20/34] fix: extend spellcheck coverage to .github directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add template-specific words to forest.dic: env, WORKFLOW_URL, yaml, YY, HH, mm, known_blocks - Remove curly braces {} from tokenization_splitchars to properly handle template variables - Add regex patterns to ignore {{ and }} template delimiters - Fix British to American English in bug report template: behaviour → behavior - Update dictionary count from 230 to 237 --- .config/forest.dic | 9 ++++++++- .config/spellcheck.toml | 9 ++++++--- .github/ISSUE_TEMPLATE/1-bug_report.md | 6 +++--- Makefile | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.config/forest.dic b/.config/forest.dic index ae96bf682132..174b4a91930e 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,5 +1,12 @@ -230 +237 2k +env +HH +known_blocks +mm +WORKFLOW_URL +yaml +YY Algorand/M APIs args diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index 1a0e7c336540..16b3a5a01792 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -6,15 +6,18 @@ lang = "en_US" search_dirs = ["."] skip_os_lookups = true use_builtin = true -tokenization_splitchars = "\",;:.!?#(){}[]|/_-‒'`&@§¶…<>=~" +tokenization_splitchars = "\",;:.!?#()[]|/_-‒'`&@§¶…<>=~" extra_dictionaries = ["forest.dic", "en_US.dic"] [hunspell.quirks] transform_regex = [ # 10.7% "^[0-9_]+(?:\\.[0-9]*)?%$", - # Template variables like {{ env.WORKFLOW_URL }} - "\\{\\{[^}]+\\}\\}", + # Template variables like {{ env.WORKFLOW_URL }} or {{ date | date('D/M/YY HH:mm') }} + "\\{\\{.*?\\}\\}", + # Double braces + "^\\{\\{$", + "^\\}\\}$", # YAML frontmatter keys like sidebar_position "^[a-z_]+:.*$", # Numbers with underscores like 30_000 diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md index c85e33093950..ef614486153f 100644 --- a/.github/ISSUE_TEMPLATE/1-bug_report.md +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Provide a report of unexpected behaviour +about: Provide a report of unexpected behavior title: "" labels: "Type: Bug" assignees: "" @@ -12,7 +12,7 @@ assignees: "" ## To reproduce - + 1. Go to '...' 2. Run '....' @@ -29,7 +29,7 @@ assignees: "" ``` -## Expected behaviour +## Expected behavior diff --git a/Makefile b/Makefile index 3c52ce47b60c..ea9eff31584c 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ deny: spellcheck: cargo spellcheck --code 1 || (echo "See .config/spellcheck.md for tips"; false) - find . \( -path "./documentation" -o -path "./node_modules" -o -path "./.git" -o -path "./target" -o -path "./.github" \) -prune -o -name "*.md" -type f -print0 | xargs -0 -r cargo spellcheck --code 1 --cfg .config/spellcheck.toml || (echo "See .config/spellcheck.md for tips"; false) + find . \( -path "./documentation" -o -path "./node_modules" -o -path "./.git" -o -path "./target" \) -prune -o -name "*.md" -type f -print0 | xargs -0 -r cargo spellcheck --code 1 --cfg .config/spellcheck.toml || (echo "See .config/spellcheck.md for tips"; false) lint: license clean lint-clippy cargo fmt --all --check From e72474c943ba283def4faa0e1ca123bd4c5028a0 Mon Sep 17 00:00:00 2001 From: signor1 Date: Mon, 6 Oct 2025 11:38:33 +0100 Subject: [PATCH 21/34] fix: remove double backsticks --- docs/docs/users/reference/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/users/reference/cli.md b/docs/docs/users/reference/cli.md index cda1a7056bfa..b986baab2cb7 100644 --- a/docs/docs/users/reference/cli.md +++ b/docs/docs/users/reference/cli.md @@ -635,7 +635,7 @@ Usage: forest-cli mpool pending [OPTIONS] Options: --local Print pending messages for addresses in local wallet only - --cids Only print ``CIDs`` of messages in output + --cids Only print `CIDs` of messages in output --to Return messages to a given address --from Return messages from a given address -h, --help Print help From 84a3ff723fd5fff022eb5ccca37810936ca6bfaf Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 10 Oct 2025 22:18:43 +0100 Subject: [PATCH 22/34] feat: merge into branch --- CHANGELOG.md | 23 +++++++++++++++++++++++ src/cli/subcommands/snapshot_cmd.rs | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d64e6807c91..91d1f4b125e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,30 @@ ### Changed +<<<<<<< Updated upstream ### Removed +======= +- [#6145](https://github.com/ChainSafe/forest/pull/6145) Updated `forest-cli snapshot export` to use v2 format by default. + +### Removed + +### Fixed + +## Forest v0.30.2 "Garuda" + +This is a non-mandatory release that brings important enhancements to Forest's tooling capabilities, Ethereum RPC compatibility, and F3 integration. +The release includes new CLI commands for snapshot management and state inspection, along with critical fixes for Ethereum RPC methods. + +### Added + +- [#6074](https://github.com/ChainSafe/forest/issues/6074) Added `forest-cli snapshot export-diff` subcommand for exporting a diff snapshot. + +- [#6061](https://github.com/ChainSafe/forest/pull/6061) Added `forest-cli state actor-cids` command for listing all actor CIDs in the state tree for the current tipset. + +- [#5568](https://github.com/ChainSafe/forest/issues/5568) Added `--n-tipsets` flag to the `forest-tool index backfill` subcommand to specify the number of epochs to backfill. + +- [#6133](https://github.com/ChainSafe/forest/pull/6133) Added `Filecoin.ChainGetFinalizedTipset` API method to get the finalized tipset using f3. +>>>>>>> Stashed changes ### Fixed diff --git a/src/cli/subcommands/snapshot_cmd.rs b/src/cli/subcommands/snapshot_cmd.rs index 941ad3cf206c..7394bfcfb706 100644 --- a/src/cli/subcommands/snapshot_cmd.rs +++ b/src/cli/subcommands/snapshot_cmd.rs @@ -39,7 +39,7 @@ pub enum SnapshotCommands { #[arg(short, long, default_value_t = DEFAULT_RECENT_STATE_ROOTS)] depth: crate::chain::ChainEpochDelta, /// Snapshot format to export. - #[arg(long, value_enum, default_value_t = FilecoinSnapshotVersion::V1)] + #[arg(long, value_enum, default_value_t = FilecoinSnapshotVersion::V2)] format: FilecoinSnapshotVersion, }, /// Export a diff snapshot between `from` and `to` epochs to `` @@ -134,7 +134,7 @@ impl SnapshotCommands { "{spinner} {msg} {binary_total_bytes} written in {elapsed} ({binary_bytes_per_sec})", ) .expect("indicatif template must be valid"), - ).with_message(format!("Exporting {} ...", output_path.display())); + ).with_message(format!("Exporting v{} snapshot to {} ...", format as u64, output_path.display())); pb.enable_steady_tick(std::time::Duration::from_millis(80)); let handle = tokio::spawn({ let path: PathBuf = (&temp_path).into(); From 66abc12e4b814c5db6fa0022984862dca0d15318 Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 10 Oct 2025 22:20:04 +0100 Subject: [PATCH 23/34] feat: merge into branch --- CHANGELOG.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d1f4b125e3..79816533477a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,9 +31,6 @@ ### Changed -<<<<<<< Updated upstream -### Removed -======= - [#6145](https://github.com/ChainSafe/forest/pull/6145) Updated `forest-cli snapshot export` to use v2 format by default. ### Removed @@ -53,24 +50,6 @@ The release includes new CLI commands for snapshot management and state inspecti - [#5568](https://github.com/ChainSafe/forest/issues/5568) Added `--n-tipsets` flag to the `forest-tool index backfill` subcommand to specify the number of epochs to backfill. -- [#6133](https://github.com/ChainSafe/forest/pull/6133) Added `Filecoin.ChainGetFinalizedTipset` API method to get the finalized tipset using f3. ->>>>>>> Stashed changes - -### Fixed - -## Forest v0.30.2 "Garuda" - -This is a non-mandatory release that brings important enhancements to Forest's tooling capabilities, Ethereum RPC compatibility, and F3 integration. -The release includes new CLI commands for snapshot management and state inspection, along with critical fixes for Ethereum RPC methods. - -### Added - -- [#6074](https://github.com/ChainSafe/forest/issues/6074) Added `forest-cli snapshot export-diff` subcommand for exporting a diff snapshot. - -- [#6061](https://github.com/ChainSafe/forest/pull/6061) Added `forest-cli state actor-cids` command for listing all actor CIDs in the state tree for the current tipset. - -- [#5568](https://github.com/ChainSafe/forest/issues/5568) Added `--n-tipsets` flag to the `forest-tool index backfill` subcommand to specify the number of epochs to backfill. - - [#6133](https://github.com/ChainSafe/forest/pull/6133) Added `Filecoin.ChainGetFinalizedTipset` API method to get the finalized tipset using f3. ### Fixed From 534718cfab9c5a726177dcb5967f0911bfa3da49 Mon Sep 17 00:00:00 2001 From: signor1 Date: Fri, 10 Oct 2025 22:28:46 +0100 Subject: [PATCH 24/34] fix: resolve typos --- CHANGELOG.md | 2 +- src/cli/subcommands/mpool_cmd.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79816533477a..6f174e87a8e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -315,7 +315,7 @@ This is a mandatory release for calibnet node operators. It includes the revised ### Added -- [#5375](https://github.com/ChainSafe/forest/issues/5375) Add an RNG wrapper that that can be overridden by a reproducible seeded RNG. +- [#5375](https://github.com/ChainSafe/forest/issues/5375) Add an RNG wrapper that can be overridden by a reproducible seeded RNG. - [#5386](https://github.com/ChainSafe/forest/pull/5386) Add support for the `Filecoin.EthTraceTransaction` RPC method. diff --git a/src/cli/subcommands/mpool_cmd.rs b/src/cli/subcommands/mpool_cmd.rs index a21d6280cfb9..db64e1fa6963 100644 --- a/src/cli/subcommands/mpool_cmd.rs +++ b/src/cli/subcommands/mpool_cmd.rs @@ -20,7 +20,7 @@ pub enum MpoolCommands { /// Print pending messages for addresses in local wallet only #[arg(long)] local: bool, - /// Only print ``CIDs`` of messages in output + /// Only print `CIDs` of messages in output #[arg(long)] cids: bool, /// Return messages to a given address From 4edf8bd3ac1d9083311abbd6543c627e494555f3 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 12:34:12 +0100 Subject: [PATCH 25/34] fix: docs check --- docs/dictionary.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dictionary.txt b/docs/dictionary.txt index ea49e502f75c..ed0443c2d4d1 100644 --- a/docs/dictionary.txt +++ b/docs/dictionary.txt @@ -13,7 +13,6 @@ ChainSafe chainsafe ChainSafe's changelog -`CIDs` CLI cli Cloudflare @@ -116,3 +115,4 @@ tipsets VPS WIP zstd +`CIDs` From 15d589a6dafcf149e1fa38a3cd668bc08e83a629 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 13:13:44 +0100 Subject: [PATCH 26/34] fix: docs check --- docs/dictionary.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/dictionary.txt b/docs/dictionary.txt index ed0443c2d4d1..6568e1c48f9a 100644 --- a/docs/dictionary.txt +++ b/docs/dictionary.txt @@ -13,6 +13,7 @@ ChainSafe chainsafe ChainSafe's changelog +CIDs CLI cli Cloudflare @@ -43,7 +44,7 @@ FIPs FVM GC GiB -GitHub +Github Grafana hardcoded hotfix @@ -112,7 +113,8 @@ testnet Tipset tipset tipsets +V0 +V1 VPS WIP zstd -`CIDs` From ba395e6d2904d4a68b86bd347b04a6407e150632 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 13:45:54 +0100 Subject: [PATCH 27/34] fix: docs check --- docs/docs/users/openrpc.json | 1238 +++++++--------------------------- 1 file changed, 237 insertions(+), 1001 deletions(-) diff --git a/docs/docs/users/openrpc.json b/docs/docs/users/openrpc.json index 0812d957a7c9..720154bd3f69 100644 --- a/docs/docs/users/openrpc.json +++ b/docs/docs/users/openrpc.json @@ -64,10 +64,7 @@ "name": "F3.GetParticipatingMinerIDs.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "integer", "format": "uint64", @@ -92,10 +89,7 @@ "name": "F3.GetPowerTable.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/F3PowerEntry" } @@ -210,10 +204,7 @@ "name": "permissions", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -223,10 +214,7 @@ "name": "expiration_secs", "required": true, "schema": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "int64" } } @@ -255,10 +243,7 @@ "name": "Filecoin.AuthVerify.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -281,10 +266,7 @@ "name": "Filecoin.ChainExport.Result", "required": false, "schema": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, "paramStructure": "by-position" @@ -347,10 +329,7 @@ "name": "Filecoin.ChainGetEvents.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Event" } @@ -405,10 +384,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -419,10 +395,7 @@ "name": "Filecoin.ChainGetMessagesInTipset.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ApiMessage" } @@ -446,10 +419,7 @@ "name": "Filecoin.ChainGetParentMessages.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ApiMessage" } @@ -473,10 +443,7 @@ "name": "Filecoin.ChainGetParentReceipts.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ApiReceipt" } @@ -507,10 +474,7 @@ "name": "Filecoin.ChainGetPath.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/PathChange" } @@ -526,10 +490,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -561,10 +522,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -596,10 +554,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -732,10 +687,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -758,10 +710,7 @@ "name": "Filecoin.EthAccounts.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -895,10 +844,7 @@ "name": "rewardPercentiles", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "number", "format": "double" @@ -1024,10 +970,7 @@ "name": "Filecoin.EthGetBlockReceipts.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1058,10 +1001,7 @@ "name": "Filecoin.EthGetBlockReceiptsLimited.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1605,10 +1545,7 @@ "name": "Filecoin.EthTraceBlock.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1632,10 +1569,7 @@ "name": "Filecoin.EthTraceFilter.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1657,10 +1591,7 @@ "name": "traceTypes", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -1671,10 +1602,7 @@ "name": "Filecoin.EthTraceReplayBlockTransactions.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -1698,10 +1626,7 @@ "name": "Filecoin.EthTraceTransaction.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1758,10 +1683,7 @@ "name": "tipset_key", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -1772,10 +1694,7 @@ "name": "Filecoin.F3GetECPowerTable.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/F3PowerEntry" } @@ -1790,10 +1709,7 @@ "name": "tipset_key", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -1804,10 +1720,7 @@ "name": "Filecoin.F3GetF3PowerTable.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/F3PowerEntry" } @@ -1906,10 +1819,7 @@ "name": "Filecoin.F3ListParticipants.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/F3Participant" } @@ -1960,10 +1870,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -1994,10 +1901,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2046,10 +1950,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2094,10 +1995,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2136,10 +2034,7 @@ "name": "Filecoin.GetActorEventsRaw.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ActorEvent" } @@ -2225,10 +2120,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2259,10 +2151,7 @@ "name": "messages", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2273,10 +2162,7 @@ "name": "Filecoin.MpoolBatchPush.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2292,10 +2178,7 @@ "name": "messages", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2306,10 +2189,7 @@ "name": "Filecoin.MpoolBatchPushUntrusted.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2348,10 +2228,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2455,10 +2332,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2477,10 +2351,7 @@ "name": "Filecoin.MpoolSelect.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SignedMessage" } @@ -2502,10 +2373,7 @@ "name": "tipset_key", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2535,10 +2403,7 @@ "name": "tipset_key", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2549,10 +2414,7 @@ "name": "Filecoin.MsigGetPending.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Transaction" } @@ -2574,10 +2436,7 @@ "name": "start_tsk", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2587,10 +2446,7 @@ "name": "end_tsk", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2620,10 +2476,7 @@ "name": "tsk", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2767,10 +2620,7 @@ "name": "Filecoin.NetPeers.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/AddrInfo" } @@ -2786,10 +2636,7 @@ "name": "peerIdList", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2813,10 +2660,7 @@ "name": "Filecoin.NetProtectList.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2832,10 +2676,7 @@ "name": "peerIdList", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -2928,10 +2769,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2962,10 +2800,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -2989,10 +2824,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3024,10 +2856,7 @@ "name": "messages", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Message" } @@ -3037,10 +2866,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3080,10 +2906,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3130,10 +2953,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3162,10 +2982,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3196,10 +3013,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3229,10 +3043,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3278,10 +3089,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3321,10 +3129,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3364,10 +3169,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3400,10 +3202,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3471,10 +3270,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3512,10 +3308,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3566,10 +3359,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3601,10 +3391,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3651,10 +3438,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3701,10 +3485,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3728,10 +3509,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3742,10 +3520,7 @@ "name": "Filecoin.StateListActors.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Address" } @@ -3768,10 +3543,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3790,10 +3562,7 @@ "name": "Filecoin.StateListMessages.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3809,10 +3578,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3823,10 +3589,7 @@ "name": "Filecoin.StateListMiners.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Address" } @@ -3849,10 +3612,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3883,10 +3643,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3917,10 +3674,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3944,10 +3698,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -3974,10 +3725,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4013,10 +3761,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4047,10 +3792,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4061,10 +3803,7 @@ "name": "Filecoin.StateMinerActiveSectors.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SectorOnChainInfo" } @@ -4087,10 +3826,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4121,10 +3857,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4155,10 +3888,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4169,10 +3899,7 @@ "name": "Filecoin.StateMinerDeadlines.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ApiDeadline" } @@ -4195,10 +3922,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4229,10 +3953,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4270,10 +3991,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4320,10 +4038,7 @@ "name": "tipset_key", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4363,10 +4078,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4377,10 +4089,7 @@ "name": "Filecoin.StateMinerPartitions.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/MinerPartitions" } @@ -4403,10 +4112,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4444,10 +4150,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4478,10 +4181,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4512,10 +4212,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4555,10 +4252,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4589,10 +4283,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4637,10 +4328,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4651,10 +4339,7 @@ "name": "Filecoin.StateMinerSectors.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SectorOnChainInfo" } @@ -4682,10 +4367,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4716,10 +4398,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4743,10 +4422,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4777,10 +4453,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4842,10 +4515,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4885,10 +4555,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4935,10 +4602,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -4978,10 +4642,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -5012,10 +4673,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -5046,10 +4704,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -5080,10 +4735,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -5114,10 +4766,7 @@ "name": "tipsetKey", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } @@ -5386,10 +5035,7 @@ "name": "Filecoin.WalletList.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Address" } @@ -5648,10 +5294,7 @@ "name": "save_to_file", "required": true, "schema": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } ], @@ -5697,10 +5340,7 @@ "name": "eth_accounts.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -5814,10 +5454,7 @@ "name": "rewardPercentiles", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "number", "format": "double" @@ -5943,10 +5580,7 @@ "name": "eth_getBlockReceipts.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -5977,10 +5611,7 @@ "name": "eth_getBlockReceiptsLimited.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -6568,10 +6199,7 @@ "name": "trace_block.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6595,10 +6223,7 @@ "name": "trace_filter.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6620,10 +6245,7 @@ "name": "traceTypes", "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -6634,10 +6256,7 @@ "name": "trace_replayBlockTransactions.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -6661,10 +6280,7 @@ "name": "trace_transaction.Result", "required": false, "schema": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6734,10 +6350,7 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "codec", - "value" - ] + "required": ["codec", "value"] }, "ActorEventFilter": { "type": "object", @@ -6758,10 +6371,7 @@ } }, "fromHeight": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "int64" }, "tipsetKey": { @@ -6775,10 +6385,7 @@ ] }, "toHeight": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "int64" } } @@ -6804,12 +6411,7 @@ "minimum": 0 } }, - "required": [ - "Code", - "Head", - "Nonce", - "Balance" - ] + "required": ["Code", "Head", "Nonce", "Balance"] }, "ActorTrace": { "type": "object", @@ -6823,10 +6425,7 @@ "$ref": "#/components/schemas/ActorState" } }, - "required": [ - "Id", - "State" - ] + "required": ["Id", "State"] }, "AddrInfo": { "type": "object", @@ -6842,10 +6441,7 @@ "type": "string" } }, - "required": [ - "ID", - "Addrs" - ] + "required": ["ID", "Addrs"] }, "Address": { "type": "string" @@ -6905,11 +6501,7 @@ }, "State": true }, - "required": [ - "Balance", - "Code", - "State" - ] + "required": ["Balance", "Code", "State"] }, "ApiDeadline": { "type": "object", @@ -6926,11 +6518,7 @@ "$ref": "#/components/schemas/BitField" } }, - "required": [ - "PostSubmissions", - "DisputableProofCount", - "DailyFee" - ] + "required": ["PostSubmissions", "DisputableProofCount", "DailyFee"] }, "ApiDeadlineInfo": { "type": "string" @@ -7025,10 +6613,7 @@ "$ref": "#/components/schemas/EthUint64" }, "accessList": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/EthHash" } @@ -7203,14 +6788,7 @@ "$ref": "#/components/schemas/Nullable_Receipt" } }, - "required": [ - "MsgCid", - "Msg", - "MsgRct", - "Error", - "Duration", - "GasCost" - ] + "required": ["MsgCid", "Msg", "MsgRct", "Error", "Duration", "GasCost"] }, "ApiMarketDeal": { "type": "object", @@ -7222,10 +6800,7 @@ "$ref": "#/components/schemas/ApiDealState" } }, - "required": [ - "Proposal", - "State" - ] + "required": ["Proposal", "State"] }, "ApiMessage": { "type": "object", @@ -7237,10 +6812,7 @@ "$ref": "#/components/schemas/Message" } }, - "required": [ - "Cid", - "Message" - ] + "required": ["Cid", "Message"] }, "ApiReceipt": { "type": "object", @@ -7260,18 +6832,10 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "ExitCode", - "Return", - "GasUsed", - "EventsRoot" - ] + "required": ["ExitCode", "Return", "GasUsed", "EventsRoot"] }, "Base64String": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "BeaconEntry": { "type": "object", @@ -7285,10 +6849,7 @@ "minimum": 0 } }, - "required": [ - "Round", - "Data" - ] + "required": ["Round", "Data"] }, "BeneficiaryTerm": { "type": "object", @@ -7307,20 +6868,13 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "Quota", - "UsedQuota", - "Expiration" - ] + "required": ["Quota", "UsedQuota", "Expiration"] }, "BigInt": { "type": "string" }, "BitField": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "integer", "format": "uint8", @@ -7432,10 +6986,7 @@ "type": "boolean" } }, - "required": [ - "blockHash", - "requireCanonical" - ] + "required": ["blockHash", "requireCanonical"] }, "BlockHeader": { "type": "object", @@ -7522,11 +7073,7 @@ "$ref": "#/components/schemas/Nullable_Array_of_Cid" } }, - "required": [ - "Header", - "BlsMessages", - "SecpkMessages" - ] + "required": ["Header", "BlsMessages", "SecpkMessages"] }, "BlockMessages": { "type": "object", @@ -7541,11 +7088,7 @@ "$ref": "#/components/schemas/Nullable_Array_of_SignedMessage" } }, - "required": [ - "BlsMessages", - "SecpkMessages", - "Cids" - ] + "required": ["BlsMessages", "SecpkMessages", "Cids"] }, "BlockNumber": { "type": "object", @@ -7554,9 +7097,7 @@ "$ref": "#/components/schemas/EthInt64" } }, - "required": [ - "blockNumber" - ] + "required": ["blockNumber"] }, "BlockNumberOrHash": { "anyOf": [ @@ -7755,9 +7296,7 @@ "type": "string" } }, - "required": [ - "/" - ] + "required": ["/"] }, "CirculatingSupply": { "type": "object", @@ -7802,10 +7341,7 @@ "$ref": "#/components/schemas/BigInt" } }, - "required": [ - "RawBytePower", - "QualityAdjPower" - ] + "required": ["RawBytePower", "QualityAdjPower"] }, "ClaimLotusJson": { "type": "object", @@ -7867,10 +7403,7 @@ "$ref": "#/components/schemas/ApiInvocResult" } }, - "required": [ - "Root", - "Trace" - ] + "required": ["Root", "Trace"] }, "DealCollateralBounds": { "type": "object", @@ -7882,10 +7415,7 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "Min", - "Max" - ] + "required": ["Min", "Max"] }, "ECTipSet": { "type": "object", @@ -7904,12 +7434,7 @@ "type": "string" } }, - "required": [ - "Key", - "Epoch", - "PowerTable", - "Commitments" - ] + "required": ["Key", "Epoch", "PowerTable", "Commitments"] }, "EcConfig": { "type": "object", @@ -7962,10 +7487,7 @@ "format": "int64" } }, - "required": [ - "VRFProof", - "WinCount" - ] + "required": ["VRFProof", "WinCount"] }, "EthAddress": { "type": "string" @@ -8004,10 +7526,7 @@ "format": "int64" }, "error": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "result": { "$ref": "#/components/schemas/TraceResult" @@ -8140,13 +7659,7 @@ "$ref": "#/components/schemas/EthBigInt" } }, - "required": [ - "callType", - "from", - "gas", - "value", - "input" - ] + "required": ["callType", "from", "gas", "value", "input"] }, "EthCallTraceResult": { "type": "object", @@ -8158,10 +7671,7 @@ "$ref": "#/components/schemas/EthBytes" } }, - "required": [ - "gasUsed", - "output" - ] + "required": ["gasUsed", "output"] }, "EthCreateTraceAction": { "type": "object", @@ -8179,12 +7689,7 @@ "$ref": "#/components/schemas/EthBigInt" } }, - "required": [ - "from", - "gas", - "value", - "init" - ] + "required": ["from", "gas", "value", "init"] }, "EthCreateTraceResult": { "type": "object", @@ -8206,10 +7711,7 @@ "$ref": "#/components/schemas/EthUint64" } }, - "required": [ - "gasUsed", - "code" - ] + "required": ["gasUsed", "code"] }, "EthFeeHistoryResult": { "type": "object", @@ -8231,10 +7733,7 @@ "$ref": "#/components/schemas/EthUint64" }, "reward": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "array", "items": { @@ -8243,11 +7742,7 @@ } } }, - "required": [ - "oldestBlock", - "baseFeePerGas", - "gasUsedRatio" - ] + "required": ["oldestBlock", "baseFeePerGas", "gasUsedRatio"] }, "EthFilterResult": { "description": "`EthFilterResult` represents the response from executing a filter:\n- A list of block hashes\n- A list of transaction hashes\n- Or a list of logs", @@ -8290,16 +7785,10 @@ ] }, "fromBlock": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "toBlock": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "topics": { "anyOf": [ @@ -8312,9 +7801,7 @@ ] } }, - "required": [ - "address" - ] + "required": ["address"] }, "EthHash": { "type": "string" @@ -8406,10 +7893,7 @@ "$ref": "#/components/schemas/EthBytes" }, "stateDiff": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "trace": { "type": "array", @@ -8421,17 +7905,10 @@ "$ref": "#/components/schemas/EthHash" }, "vmTrace": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } }, - "required": [ - "output", - "trace", - "transactionHash" - ] + "required": ["output", "trace", "transactionHash"] }, "EthSyncingResultLotusJson": { "anyOf": [ @@ -8454,11 +7931,7 @@ "format": "int64" } }, - "required": [ - "startingblock", - "currentblock", - "highestblock" - ] + "required": ["startingblock", "currentblock", "highestblock"] } ] }, @@ -8478,10 +7951,7 @@ "$ref": "#/components/schemas/TraceAction" }, "error": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "result": { "$ref": "#/components/schemas/TraceResult" @@ -8498,13 +7968,7 @@ } } }, - "required": [ - "type", - "subtraces", - "traceAddress", - "action", - "result" - ] + "required": ["type", "subtraces", "traceAddress", "action", "result"] }, "EthTraceFilterCriteria": { "type": "object", @@ -8544,10 +8008,7 @@ }, "fromBlock": { "description": "Interpreted as an epoch (in hex) or one of \"latest\" for last mined block, \"pending\" for not yet committed messages.\nOptional, default: \"latest\".\nNote: \"earliest\" is not a permitted value.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "toAddress": { "description": "Actor address or a list of addresses to which transactions that generate traces are sent.\nOptional, default: None.\nThe JSON decoding must treat a string as equivalent to an array with one value, for example\n\"0x8888f1f195afa192cfee86069858\" must be decoded as [ \"0x8888f1f195afa192cfee86069858\" ]", @@ -8562,10 +8023,7 @@ }, "toBlock": { "description": "Interpreted as an epoch (in hex) or one of \"latest\" for last mined block, \"pending\" for not yet committed messages.\nOptional, default: \"latest\".\nNote: \"earliest\" is not a permitted value.", - "type": [ - "string", - "null" - ] + "type": ["string", "null"] } } }, @@ -8670,10 +8128,7 @@ } } }, - "required": [ - "Emitter", - "Entries" - ] + "required": ["Emitter", "Entries"] }, "EventEntry": { "type": "object", @@ -8695,12 +8150,7 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "Flags", - "Key", - "Codec", - "Value" - ] + "required": ["Flags", "Key", "Codec", "Value"] }, "ExecutionTrace": { "type": "object", @@ -8731,12 +8181,7 @@ "$ref": "#/components/schemas/Nullable_Array_of_ExecutionTrace" } }, - "required": [ - "Msg", - "MsgRct", - "GasCharges", - "Subcalls" - ] + "required": ["Msg", "MsgRct", "GasCharges", "Subcalls"] }, "ExitCode": { "description": "`Newtype` wrapper for the FVM `ExitCode`.\n\n# Examples\n```\n# use forest::doctest_private::ExitCode;\nlet fvm2_success = fvm_shared2::error::ExitCode::new(0);\nlet fvm3_success = fvm_shared3::error::ExitCode::new(0);\n\nlet shim_from_v2 = ExitCode::from(fvm2_success);\nlet shim_from_v3 = ExitCode::from(fvm3_success);\n\nassert_eq!(shim_from_v2, shim_from_v3);\nassert_eq!(shim_from_v2, fvm2_success.into());\nassert_eq!(shim_from_v3, fvm3_success.into());\n```", @@ -8781,12 +8226,7 @@ "minimum": 0 } }, - "required": [ - "SealProof", - "SectorNumber", - "SectorKey", - "SealedCID" - ] + "required": ["SealProof", "SectorNumber", "SectorKey", "SealedCID"] }, "F3InstanceProgress": { "type": "object", @@ -8811,11 +8251,7 @@ "minimum": 0 } }, - "required": [ - "ID", - "Round", - "Phase" - ] + "required": ["ID", "Round", "Phase"] }, "F3Manifest": { "type": "object", @@ -8904,11 +8340,7 @@ "minimum": 0 } }, - "required": [ - "MinerID", - "FromInstance", - "ValidityTerm" - ] + "required": ["MinerID", "FromInstance", "ValidityTerm"] }, "F3PowerEntry": { "description": "PowerEntry represents a single entry in the PowerTable, including ActorID and its StoragePower and PubKey.", @@ -8926,11 +8358,7 @@ "type": "string" } }, - "required": [ - "ID", - "Power", - "PubKey" - ] + "required": ["ID", "Power", "PubKey"] }, "F3TipSet": { "type": "object", @@ -8954,12 +8382,7 @@ "minimum": 0 } }, - "required": [ - "key", - "beacon", - "epoch", - "timestamp" - ] + "required": ["key", "beacon", "epoch", "timestamp"] }, "F3TipSetKey": { "description": "TipSetKey is the canonically ordered concatenation of the block `CIDs` in a tipset.", @@ -9012,10 +8435,7 @@ "properties": { "last_updated": { "description": "Last time status for this fork was updated.", - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "format": "date-time" }, "stage": { @@ -9024,10 +8444,7 @@ }, "start_time": { "description": "When processing for this fork started.", - "type": [ - "string", - "null" - ], + "type": ["string", "null"], "format": "date-time" }, "target_epoch": { @@ -9267,13 +8684,7 @@ "minimum": 0 } }, - "required": [ - "Name", - "tg", - "cg", - "sg", - "tt" - ] + "required": ["Name", "tg", "cg", "sg", "tt"] }, "GossipBlock": { "type": "object", @@ -9288,11 +8699,7 @@ "$ref": "#/components/schemas/Cid" } }, - "required": [ - "Header", - "BlsMessages", - "SecpkMessages" - ] + "required": ["Header", "BlsMessages", "SecpkMessages"] }, "GpbftConfig": { "type": "object", @@ -9361,10 +8768,7 @@ "$ref": "#/components/schemas/SignatureTypeLotusJson" } }, - "required": [ - "Type", - "PrivateKey" - ] + "required": ["Type", "PrivateKey"] }, "MarketBalance": { "description": "External format for returning market balance from state.", @@ -9377,10 +8781,7 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "Escrow", - "Locked" - ] + "required": ["Escrow", "Locked"] }, "Message": { "type": "object", @@ -9431,10 +8832,7 @@ "minimum": 0 } }, - "required": [ - "To", - "From" - ] + "required": ["To", "From"] }, "MessageFilter": { "type": "object", @@ -9446,10 +8844,7 @@ "$ref": "#/components/schemas/Nullable_Address" } }, - "required": [ - "From", - "To" - ] + "required": ["From", "To"] }, "MessageGasCost": { "type": "object", @@ -9508,13 +8903,7 @@ "$ref": "#/components/schemas/NonEmpty_Array_of_Cid" } }, - "required": [ - "Receipt", - "TipSet", - "Height", - "Message", - "ReturnDec" - ] + "required": ["Receipt", "TipSet", "Height", "Message", "ReturnDec"] }, "MessageSendSpec": { "type": "object", @@ -9523,9 +8912,7 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "MaxFee" - ] + "required": ["MaxFee"] }, "MessageTrace": { "type": "object", @@ -9534,10 +8921,7 @@ "$ref": "#/components/schemas/Address" }, "GasLimit": { - "type": [ - "integer", - "null" - ], + "type": ["integer", "null"], "format": "uint64", "minimum": 0 }, @@ -9555,10 +8939,7 @@ "minimum": 0 }, "ReadOnly": { - "type": [ - "boolean", - "null" - ] + "type": ["boolean", "null"] }, "To": { "$ref": "#/components/schemas/Address" @@ -9567,14 +8948,7 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "From", - "To", - "Value", - "Method", - "Params", - "ParamsCodec" - ] + "required": ["From", "To", "Value", "Method", "Params", "ParamsCodec"] }, "MinerInfo": { "type": "object", @@ -9687,11 +9061,7 @@ "$ref": "#/components/schemas/Claim" } }, - "required": [ - "MinerPower", - "TotalPower", - "HasMinPower" - ] + "required": ["MinerPower", "TotalPower", "HasMinPower"] }, "MinerSectors": { "type": "object", @@ -9712,11 +9082,7 @@ "minimum": 0 } }, - "required": [ - "Live", - "Active", - "Faulty" - ] + "required": ["Live", "Active", "Faulty"] }, "MiningBaseInfo": { "type": "object", @@ -9774,20 +9140,13 @@ "format": "int64" } }, - "required": [ - "InitialBalance", - "StartEpoch", - "UnlockDuration" - ] + "required": ["InitialBalance", "StartEpoch", "UnlockDuration"] }, "NatStatusResult": { "type": "object", "properties": { "PublicAddrs": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "string" } @@ -9797,9 +9156,7 @@ "format": "int32" } }, - "required": [ - "Reachability" - ] + "required": ["Reachability"] }, "NetInfoResult": { "type": "object", @@ -9917,10 +9274,7 @@ "minimum": 0 } }, - "required": [ - "peers_to_publish_msgs", - "peers_to_publish_blocks" - ] + "required": ["peers_to_publish_msgs", "peers_to_publish_blocks"] }, "NodeStatusResult": { "type": "object", @@ -9935,11 +9289,7 @@ "$ref": "#/components/schemas/NodeSyncStatus" } }, - "required": [ - "sync_status", - "peer_status", - "chain_status" - ] + "required": ["sync_status", "peer_status", "chain_status"] }, "NodeSyncStatus": { "type": "object", @@ -9955,10 +9305,7 @@ "minimum": 0 } }, - "required": [ - "epoch", - "behind" - ] + "required": ["epoch", "behind"] }, "NodeSyncStatus2": { "description": "Represents the overall synchronization status of the Forest node.", @@ -10018,109 +9365,73 @@ ] }, "Nullable_Array_of_Address": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Address" } }, "Nullable_Array_of_Base64String": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Base64String" } }, "Nullable_Array_of_BeaconEntry": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/BeaconEntry" } }, "Nullable_Array_of_Cid": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Cid" } }, "Nullable_Array_of_ECTipSet": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ECTipSet" } }, "Nullable_Array_of_ExecutionTrace": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ExecutionTrace" } }, "Nullable_Array_of_ExtendedSectorInfo": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/ExtendedSectorInfo" } }, "Nullable_Array_of_Message": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/Message" } }, "Nullable_Array_of_PoStProof": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/PoStProof" } }, "Nullable_Array_of_PowerTableDelta": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/PowerTableDelta" } }, "Nullable_Array_of_SignedMessage": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "$ref": "#/components/schemas/SignedMessage" } }, "Nullable_Array_of_uint64": { - "type": [ - "array", - "null" - ], + "type": ["array", "null"], "items": { "type": "integer", "format": "uint64", @@ -10208,10 +9519,7 @@ ] }, "Nullable_string": { - "type": [ - "string", - "null" - ] + "type": ["string", "null"] }, "ObjStat": { "type": "object", @@ -10227,10 +9535,7 @@ "minimum": 0 } }, - "required": [ - "Size", - "Links" - ] + "required": ["Size", "Links"] }, "PartialMessageManagerConfig": { "type": "object", @@ -10287,10 +9592,7 @@ "$ref": "#/components/schemas/Tipset" } }, - "required": [ - "Type", - "Val" - ] + "required": ["Type", "Val"] }, { "type": "object", @@ -10303,10 +9605,7 @@ "$ref": "#/components/schemas/Tipset" } }, - "required": [ - "Type", - "Val" - ] + "required": ["Type", "Val"] } ] }, @@ -10348,10 +9647,7 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "PoStProof", - "ProofBytes" - ] + "required": ["PoStProof", "ProofBytes"] }, "PowerTableDelta": { "type": "object", @@ -10368,11 +9664,7 @@ "type": "string" } }, - "required": [ - "ParticipantID", - "PowerDelta", - "SigningKey" - ] + "required": ["ParticipantID", "PowerDelta", "SigningKey"] }, "PubSubConfig": { "type": "object", @@ -10415,11 +9707,7 @@ "type": "string" } }, - "required": [ - "Version", - "APIVersion", - "BlockDelay" - ] + "required": ["Version", "APIVersion", "BlockDelay"] }, "Receipt": { "type": "object", @@ -10442,11 +9730,7 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "ExitCode", - "Return", - "GasUsed" - ] + "required": ["ExitCode", "Return", "GasUsed"] }, "ReturnTrace": { "type": "object", @@ -10463,11 +9747,7 @@ "minimum": 0 } }, - "required": [ - "ExitCode", - "Return", - "ReturnCodec" - ] + "required": ["ExitCode", "Return", "ReturnCodec"] }, "SectorExpiration": { "type": "object", @@ -10481,10 +9761,7 @@ "format": "int64" } }, - "required": [ - "OnTime", - "Early" - ] + "required": ["OnTime", "Early"] }, "SectorLocation": { "type": "object", @@ -10500,10 +9777,7 @@ "minimum": 0 } }, - "required": [ - "Deadline", - "Partition" - ] + "required": ["Deadline", "Partition"] }, "SectorOnChainInfo": { "type": "object", @@ -10645,11 +9919,7 @@ "format": "int64" } }, - "required": [ - "Info", - "PreCommitDeposit", - "PreCommitEpoch" - ] + "required": ["Info", "PreCommitDeposit", "PreCommitEpoch"] }, "SectorSize": { "type": "integer", @@ -10672,19 +9942,12 @@ "$ref": "#/components/schemas/SignatureTypeLotusJson" } }, - "required": [ - "Type", - "Data" - ] + "required": ["Type", "Data"] }, "SignatureType": { "description": "Signature variants for Filecoin signatures.", "type": "string", - "enum": [ - "Secp256k1", - "Bls", - "Delegated" - ] + "enum": ["Secp256k1", "Bls", "Delegated"] }, "SignatureTypeLotusJson": { "anyOf": [ @@ -10712,20 +9975,13 @@ "$ref": "#/components/schemas/Signature" } }, - "required": [ - "Message", - "Signature" - ] + "required": ["Message", "Signature"] }, "SnapshotProgressState": { "oneOf": [ { "type": "string", - "enum": [ - "Initializing", - "Completed", - "NotRequired" - ] + "enum": ["Initializing", "Completed", "NotRequired"] }, { "type": "object", @@ -10737,15 +9993,11 @@ "type": "string" } }, - "required": [ - "message" - ] + "required": ["message"] } }, "additionalProperties": false, - "required": [ - "InProgress" - ] + "required": ["InProgress"] } ] }, @@ -10759,10 +10011,7 @@ "type": "string" } }, - "required": [ - "Commitments", - "PowerTable" - ] + "required": ["Commitments", "PowerTable"] }, "SyncStatusReport": { "description": "Contains information about the current status of the node's synchronization process.", @@ -10826,9 +10075,7 @@ "$ref": "#/components/schemas/Base64String" } }, - "required": [ - "VRFProof" - ] + "required": ["VRFProof"] }, "Tipset": { "$ref": "#/components/schemas/TipsetInner" @@ -10847,11 +10094,7 @@ "format": "int64" } }, - "required": [ - "Cids", - "Blocks", - "Height" - ] + "required": ["Cids", "Blocks", "Height"] }, "TokenAmount": { "$ref": "#/components/schemas/BigInt" @@ -10901,14 +10144,7 @@ "$ref": "#/components/schemas/TokenAmount" } }, - "required": [ - "ID", - "To", - "Value", - "Method", - "Params", - "Approved" - ] + "required": ["ID", "To", "Value", "Method", "Params", "Approved"] }, "Transactions": { "anyOf": [ @@ -10932,4 +10168,4 @@ } } } -} \ No newline at end of file +} From 38494efe61b51b8439934916e57660138a9e521c Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 22:25:17 +0100 Subject: [PATCH 28/34] fix: update spellcheck.toml --- .config/spellcheck.toml | 2 +- config.toml | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 config.toml diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index 16b3a5a01792..c03cbb3c8f49 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -29,7 +29,7 @@ transform_regex = [ # Import statements like @theme/Tabs "@theme/.*", # Emoji sequences (literal emojis) - "^[🌲🪷🐳❤️🐋]+$", + "^[🌲🪷🐳❤️🐋⚠️]+$", ] allow_concatenation = false allow_dashes = false diff --git a/config.toml b/config.toml new file mode 100644 index 000000000000..80a71c12ac49 --- /dev/null +++ b/config.toml @@ -0,0 +1,46 @@ +[chain] +type = "mainnet" + +[client] +data_dir = "/Users/MAC/Library/Application Support/com.ChainSafe.Forest" +enable_rpc = true +enable_metrics_endpoint = true +enable_health_check = true +import_mode = "Auto" +skip_load = false +chunk_size = 500000 +buffer_size = 1 +encrypt_keystore = true +metrics_address = "0.0.0.0:6116" +rpc_address = "127.0.0.1:2345" +healthcheck_address = "127.0.0.1:2346" +load_actors = true + +[parity_db] +enable_statistics = false + +[network] +listening_multiaddrs = ["/ip4/0.0.0.0/tcp/0"] +bootstrap_peers = [] +mdns = false +kademlia = true +target_peer_count = 75 + +[sync] +recent_state_roots = 2000 + +[daemon] +umask = 23 +stdout = "forest.out" +stderr = "forest.err" +work_dir = "." + +[events] +max_filter_results = 10000 +max_filter_height_range = 2880 + +[fevm] +eth_trace_filter_max_results = 500 + +[chain_indexer] +enable_indexer = false From ea417b9a6b2ca260e4fc31138f7d43e363ae93ce Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 22:34:08 +0100 Subject: [PATCH 29/34] fix: update spellcheck.toml --- .config/spellcheck.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index c03cbb3c8f49..8ffe1c5164cc 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -19,7 +19,7 @@ transform_regex = [ "^\\{\\{$", "^\\}\\}$", # YAML frontmatter keys like sidebar_position - "^[a-z_]+:.*$", + "^(title|description|sidebar_position|author|authors|date|tags?):.*$", # Numbers with underscores like 30_000 "^[0-9_]+$", # Plus signs and other operators From 3cf5b17090bcbbb067c48da1c69ac9196c7618c4 Mon Sep 17 00:00:00 2001 From: signor1 Date: Thu, 16 Oct 2025 22:40:55 +0100 Subject: [PATCH 30/34] fix: delete file generated in running test --- config.toml | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 config.toml diff --git a/config.toml b/config.toml deleted file mode 100644 index 80a71c12ac49..000000000000 --- a/config.toml +++ /dev/null @@ -1,46 +0,0 @@ -[chain] -type = "mainnet" - -[client] -data_dir = "/Users/MAC/Library/Application Support/com.ChainSafe.Forest" -enable_rpc = true -enable_metrics_endpoint = true -enable_health_check = true -import_mode = "Auto" -skip_load = false -chunk_size = 500000 -buffer_size = 1 -encrypt_keystore = true -metrics_address = "0.0.0.0:6116" -rpc_address = "127.0.0.1:2345" -healthcheck_address = "127.0.0.1:2346" -load_actors = true - -[parity_db] -enable_statistics = false - -[network] -listening_multiaddrs = ["/ip4/0.0.0.0/tcp/0"] -bootstrap_peers = [] -mdns = false -kademlia = true -target_peer_count = 75 - -[sync] -recent_state_roots = 2000 - -[daemon] -umask = 23 -stdout = "forest.out" -stderr = "forest.err" -work_dir = "." - -[events] -max_filter_results = 10000 -max_filter_height_range = 2880 - -[fevm] -eth_trace_filter_max_results = 500 - -[chain_indexer] -enable_indexer = false From 66e6ca24d16d555b8fe202a981e65c0e524b2e7c Mon Sep 17 00:00:00 2001 From: signor1 Date: Sat, 18 Oct 2025 16:12:49 +0100 Subject: [PATCH 31/34] fix: Added back the trailing newline at the end of build/manifest.json to match what the test expects --- build/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/manifest.json b/build/manifest.json index c4340969bbf5..b79befdab387 100644 --- a/build/manifest.json +++ b/build/manifest.json @@ -3143,4 +3143,4 @@ "actor_list_cid": "bafy2bzaceasz5pov3d4tyxxdcxj2qvvdnkdxihzycj5oos5t2xj5pznwvxvem" } } -] \ No newline at end of file +] From 9f3b4a6b3d9a1ecddc7ebcbc3336f68b4f0596b8 Mon Sep 17 00:00:00 2001 From: signor1 Date: Sat, 15 Nov 2025 22:03:18 +0100 Subject: [PATCH 32/34] feat: clean up spellcheck --- .config/forest.dic | 59 --------- .github/workflows/docs-check.yml | 2 - docs/Makefile | 9 -- docs/dictionary.txt | 122 ------------------ docs/package.json | 2 - src/blocks/block.rs | 6 +- src/blocks/chain4u.rs | 2 +- src/chain/snapshot_format.rs | 2 +- src/chain/store/chain_store.rs | 4 +- src/chain_sync/consensus.rs | 2 +- src/cid_collections/hash_map.rs | 6 +- src/cid_collections/mod.rs | 2 +- src/cli/humantoken.rs | 2 +- src/cli/subcommands/f3_cmd.rs | 32 ++--- src/cli/subcommands/mod.rs | 2 +- src/db/car/any.rs | 2 +- src/db/car/forest.rs | 2 +- src/db/car/mod.rs | 2 +- src/db/car/plain.rs | 10 +- src/eth/eip_1559_transaction.rs | 4 +- src/eth/eip_155_transaction.rs | 10 +- src/eth/homestead_transaction.rs | 4 +- src/f3/mod.rs | 2 +- src/health/endpoints.rs | 2 +- src/libp2p/chain_exchange/message.rs | 4 +- src/libp2p/discovery.rs | 2 +- src/libp2p_bitswap/message.rs | 2 +- src/lotus_json/ipld.rs | 2 +- src/lotus_json/mod.rs | 20 +-- src/message/signed_message.rs | 2 +- src/rpc/channel.rs | 2 +- src/rpc/mod.rs | 2 +- src/rpc/reflect/mod.rs | 2 +- src/rpc/types/mod.rs | 2 +- src/shim/actors/builtin/miner/mod.rs | 6 +- src/shim/crypto.rs | 4 +- src/shim/version.rs | 2 +- src/tool/subcommands/api_cmd.rs | 6 +- .../subcommands/api_cmd/stateful_tests.rs | 2 +- src/tool/subcommands/archive_cmd.rs | 8 +- src/utils/db/car_stream.rs | 18 +-- src/utils/io/progress_log.rs | 4 +- src/utils/io/writer_checksum.rs | 2 +- src/utils/misc/env.rs | 4 +- src/utils/multihash.rs | 4 +- src/utils/proofs_api/paramfetch.rs | 10 +- 46 files changed, 104 insertions(+), 298 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/dictionary.txt diff --git a/.config/forest.dic b/.config/forest.dic index 174b4a91930e..8767a6198899 100644 --- a/.config/forest.dic +++ b/.config/forest.dic @@ -1,17 +1,7 @@ 237 -2k -env -HH -known_blocks -mm -WORKFLOW_URL -yaml -YY Algorand/M APIs -args arity -async attoFIL autogenerated automagically @@ -32,11 +22,7 @@ calldata callee canonicalization CAR/SM -CARv1/SM -CARv2/SM CBOR -chain_follower -ChainNotify ChainSafe/M changelog CID/SM @@ -45,12 +31,9 @@ clonable Cloudflare codebase codec -Composable -config cron crypto Curio -CurrentEpoch daemon daemonize Datacap @@ -72,24 +55,16 @@ Drilldown/SM Drilldowns eg EIP -EIP155 entrypoint/SM -enum/S -EOF eth Ethereum EVM -exa -f3 -f4 FFI FIL -Filecoin's Filecoin/M FilecoinEC Filops FilOz -FilOz's FIP FIPs followable @@ -103,16 +78,11 @@ Grafana GraphQL HAMT hardcoded -hasher healthcheck -hide_title hotfix -HttpJsonRpc implementer/SM -implementor/SM infeasible interop/SM -io IP IPFS IPLD @@ -126,17 +96,13 @@ Kubernetes libp2p liveness localhost -localhost's LRU -M1 -M2 macOS mainnet MDNS MDX mempool Merkle -MessageSeqNo MiB middleware milliGas @@ -144,14 +110,8 @@ multiaddr/SM multihash multiline multisig -mutex namespace/SM -NetworkEvent/SM -NV22 -NV23 -NV24 NVMe -NVXX onwards OpenRPC overallocation @@ -166,10 +126,7 @@ pointer/SM PoSt pre-commit preloaded -ProveCommitSector pubsub -Q4 -R2 README reimplemented repo/SM @@ -177,48 +134,36 @@ RLP RocksDB RPC schema/SM -SECP SECP256k1 -SecP256k1 seekable serializable serializer/SM sharded -sidebar_position skippable statediff stateful stateroot/SM stderr stdout -struct/SM subcommand/SM swappiness synchronizer -SyncStateMachine syscall/S -TabItem/SM Tabs TCP -Teardown testnet theme/SM tipset/SM -TipSetBundle tipsetkey/S TOML toolchain/SM trie -truthy -TTY UI/SM uncompress unrepresentable untrusted URL UUID -V0 -V1 validator/S varint vendored @@ -228,13 +173,9 @@ VM/SM VPS VRF wasm -Wasm wasmtime webapp WebSocket WIP -WPoStDisputeWindow -WPoStProvingPeriodDeadlines -WSL2 YugabyteDB zstd diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index f65cb147129e..ba1aebaab262 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -36,9 +36,7 @@ jobs: node-version: 20 package-manager-cache: false - run: corepack enable - - run: make format-spellcheck-dictionary-check - run: yarn --immutable - run: yarn typecheck - - run: yarn spellcheck - run: yarn format-check - run: yarn build diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 306eeeb4f24c..000000000000 --- a/docs/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -SPELLCHECK_DICTIONARY=./dictionary.txt -format-spellcheck-dictionary: - @cat $(SPELLCHECK_DICTIONARY) | sort --ignore-case | uniq > $(SPELLCHECK_DICTIONARY).tmp - @mv $(SPELLCHECK_DICTIONARY).tmp $(SPELLCHECK_DICTIONARY) - -format-spellcheck-dictionary-check: - @cat $(SPELLCHECK_DICTIONARY) | sort --ignore-case | uniq > $(SPELLCHECK_DICTIONARY).tmp - @diff $(SPELLCHECK_DICTIONARY) $(SPELLCHECK_DICTIONARY).tmp - @rm $(SPELLCHECK_DICTIONARY).tmp diff --git a/docs/dictionary.txt b/docs/dictionary.txt deleted file mode 100644 index b40ec51b347f..000000000000 --- a/docs/dictionary.txt +++ /dev/null @@ -1,122 +0,0 @@ -2k -APIs -backend -benchmarking -blockstore -BLS -Butterflynet -Calibnet -calibnet -calibnet-related -cardinality -ChainSafe -chainsafe -ChainSafe's -changelog -CIDs -CLI -cli -Cloudflare -codebase -config -Datacap -datacap -devnet -DevOps -Devs -DHT -DigitalOcean -Drand -enums -Ethereum -F3 -f3 -f3-sidecar -FFI -FIL -fil -FIL-RetroPGF -Filecoin -filecoin-project -Filfox -FilOz -FIP -FIPs -FVM -GC -GiB -Github -Grafana -hardcoded -hotfix -Hypercerts -ie. -Implementers -implementers -io -IPFS -JSON -JSON-RPC -JWT -JWTs -keypair -keystore -Kubernetes -kubernetes -libp2p -Linux -Liveness -liveness -localhost -localhost's -LRU -M1 -M2 -macOS -Mainnet -mainnet -multiaddress -namespace -NetworkEvents -NV22 -NV23 -NV24 -NVMe -onwards -orchestrator -Organisation -P2P -p2p -performant -pre-compiled -preload -preloaded -pubsub -Q4 -README -RNG -Roadmap -roadmap -RPC -rustup -S3-compatible -SecP256k1 -semver -serverless -stateroots -struct -subcommands -swappiness -SyncStateMachine -TabItem -TBD -Terraform -testnet -Tipset -tipset -tipsets -V0 -V1 -VPS -WIP -zstd diff --git a/docs/package.json b/docs/package.json index 482719669307..deab99f97b97 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,6 @@ "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc", - "spellcheck": "spellchecker -f \"./docs/**/*.md\" -l en-US -q -d ./dictionary.txt", "format-check": "prettier --check .", "format": "prettier --write ." }, @@ -35,7 +34,6 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^3.9.2", "@docusaurus/tsconfig": "^3.9.2", - "spellchecker-cli": "^7.0.0", "typescript": "^5.9.3" }, "browserslist": { diff --git a/src/blocks/block.rs b/src/blocks/block.rs index 5f5de480bc14..c0ca52889f9d 100644 --- a/src/blocks/block.rs +++ b/src/blocks/block.rs @@ -8,11 +8,11 @@ use fvm_ipld_encoding::tuple::*; use super::CachingBlockHeader; -/// Limit of BLS and SECP messages combined in a block. +/// Limit of BLS and `SECP` messages combined in a block. pub const BLOCK_MESSAGE_LIMIT: usize = 10000; /// A complete Filecoin block. This contains the block header as well as all BLS -/// and SECP messages. +/// and `SECP` messages. #[derive(Clone, Debug, PartialEq, Eq)] pub struct Block { pub header: CachingBlockHeader, @@ -42,7 +42,7 @@ impl Block { } } -/// Tracks the Merkle roots of both SECP and BLS messages separately. +/// Tracks the Merkle roots of both `SECP` and BLS messages separately. #[derive(Serialize_tuple, Deserialize_tuple)] pub struct TxMeta { pub bls_message_root: Cid, diff --git a/src/blocks/chain4u.rs b/src/blocks/chain4u.rs index 5e7c79b24978..0374a7973b72 100644 --- a/src/blocks/chain4u.rs +++ b/src/blocks/chain4u.rs @@ -478,7 +478,7 @@ impl Override { /// [`Chain4U`] will change [`RawBlockHeader`] fields to create a valid graph of tipsets. /// -/// This struct describes which fields are _allowed_ to change. +/// This `struct` describes which fields are _allowed_ to change. #[derive(Default, Debug, Clone)] pub struct HeaderBuilder { pub miner_address: Override
, diff --git a/src/chain/snapshot_format.rs b/src/chain/snapshot_format.rs index b59c6aa54eff..b65669e755d8 100644 --- a/src/chain/snapshot_format.rs +++ b/src/chain/snapshot_format.rs @@ -50,7 +50,7 @@ pub struct FilecoinSnapshotMetadata { pub version: FilecoinSnapshotVersion, /// Chain head tipset key pub head_tipset_key: NonEmpty, - /// F3 snapshot `CID` + /// `F3` snapshot `CID` pub f3_data: Option, } diff --git a/src/chain/store/chain_store.rs b/src/chain/store/chain_store.rs index 39a01070538c..11b6d7978b34 100644 --- a/src/chain/store/chain_store.rs +++ b/src/chain/store/chain_store.rs @@ -52,7 +52,7 @@ pub enum HeadChange { } /// Stores chain data such as heaviest tipset and cached tipset info at each -/// epoch. This structure is thread-safe, and all caches are wrapped in a mutex +/// epoch. This structure is thread-safe, and all caches are wrapped in a `mutex` /// to allow a consistent `ChainStore` to be shared across tasks. pub struct ChainStore { /// Publisher for head change events @@ -464,7 +464,7 @@ fn filter_lowest_index(values: Vec<(EthHash, Cid, u64, usize)>) -> Vec<(EthHash, .collect() } -/// Returns a Tuple of BLS messages of type `UnsignedMessage` and SECP messages +/// Returns a Tuple of BLS messages of type `UnsignedMessage` and `SECP` messages /// of type `SignedMessage` pub fn block_messages( db: &DB, diff --git a/src/chain_sync/consensus.rs b/src/chain_sync/consensus.rs index d374b4c93595..090f948b5d83 100644 --- a/src/chain_sync/consensus.rs +++ b/src/chain_sync/consensus.rs @@ -4,7 +4,7 @@ use nunny::Vec as NonEmpty; use tokio::task::JoinSet; -/// Helper function to collect errors from async validations. +/// Helper function to collect errors from `async` validations. pub async fn collect_errs( mut handles: JoinSet>, ) -> Result<(), NonEmpty> { diff --git a/src/cid_collections/hash_map.rs b/src/cid_collections/hash_map.rs index 63ef6cdc6b3c..9afb089b8691 100644 --- a/src/cid_collections/hash_map.rs +++ b/src/cid_collections/hash_map.rs @@ -133,7 +133,7 @@ impl CidHashMap { /// A view into a single entry in a map, which may either be vacant or occupied. /// -/// This enum is constructed using [`CidHashMap::entry`]. +/// This `enum` is constructed using [`CidHashMap::entry`]. #[allow(dead_code)] #[derive(Debug)] pub enum Entry<'a, V: 'a> { @@ -144,7 +144,7 @@ pub enum Entry<'a, V: 'a> { } /// A view into an occupied entry in a `HashMap`. -/// It is part of the [`Entry`] enum. +/// It is part of the [`Entry`] `enum`. /// /// See also [`std::collections::hash_map::OccupiedEntry`]. #[allow(dead_code)] @@ -175,7 +175,7 @@ enum OccupiedEntryInner<'a, V> { } /// A view into a vacant entry in a `HashMap`. -/// It is part of the [`Entry`] enum. +/// It is part of the [`Entry`] `enum`. /// /// See also [`std::collections::hash_map::VacantEntry`]. #[allow(dead_code)] diff --git a/src/cid_collections/mod.rs b/src/cid_collections/mod.rs index 85b6dde0c11c..8ba93bb73d8f 100644 --- a/src/cid_collections/mod.rs +++ b/src/cid_collections/mod.rs @@ -28,7 +28,7 @@ pub use small_cid_vec::SmallCidNonEmptyVec; /// assert_eq!(std::mem::size_of::(), 96); /// ``` /// -/// If other types of CID become popular, they should be added to this enum. +/// If other types of CID become popular, they should be added to this `enum`. #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)] enum MaybeCompactedCid { Compact(CidV1DagCborBlake2b256), diff --git a/src/cli/humantoken.rs b/src/cli/humantoken.rs index cdbe27dbe619..919eddab04b7 100644 --- a/src/cli/humantoken.rs +++ b/src/cli/humantoken.rs @@ -135,7 +135,7 @@ mod parse { /// ``` /// /// # Known bugs - /// - `1efil` will not parse as an exa (`10^18`), because we'll try and + /// - `1efil` will not parse as an `exa` (`10^18`), because we'll try and /// parse it as a exponent in the float. Instead use `1 efil`. pub fn parse(input: &str) -> anyhow::Result { let (mut big_decimal, scale) = parse_big_decimal_and_scale(input)?; diff --git a/src/cli/subcommands/f3_cmd.rs b/src/cli/subcommands/f3_cmd.rs index a788202adc95..5f80089c7421 100644 --- a/src/cli/subcommands/f3_cmd.rs +++ b/src/cli/subcommands/f3_cmd.rs @@ -78,32 +78,32 @@ pub enum F3OutputFormat { Json, } -/// Manages Filecoin Fast Finality (F3) interactions +/// Manages Filecoin Fast Finality (`F3`) interactions #[derive(Debug, Subcommand)] pub enum F3Commands { - /// Gets the current manifest used by F3 + /// Gets the current manifest used by `F3` Manifest { /// The output format. #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] output: F3OutputFormat, }, - /// Checks the F3 status. + /// Checks the `F3` status. Status, - /// Manages interactions with F3 finality certificates. + /// Manages interactions with `F3` finality certificates. #[command(subcommand, visible_alias = "c")] Certs(F3CertsCommands), - /// Gets F3 power table at a specific instance ID or latest instance if none is specified. + /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. #[command(subcommand, name = "powertable", visible_alias = "pt")] PowerTable(F3PowerTableCommands), - /// Checks if F3 is in sync. + /// Checks if `F3` is in sync. Ready { - /// Wait until F3 is in sync. + /// Wait until `F3` is in sync. #[arg(long)] wait: bool, - /// The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync. + /// The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync. #[arg(long, default_value_t = 20)] threshold: usize, - /// Exit after F3 making no progress for this duration. + /// Exit after `F3` making no progress for this duration. #[arg(long, default_value = "10m", requires = "wait")] no_progress_timeout: humantime::Duration, }, @@ -146,7 +146,7 @@ impl F3Commands { let is_running = client.call(F3IsRunning::request(())?).await?; if !is_running { - anyhow::bail!("F3 is not running"); + anyhow::bail!("`F3` is not running"); } async fn get_heads( @@ -181,7 +181,7 @@ impl F3Commands { >= chain_head.epoch() { let text = format!( - "[+] F3 is in sync. Chain head epoch: {}, F3 head epoch: {}", + "[+] `F3` is in sync. Chain head epoch: {}, `F3` head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); @@ -190,7 +190,7 @@ impl F3Commands { break; } else { let text = format!( - "[-] F3 is not in sync. Chain head epoch: {}, F3 head epoch: {}", + "[-] `F3` is not in sync. Chain head epoch: {}, `F3` head epoch: {}", chain_head.epoch(), cert_head.chain_head().epoch ); @@ -229,17 +229,17 @@ impl F3Commands { } } -/// Manages interactions with F3 finality certificates. +/// Manages interactions with `F3` finality certificates. #[derive(Debug, Subcommand)] pub enum F3CertsCommands { - /// Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified. + /// Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified. Get { instance: Option, /// The output format. #[arg(long, value_enum, default_value_t = F3OutputFormat::Text)] output: F3OutputFormat, }, - /// Lists a range of F3 finality certificates. + /// Lists a range of `F3` finality certificates. List { /// Inclusive range of `from` and `to` instances in following notation: /// `..`. Either `` or `` may be omitted, but not both. @@ -343,7 +343,7 @@ impl F3CertsCommands { #[derive(Debug, Subcommand)] pub enum F3PowerTableCommands { - /// Gets F3 power table at a specific instance ID or latest instance if none is specified. + /// Gets `F3` power table at a specific instance ID or latest instance if none is specified. #[command(visible_alias = "g")] Get { /// instance ID. (default: latest) diff --git a/src/cli/subcommands/mod.rs b/src/cli/subcommands/mod.rs index bbb39793a7e9..24991471532b 100644 --- a/src/cli/subcommands/mod.rs +++ b/src/cli/subcommands/mod.rs @@ -94,7 +94,7 @@ pub enum Subcommand { #[command(subcommand)] Healthcheck(HealthcheckCommand), - /// Manages Filecoin Fast Finality (F3) interactions + /// Manages Filecoin Fast Finality (`F3`) interactions #[command(subcommand)] F3(F3Commands), diff --git a/src/db/car/any.rs b/src/db/car/any.rs index 1932eb19404e..e592c7f241a7 100644 --- a/src/db/car/any.rs +++ b/src/db/car/any.rs @@ -6,7 +6,7 @@ //! header and the first key-value block, and picks the appropriate block store //! (either [`super::ForestCar`] or [`super::PlainCar`]). //! -//! CARv2 is not supported yet. +//! `CARv2` is not supported yet. use super::{CacheKey, RandomAccessFileReader, ZstdFrameCache}; use crate::blocks::{Tipset, TipsetKey}; diff --git a/src/db/car/forest.rs b/src/db/car/forest.rs index 70ec3d34b20c..9e37f61ad2a4 100644 --- a/src/db/car/forest.rs +++ b/src/db/car/forest.rs @@ -43,7 +43,7 @@ //! //! `zstd` frame format: //! -//! CARv1 specification: +//! `CARv1` specification: //! use super::{CacheKey, ZstdFrameCache}; diff --git a/src/db/car/mod.rs b/src/db/car/mod.rs index 6b74bab81edd..2401436242b2 100644 --- a/src/db/car/mod.rs +++ b/src/db/car/mod.rs @@ -32,7 +32,7 @@ pub type CacheKey = u64; type FrameOffset = u64; -/// According to FRC-0108, v2 snapshots have exactly one root pointing to metadata +/// According to FRC-0108, `v2` snapshots have exactly one root pointing to metadata pub const V2_SNAPSHOT_ROOT_COUNT: usize = 1; pub static ZSTD_FRAME_CACHE_DEFAULT_MAX_SIZE: LazyLock = LazyLock::new(|| { diff --git a/src/db/car/plain.rs b/src/db/car/plain.rs index bc5bec4225db..2af2618311df 100644 --- a/src/db/car/plain.rs +++ b/src/db/car/plain.rs @@ -22,7 +22,7 @@ //! offset =body length //! ``` //! -//! # CARv1 layout and seeking +//! # `CARv1` layout and seeking //! //! The first varint frame is a _header frame_, where the frame body is a [`CarHeader`] encoded //! using [`ipld_dagcbor`](serde_ipld_dagcbor). @@ -57,7 +57,7 @@ //! - Use safe arithmetic for all operations - a malicious frame shouldn't cause a crash. //! - Theoretically, file-backed blockstores should be clonable (or even [`Sync`]) with very low //! overhead, so that multiple threads could perform operations concurrently. -//! - CARv2 support +//! - `CARv2` support //! - A wrapper that abstracts over car formats for reading. use crate::chain::FilecoinSnapshotMetadata; @@ -92,7 +92,7 @@ use tracing::{debug, trace}; /// It can often be time, memory, or disk prohibitive to read large snapshots into a database like /// [`ParityDb`](crate::db::parity_db::ParityDb). /// -/// This is an implementer of [`Blockstore`] that simply wraps an uncompressed [CARv1 +/// This is an implementer of [`Blockstore`] that simply wraps an uncompressed [`CARv1` /// file](https://ipld.io/specs/transport/car/carv1). /// /// On creation, [`PlainCar`] builds an in-memory index of the [`Cid`]s in the file, @@ -374,7 +374,7 @@ fn read_v1_header(mut reader: impl Read) -> io::Result { /// Importantly, we seek `block data length`, rather than read any in. /// This allows us to keep indexing fast. /// -/// [`Ok(None)`] on EOF +/// [`Ok(None)`] on `EOF` #[tracing::instrument(level = "trace", skip_all, ret)] fn read_block_data_location_and_skip( mut reader: impl Read + Seek, @@ -410,7 +410,7 @@ fn read_block_data_location_and_skip( } /// Reads `body length`, leaving the reader at the start of a varint frame, -/// or returns [`Ok(None)`] if we've reached EOF +/// or returns [`Ok(None)`] if we've reached `EOF` /// ```text /// start ►│ /// ├───────────┬─────────────┐ diff --git a/src/eth/eip_1559_transaction.rs b/src/eth/eip_1559_transaction.rs index 5aa6d2c948f9..f1b0c2cd6220 100644 --- a/src/eth/eip_1559_transaction.rs +++ b/src/eth/eip_1559_transaction.rs @@ -133,7 +133,7 @@ impl EthEip1559TxArgs { Ok(stream.out().to_vec()) } - /// Constructs a signed message using EIP-1559 transaction args + /// Constructs a signed message using EIP-1559 transaction `args` pub fn get_signed_message( &self, from: Address, @@ -144,7 +144,7 @@ impl EthEip1559TxArgs { Ok(SignedMessage { message, signature }) } - /// Constructs an unsigned message using EIP-1559 transaction args + /// Constructs an unsigned message using EIP-1559 transaction `args` pub fn get_unsigned_message( &self, from: Address, diff --git a/src/eth/eip_155_transaction.rs b/src/eth/eip_155_transaction.rs index 349267789742..7e38d0152fa4 100644 --- a/src/eth/eip_155_transaction.rs +++ b/src/eth/eip_155_transaction.rs @@ -219,7 +219,7 @@ impl EthLegacyEip155TxArgs { Ok(stream.out().to_vec()) } - /// Constructs a signed message using legacy EIP-155 transaction args + /// Constructs a signed message using legacy EIP-155 transaction `args` pub fn get_signed_message( &self, from: Address, @@ -230,7 +230,7 @@ impl EthLegacyEip155TxArgs { Ok(SignedMessage { message, signature }) } - /// Constructs an unsigned message using legacy EIP-155 transaction args + /// Constructs an unsigned message using legacy EIP-155 transaction `args` pub fn get_unsigned_message( &self, from: Address, @@ -238,7 +238,7 @@ impl EthLegacyEip155TxArgs { ) -> anyhow::Result { ensure!( validate_eip155_chain_id(eth_chain_id, &self.v).is_ok(), - "Failed to validate EIP155 chain Id" + "Failed to validate `EIP155` chain Id" ); let method_info = get_filecoin_method_info(&self.to, &self.input)?; Ok(Message { @@ -269,7 +269,7 @@ impl EthLegacyEip155TxArgsBuilder { } } -/// Validates the EIP155 chain ID by deriving it from the given `v` value +/// Validates the `EIP155` chain ID by deriving it from the given `v` value pub fn validate_eip155_chain_id(eth_chain_id: EthChainId, v: &BigInt) -> anyhow::Result<()> { let derived_chain_id = derive_eip_155_chain_id(v)?; ensure!( @@ -283,7 +283,7 @@ pub fn validate_eip155_chain_id(eth_chain_id: EthChainId, v: &BigInt) -> anyhow: Ok(()) } -/// Derives the EIP155 chain ID from the `V` value +/// Derives the `EIP155` chain ID from the `V` value pub fn derive_eip_155_chain_id(v: &BigInt) -> anyhow::Result { if v.bits() <= 64 { let v = v.to_u64().context("Failed to convert v to u64")?; diff --git a/src/eth/homestead_transaction.rs b/src/eth/homestead_transaction.rs index af41b81e3179..38580d043e4b 100644 --- a/src/eth/homestead_transaction.rs +++ b/src/eth/homestead_transaction.rs @@ -186,14 +186,14 @@ impl EthLegacyHomesteadTxArgs { Ok(stream.out().to_vec()) } - /// Constructs a signed message using legacy homestead transaction args + /// Constructs a signed message using legacy homestead transaction `args` pub fn get_signed_message(&self, from: Address) -> anyhow::Result { let message = self.get_unsigned_message(from)?; let signature = self.signature()?; Ok(SignedMessage { message, signature }) } - /// Constructs an unsigned message using legacy homestead transaction args + /// Constructs an unsigned message using legacy homestead transaction `args` pub fn get_unsigned_message(&self, from: Address) -> anyhow::Result { let method_info = get_filecoin_method_info(&self.to, &self.input)?; Ok(Message { diff --git a/src/f3/mod.rs b/src/f3/mod.rs index 003fbb21016d..f94220187cf2 100644 --- a/src/f3/mod.rs +++ b/src/f3/mod.rs @@ -143,7 +143,7 @@ pub fn import_f3_snapshot( Ok(()) } -/// Whether F3 sidecar via FFI is enabled. +/// Whether `F3` sidecar via FFI is enabled. pub fn is_sidecar_ffi_enabled(chain_config: &ChainConfig) -> bool { // Respect the environment variable when set, and fallback to chain config when not set. let enabled = diff --git a/src/health/endpoints.rs b/src/health/endpoints.rs index 1d1a5f3e57a9..3866b66ab684 100644 --- a/src/health/endpoints.rs +++ b/src/health/endpoints.rs @@ -44,7 +44,7 @@ pub(crate) async fn livez( /// - The node is in sync with the network /// - The current epoch of the node is not too far behind the network /// - The RPC server is running if not disabled -/// - The F3 side car is running if enabled +/// - The `F3` side car is running if enabled /// /// If any of these conditions are not met, the nod is **not** ready to serve requests. pub(crate) async fn readyz( diff --git a/src/libp2p/chain_exchange/message.rs b/src/libp2p/chain_exchange/message.rs index bdd34f1a17c9..19fb7c2b706d 100644 --- a/src/libp2p/chain_exchange/message.rs +++ b/src/libp2p/chain_exchange/message.rs @@ -140,7 +140,7 @@ impl ChainExchangeResponse { .collect() } } -/// Contains all BLS and SECP messages and their indexes per block +/// Contains all BLS and `SECP` messages and their indexes per block #[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)] pub struct CompactedMessages { /// Unsigned BLS messages. @@ -149,7 +149,7 @@ pub struct CompactedMessages { /// if `bls_msg_includes[2] = vec![5]` then `TipsetBundle.blocks[2]` contains `bls_msgs[5]` pub bls_msg_includes: Vec>, - /// Signed SECP messages. + /// Signed `SECP` messages. pub secp_msgs: Vec, /// Describes which block each message belongs to. pub secp_msg_includes: Vec>, diff --git a/src/libp2p/discovery.rs b/src/libp2p/discovery.rs index 0294886a601a..c3c6b89b0cf4 100644 --- a/src/libp2p/discovery.rs +++ b/src/libp2p/discovery.rs @@ -35,7 +35,7 @@ use crate::{networks::GenesisNetworkName, utils::version::FOREST_VERSION_STRING} pub struct DerivedDiscoveryBehaviour { /// Kademlia discovery. kademlia: Toggle>, - /// Kademlia discovery for bootstrapping F3 sidecar when the main Kademlia is disabled. + /// Kademlia discovery for bootstrapping `F3` sidecar when the main Kademlia is disabled. kademlia_f3_sidecar: kad::Behaviour, /// Discovers nodes on the local network. mdns: Toggle, diff --git a/src/libp2p_bitswap/message.rs b/src/libp2p_bitswap/message.rs index cbc2ac3c6489..ca8189c69da1 100644 --- a/src/libp2p_bitswap/message.rs +++ b/src/libp2p_bitswap/message.rs @@ -82,7 +82,7 @@ pub enum BitswapResponse { Block(Vec), } -/// `Bitswap` message Enum type that is either a [`BitswapRequest`] or a +/// `Bitswap` message `Enum` type that is either a [`BitswapRequest`] or a /// [`BitswapResponse`] #[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] pub enum BitswapMessage { diff --git a/src/lotus_json/ipld.rs b/src/lotus_json/ipld.rs index 91a6c68c6ab9..6664943ab456 100644 --- a/src/lotus_json/ipld.rs +++ b/src/lotus_json/ipld.rs @@ -20,7 +20,7 @@ //! //! # Tech debt //! - The real way to do this is to implement [`ipld_core::codec::Codec`] bits appropriately, -//! or embrace using our own struct. +//! or embrace using our own `struct`. use std::{collections::BTreeMap, fmt}; diff --git a/src/lotus_json/mod.rs b/src/lotus_json/mod.rs index 6735a6e653f0..ecf6bc639c6e 100644 --- a/src/lotus_json/mod.rs +++ b/src/lotus_json/mod.rs @@ -32,7 +32,7 @@ //! ``` //! //! In rust, the most common serialization framework is [`serde`]. -//! It has ONE (de)serialization model for each struct - the serialization code _cannot_ know +//! It has ONE (de)serialization model for each `struct` - the serialization code _cannot_ know //! if it's writing JSON or CBOR. //! //! The cleanest way handle the distinction would be a serde-compatible trait: @@ -54,7 +54,7 @@ //! [`macro@serde::Serialize`] and [`macro@serde::Deserialize`] instead? //! //! # Lotus JSON in Forest -//! - Have a struct which represents a domain object: e.g [`GossipBlock`](crate::blocks::GossipBlock). +//! - Have a `struct` which represents a domain object: e.g [`GossipBlock`](crate::blocks::GossipBlock). //! - Implement [`serde::Serialize`] on that object, normally using [`fvm_ipld_encoding::tuple::Serialize_tuple`]. //! This corresponds to the CBOR representation. //! - Implement [`HasLotusJson`] on the domain object. @@ -92,11 +92,11 @@ //! //! If you require access to private fields, consider: //! - implementing an exhaustive helper method, e.g [`crate::beacon::BeaconEntry::into_parts`]. -//! - moving implementation to the module where the struct is defined, e.g [`crate::blocks::tipset::lotus_json`]. +//! - moving implementation to the module where the `struct` is defined, e.g [`crate::blocks::tipset::lotus_json`]. //! If you do this, you MUST manually add snapshot and `quickcheck` tests. //! -//! ### Compound structs -//! - Each field of a struct should be wrapped with [`LotusJson`]. +//! ### Compound `structs` +//! - Each field of a `struct` should be wrapped with [`LotusJson`]. //! - Implementations of [`HasLotusJson::into_lotus_json`] and [`HasLotusJson::from_lotus_json`] //! should use [`Into`] and [`LotusJson::into_inner`] calls //! - Use destructuring to ensure exhaustiveness @@ -119,7 +119,7 @@ //! //! # Future work //! - use [`proptest`](https://docs.rs/proptest/) to test the parser pipeline -//! - use a derive macro for simple compound structs +//! - use a derive macro for simple compound `structs` use crate::shim::actors::miner::DeadlineInfo; use derive_more::From; @@ -134,7 +134,7 @@ use uuid::Uuid; use {pretty_assertions::assert_eq, quickcheck::quickcheck}; pub trait HasLotusJson: Sized { - /// The struct representing JSON. You should `#[derive(Deserialize, Serialize)]` on it. + /// The `struct` representing JSON. You should `#[derive(Deserialize, Serialize)]` on it. type LotusJson: Serialize + DeserializeOwned; /// To ensure code quality, conversion to/from lotus JSON MUST be tested. /// Provide snapshots of the JSON, and the domain type it should serialize to. @@ -471,7 +471,7 @@ pub mod base64_standard { } } -/// MUST NOT be used in any `LotusJson` structs +/// MUST NOT be used in any `LotusJson` `structs` pub fn serialize(value: &T, serializer: S) -> Result where S: Serializer, @@ -480,7 +480,7 @@ where value.clone().into_lotus_json().serialize(serializer) } -/// MUST NOT be used in any `LotusJson` structs. +/// MUST NOT be used in any `LotusJson` `structs`. pub fn deserialize<'de, D, T>(deserializer: D) -> Result where D: Deserializer<'de>, @@ -489,7 +489,7 @@ where Ok(T::from_lotus_json(Deserialize::deserialize(deserializer)?)) } -/// A domain struct that is (de) serialized through its lotus JSON representation. +/// A domain `struct` that is (de) serialized through its lotus JSON representation. #[derive( Debug, Deserialize, From, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Clone, )] diff --git a/src/message/signed_message.rs b/src/message/signed_message.rs index 3e0b3f7624e5..9683eb17e9f2 100644 --- a/src/message/signed_message.rs +++ b/src/message/signed_message.rs @@ -56,7 +56,7 @@ impl SignedMessage { self.signature.signature_type() == SignatureType::Bls } - /// Checks if the signed message is a SECP message. + /// Checks if the signed message is a `SECP` message. pub fn is_secp256k1(&self) -> bool { self.signature.signature_type() == SignatureType::Secp256k1 } diff --git a/src/rpc/channel.rs b/src/rpc/channel.rs index b7d31db0af9c..7a523831be7b 100644 --- a/src/rpc/channel.rs +++ b/src/rpc/channel.rs @@ -100,7 +100,7 @@ pub struct PendingSubscriptionSink { pub(crate) inner: MethodSink, /// `MethodCallback`. pub(crate) method: &'static str, - /// Shared Mutex of subscriptions for this method. + /// Shared `Mutex` of subscriptions for this method. pub(crate) subscribers: Subscribers, /// ID of the `subscription call` (i.e. not the same as subscription id) which is used /// to reply to subscription method call and must only be used once. diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs index dea1ece7f3d5..97539a397efa 100644 --- a/src/rpc/mod.rs +++ b/src/rpc/mod.rs @@ -358,7 +358,7 @@ pub fn collect_rpc_method_info() -> Vec<(&'static str, Permission)> { /// All the methods live in their own folder /// /// # Handling types -/// - If a `struct` or enum is only used in the RPC API, it should live in `src/rpc`. +/// - If a `struct` or `enum` is only used in the RPC API, it should live in `src/rpc`. /// - If it is used in only one API vertical (i.e `auth` or `chain`), then it should live /// in either: /// - `src/rpc/methods/auth.rs` (if there are only a few). diff --git a/src/rpc/reflect/mod.rs b/src/rpc/reflect/mod.rs index f03aac0d342c..21165c8c7bb2 100644 --- a/src/rpc/reflect/mod.rs +++ b/src/rpc/reflect/mod.rs @@ -50,7 +50,7 @@ pub type Ctx = Arc>; /// /// Note, an earlier draft of this trait had an additional type parameter for `Ctx` /// for generality. -/// However, fixing it as [`Ctx<...>`] saves on complexity/confusion for implementors, +/// However, fixing it as [`Ctx<...>`] saves on complexity/confusion for `implementors`, /// at the expense of handler flexibility, which could come back to bite us. /// - All handlers accept the same type. /// - All `Ctx`s must be `Send + Sync + 'static` due to bounds on [`RpcModule`]. diff --git a/src/rpc/types/mod.rs b/src/rpc/types/mod.rs index 6d53a930db23..2c8cecd3e91f 100644 --- a/src/rpc/types/mod.rs +++ b/src/rpc/types/mod.rs @@ -270,7 +270,7 @@ pub struct SectorOnChainInfo { /// sector activation, extension and whenever a sector's `QAP` is changed. This fee is payable for /// the lifetime of the sector and is aggregated in the deadline's `daily_fee` field. /// - /// This field is not included in the serialized form of the struct prior to the activation of + /// This field is not included in the serialized form of the `struct` prior to the activation of /// FIP-0100, and is added as the 16th element of the array after that point only for new sectors /// or sectors that are updated after that point. For old sectors, the value of this field will /// always be zero. diff --git a/src/shim/actors/builtin/miner/mod.rs b/src/shim/actors/builtin/miner/mod.rs index 981fcc451103..5a7590374088 100644 --- a/src/shim/actors/builtin/miner/mod.rs +++ b/src/shim/actors/builtin/miner/mod.rs @@ -1349,11 +1349,11 @@ impl From for SectorOnChainInfo { pub struct DeadlineInfo { /// Epoch at which this info was calculated. pub current_epoch: ChainEpoch, - /// First epoch of the proving period (<= CurrentEpoch). + /// First epoch of the proving period (<= `CurrentEpoch`). pub period_start: ChainEpoch, - /// Current deadline index, in [0..WPoStProvingPeriodDeadlines). + /// Current deadline index, in [0..`WPoStProvingPeriodDeadlines`). pub index: u64, - /// First epoch from which a proof may be submitted (>= CurrentEpoch). + /// First epoch from which a proof may be submitted (>= `CurrentEpoch`). pub open: ChainEpoch, /// First epoch from which a proof may no longer be submitted (>= Open). pub close: ChainEpoch, diff --git a/src/shim/crypto.rs b/src/shim/crypto.rs index 5b1ad4536d59..a449a66b057f 100644 --- a/src/shim/crypto.rs +++ b/src/shim/crypto.rs @@ -81,7 +81,7 @@ impl Signature { } } - /// Creates a SECP Signature given the raw bytes. + /// Creates a `SECP` Signature given the raw bytes. pub fn new_secp256k1(bytes: Vec) -> Self { Self { sig_type: SignatureType::Secp256k1, @@ -135,7 +135,7 @@ impl Signature { /// Authenticates the message signature using protocol-specific validation: /// - Delegated: Uses the Ethereum message with RLP encoding for signature verification, Verifies message roundtrip integrity - /// - BLS/SECP: Standard signature verification + /// - BLS/`SECP`: Standard signature verification pub fn authenticate_msg( &self, eth_chain_id: EthChainId, diff --git a/src/shim/version.rs b/src/shim/version.rs index 1c33782f4442..7fd94683348d 100644 --- a/src/shim/version.rs +++ b/src/shim/version.rs @@ -39,7 +39,7 @@ pub struct NetworkVersion(#[schemars(with = "u32")] pub NetworkVersion_latest); lotus_json_with_self!(NetworkVersion); -/// Defines public constants V0, V1, ... for [`NetworkVersion`]. +/// Defines public constants `V0`, `V1`, ... for [`NetworkVersion`]. /// Each constant is mapped to the corresponding [`NetworkVersion_latest`] variant. macro_rules! define_network_versions { ($($version:literal),+ $(,)?) => { diff --git a/src/tool/subcommands/api_cmd.rs b/src/tool/subcommands/api_cmd.rs index 8187f8c03536..40275ca4191d 100644 --- a/src/tool/subcommands/api_cmd.rs +++ b/src/tool/subcommands/api_cmd.rs @@ -219,7 +219,7 @@ pub enum ApiCommands { /// that rely on internal state. /// /// Inputs: - /// - `--to`, `--from`: delegated Filecoin (f4) addresses + /// - `--to`, `--from`: delegated Filecoin (`f4`) addresses /// - `--payload`: calldata in hex (accepts optional `0x` prefix) /// - `--topic`: `32‑byte` event topic in hex /// - `--filter`: run only tests that interact with a specific RPC method @@ -237,10 +237,10 @@ pub enum ApiCommands { /// test result: ok. 7 passed; 0 failed; 0 ignored; 0 filtered out /// ``` TestStateful { - /// Test Transaction `to` address (delegated f4) + /// Test Transaction `to` address (delegated `f4`) #[arg(long)] to: Address, - /// Test Transaction `from` address (delegated f4) + /// Test Transaction `from` address (delegated `f4`) #[arg(long)] from: Address, /// Test Transaction hex `payload` diff --git a/src/tool/subcommands/api_cmd/stateful_tests.rs b/src/tool/subcommands/api_cmd/stateful_tests.rs index 874df6a47977..242c249a175b 100644 --- a/src/tool/subcommands/api_cmd/stateful_tests.rs +++ b/src/tool/subcommands/api_cmd/stateful_tests.rs @@ -43,7 +43,7 @@ pub struct RpcTestScenario { } impl RpcTestScenario { - /// Create a basic scenario from a simple async closure. + /// Create a basic scenario from a simple `async` closure. pub fn basic(run_fn: F) -> Self where F: Fn(Arc) -> Fut + Send + Sync + 'static, diff --git a/src/tool/subcommands/archive_cmd.rs b/src/tool/subcommands/archive_cmd.rs index 1d3dd668ff5d..d39ffae72a0c 100644 --- a/src/tool/subcommands/archive_cmd.rs +++ b/src/tool/subcommands/archive_cmd.rs @@ -98,9 +98,9 @@ pub enum ArchiveCommands { /// Path to an archive (`.car` or `.car.zst`). snapshot: PathBuf, }, - /// Show FRC-0108 header of a standalone F3 snapshot. + /// Show FRC-0108 header of a standalone `F3` snapshot. F3Header { - /// Path to a standalone F3 snapshot. + /// Path to a standalone `F3` snapshot. snapshot: PathBuf, }, /// Trim a snapshot of the chain and write it to `` @@ -150,12 +150,12 @@ pub enum ArchiveCommands { #[arg(long, default_value_t = false)] force: bool, }, - /// Merge a `v1` Filecoin snapshot with an F3 snapshot into a `v2` Filecoin snapshot in `.forest.car.zst` format + /// Merge a `v1` Filecoin snapshot with an `F3` snapshot into a `v2` Filecoin snapshot in `.forest.car.zst` format MergeF3 { /// Path to the `v1` Filecoin snapshot #[arg(long = "v1")] filecoin_v1: PathBuf, - /// Path to the F3 snapshot + /// Path to the `F3` snapshot #[arg(long)] f3: PathBuf, /// Path to the snapshot output file in `.forest.car.zst` format diff --git a/src/utils/db/car_stream.rs b/src/utils/db/car_stream.rs index 579dc2aca351..cbfd41fbd634 100644 --- a/src/utils/db/car_stream.rs +++ b/src/utils/db/car_stream.rs @@ -114,7 +114,7 @@ impl CarBlockWrite for T { pin_project! { /// Stream of CAR blocks. If the input data is compressed with zstd, it will /// automatically be decompressed. - /// Note that [`CarStream`] automatically skips the metadata block and F3 data + /// Note that [`CarStream`] automatically skips the metadata block and `F3` data /// block defined in [`FRC-0108`](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0108.md) pub struct CarStream { #[pin] @@ -133,13 +133,13 @@ fn is_zstd(buf: &[u8]) -> bool { } impl CarStream { - /// Create a stream with automatic but unsafe CARv2 header extraction. + /// Create a stream with automatic but unsafe `CARv2` header extraction. /// - /// Note that if the input is zstd compressed, the CARv2 header extraction + /// Note that if the input is zstd compressed, the `CARv2` header extraction /// is on a best efforts basis. It could fail when `reader.fill_buf()` is insufficient - /// for decoding the first zstd frame, and treat input as CARv1, because this method + /// for decoding the first zstd frame, and treat input as `CARv1`, because this method /// does not require the input to be [`tokio::io::AsyncSeek`]. - /// It's recommended to use [`CarStream::new`] for zstd compressed CARv2 input. + /// It's recommended to use [`CarStream::new`] for zstd compressed `CARv2` input. #[allow(dead_code)] pub async fn new_unsafe(mut reader: ReaderT) -> io::Result { let header_v2 = Self::try_decode_header_v2_from_fill_buf(reader.fill_buf().await?) @@ -149,7 +149,7 @@ impl CarStream { Self::new_with_header_v2(reader, header_v2).await } - /// Create a stream with pre-extracted CARv2 header + /// Create a stream with pre-extracted `CARv2` header pub async fn new_with_header_v2( mut reader: ReaderT, header_v2: Option, @@ -237,7 +237,7 @@ impl CarStream { } } - /// Extracts CARv2 header from the input, returns the reader and CARv2 header. + /// Extracts `CARv2` header from the input, returns the reader and `CARv2` header. /// /// Note that position of the input reader has to be reset before calling [`CarStream::new_with_header_v2`]. /// Use [`CarStream::extract_header_v2_and_reset_reader_position`] to automatically reset stream position. @@ -274,13 +274,13 @@ impl CarStream { } impl CarStream { - /// Create a stream with automatic CARv2 header extraction. + /// Create a stream with automatic `CARv2` header extraction. pub async fn new(reader: ReaderT) -> io::Result { let (reader, header_v2) = Self::extract_header_v2_and_reset_reader_position(reader).await?; Self::new_with_header_v2(reader, header_v2).await } - /// Extracts CARv2 header from the input, resets the reader position and returns the reader and CARv2 header. + /// Extracts `CARv2` header from the input, resets the reader position and returns the reader and `CARv2` header. pub async fn extract_header_v2_and_reset_reader_position( mut reader: ReaderT, ) -> io::Result<(ReaderT, Option)> { diff --git a/src/utils/io/progress_log.rs b/src/utils/io/progress_log.rs index fab0b3b68ce6..1eeb2561c2cd 100644 --- a/src/utils/io/progress_log.rs +++ b/src/utils/io/progress_log.rs @@ -6,14 +6,14 @@ //! Previously we used progress bars thanks to the [`indicatif`](https://crates.io/crates/indicatif) library but we had a few issues with them: //! - They behaved poorly together with regular logging //! - They were too verbose and printed even for very small tasks (less than 5 seconds) -//! - They were only used when connected to a TTY and not written in log files +//! - They were only used when connected to a `TTY` and not written in log files //! //! This lead us to develop our own logging code. //! This module provides two new types for logging progress that are [`WithProgress`] and [`WithProgressRaw`]. //! The main goal of [`WithProgressRaw`] is to maintain a similar API to the previous one from progress bar so we could remove the [`indicatif`](https://crates.io/crates/indicatif) dependency, //! but, gradually, we would like to move to something better and use the [`WithProgress`] type. //! The [`WithProgress`] type will provide a way to wrap user code while handling logging presentation details. -//! [`WithProgress`] is a wrapper that should extend to Iterators, Streams, Read/Write types. Right now it only wraps async reads. +//! [`WithProgress`] is a wrapper that should extend to Iterators, Streams, Read/Write types. Right now it only wraps `async` reads. //! //! # Example //! ``` diff --git a/src/utils/io/writer_checksum.rs b/src/utils/io/writer_checksum.rs index d13952877d29..66408348acab 100644 --- a/src/utils/io/writer_checksum.rs +++ b/src/utils/io/writer_checksum.rs @@ -19,7 +19,7 @@ pin_project! { /// Trait marking the object that is collecting a kind of a checksum. pub trait Checksum { - /// Return the checksum and resets the internal hasher. + /// Return the checksum and resets the internal `hasher`. fn finalize(&mut self) -> std::io::Result>>; } diff --git a/src/utils/misc/env.rs b/src/utils/misc/env.rs index 588723e529e2..f3a0b15dd872 100644 --- a/src/utils/misc/env.rs +++ b/src/utils/misc/env.rs @@ -12,13 +12,13 @@ pub fn env_or_default(key: &str, default: T) -> T { .unwrap_or(default) } -/// Check if the given environment variable is set to truthy value. +/// Check if the given environment variable is set to `truthy` value. /// Returns false if not set. pub fn is_env_truthy(env: &str) -> bool { is_env_set_and_truthy(env).unwrap_or_default() } -/// Check if the given environment variable is set to truthy value. +/// Check if the given environment variable is set to `truthy` value. /// Returns None if not set. pub fn is_env_set_and_truthy(env: &str) -> Option { std::env::var(env) diff --git a/src/utils/multihash.rs b/src/utils/multihash.rs index d2f613f8528f..b5bd293704e9 100644 --- a/src/utils/multihash.rs +++ b/src/utils/multihash.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0, MIT //! -//! This module back-fills the Identify hasher and code that was removed in `multihash` crate. +//! This module back-fills the Identify `hasher` and code that was removed in `multihash` crate. //! See //! and //! @@ -176,7 +176,7 @@ impl MultihashCode { } } -/// Identity hasher with a maximum size. +/// Identity `hasher` with a maximum size. /// /// # Panics /// diff --git a/src/utils/proofs_api/paramfetch.rs b/src/utils/proofs_api/paramfetch.rs index a43240636c6a..3f08cd600c42 100644 --- a/src/utils/proofs_api/paramfetch.rs +++ b/src/utils/proofs_api/paramfetch.rs @@ -1,7 +1,7 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT //! This module contains the logic for fetching the proofs parameters from the network. -//! As a general rule, the parameters are first fetched from ChainSafe's Cloudflare R2 bucket, if +//! As a general rule, the parameters are first fetched from ChainSafe's Cloudflare `R2` bucket, if //! that fails (or is overridden by [`PROOFS_ONLY_IPFS_GATEWAY_ENV`]), the IPFS gateway is used as a fallback. //! //! The reason for this is that the IPFS gateway is not as reliable and performant as the centralized solution, which contributed to @@ -34,7 +34,7 @@ use super::parameters::{ /// Default IPFS gateway to use for fetching parameters. /// Set via the [`IPFS_GATEWAY_ENV`] environment variable. const DEFAULT_IPFS_GATEWAY: &str = "https://proofs.filecoin.io/ipfs/"; -/// Domain bound to the Cloudflare R2 bucket. +/// Domain bound to the Cloudflare `R2` bucket. const CLOUDFLARE_PROOF_PARAMETER_DOMAIN: &str = "filecoin-proof-parameters.chainsafe.dev"; /// If set to 1, enforce using the IPFS gateway for fetching parameters. @@ -171,9 +171,9 @@ async fn fetch_params_ipfs_gateway(path: &Path, info: &ParameterData) -> anyhow: result } -/// Downloads the parameter file from Cloudflare R2 to the given path. It wraps the [`download_from_cloudflare`] function with a retry and timeout mechanisms. +/// Downloads the parameter file from Cloudflare `R2` to the given path. It wraps the [`download_from_cloudflare`] function with a retry and timeout mechanisms. async fn fetch_params_cloudflare(name: &str, path: &Path) -> anyhow::Result<()> { - info!("Fetching param file {name} from Cloudflare R2 {CLOUDFLARE_PROOF_PARAMETER_DOMAIN}"); + info!("Fetching param file {name} from Cloudflare `R2` {CLOUDFLARE_PROOF_PARAMETER_DOMAIN}"); let result = (|| download_from_cloudflare(name, path)) .retry(ExponentialBuilder::default()) .notify(|err, dur| { @@ -190,7 +190,7 @@ async fn fetch_params_cloudflare(name: &str, path: &Path) -> anyhow::Result<()> result } -/// Downloads the parameter file from Cloudflare R2 to the given path. In case of an error, +/// Downloads the parameter file from Cloudflare `R2` to the given path. In case of an error, /// the file is not written to the final path to avoid corrupted files. async fn download_from_cloudflare(name: &str, path: &Path) -> anyhow::Result<()> { let response = global_http_client() From 85d4f607cbfac41fdb864534f013730a6bbea276 Mon Sep 17 00:00:00 2001 From: signor1 Date: Sat, 15 Nov 2025 22:31:31 +0100 Subject: [PATCH 33/34] fix: complete spellcheck cleanup for markdown files and config --- .config/spellcheck.toml | 27 ++++++++++-- .github/CARGO_ADVISORIES_ISSUE_TEMPLATE.md | 2 +- .github/DOCKER_ISSUE_TEMPLATE.md | 2 +- .github/INTEGRATION_TESTS_ISSUE_TEMPLATE.md | 2 +- .github/ISSUE_TEMPLATE/6-network-upgrade.md | 4 +- .github/RPC_PARITY_ISSUE_TEMPLATE.md | 2 +- .github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md | 2 +- .../developers/deep_dives/chain_follower.md | 32 +++++++------- .../developers/guides/network_upgrades.md | 8 ++-- docs/docs/users/getting_started/install.md | 2 +- .../users/guides/monitoring/health_checks.md | 10 ++--- docs/docs/users/guides/monitoring/metrics.md | 2 +- docs/docs/users/knowledge_base/docker_tips.md | 4 +- .../network_upgrades_state_migrations.md | 6 +-- docs/docs/users/reference/cli.md | 42 +++++++++---------- docs/docs/users/reference/env_variables.md | 26 ++++++------ docs/docs/users/reference/json_rpc.mdx | 2 +- .../docs/users/reference/json_rpc_overview.md | 6 +-- f3-sidecar/README.md | 16 +++---- scripts/tests/bootstrapper/README.md | 2 +- 20 files changed, 110 insertions(+), 89 deletions(-) diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index 8ffe1c5164cc..e6af131f888a 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -15,21 +15,42 @@ transform_regex = [ "^[0-9_]+(?:\\.[0-9]*)?%$", # Template variables like {{ env.WORKFLOW_URL }} or {{ date | date('D/M/YY HH:mm') }} "\\{\\{.*?\\}\\}", + # Domain names ending in .io (including in markdown links) + "^[A-Za-z0-9.-]+\\.io$", + "\\.io$", # Double braces "^\\{\\{$", "^\\}\\}$", - # YAML frontmatter keys like sidebar_position - "^(title|description|sidebar_position|author|authors|date|tags?):.*$", + # YAML frontmatter - skip underscore_words common in config + "^[a-z]+_[a-z]+.*$", # Numbers with underscores like 30_000 "^[0-9_]+$", # Plus signs and other operators "^[+\\-*/=]+$", # Tilde symbol "^~+$", - # Import statements like @theme/Tabs + # Import statements like @theme/Tabs, TabItem "@theme/.*", + "^TabItem$", # Emoji sequences (literal emojis) "^[🌲🪷🐳❤️🐋⚠️]+$", + # Network versions and test networks + "^NV[0-9X]+$", + "^[0-9]+k$", + # File extensions in names + "^[a-z_]+\\.yaml$", + "^[a-z_]+\\.yml$", + "\\.yaml$", + "\\.yml$", + # Date format parts in templates + "^YY$", + "^HH$", + "^mm$", + # File extension standalone tokens + "^yaml$", + "^yml$", + # Domain TLD standalone tokens + "^io$", ] allow_concatenation = false allow_dashes = false diff --git a/.github/CARGO_ADVISORIES_ISSUE_TEMPLATE.md b/.github/CARGO_ADVISORIES_ISSUE_TEMPLATE.md index 5da859ce91d0..5fff099ec53f 100644 --- a/.github/CARGO_ADVISORIES_ISSUE_TEMPLATE.md +++ b/.github/CARGO_ADVISORIES_ISSUE_TEMPLATE.md @@ -5,4 +5,4 @@ labels: ["Bug"] ## Description -Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. +Please [check the logs]({{ `env.WORKFLOW_URL` }}) for more information. diff --git a/.github/DOCKER_ISSUE_TEMPLATE.md b/.github/DOCKER_ISSUE_TEMPLATE.md index a2943b028944..4141c34dec02 100644 --- a/.github/DOCKER_ISSUE_TEMPLATE.md +++ b/.github/DOCKER_ISSUE_TEMPLATE.md @@ -5,4 +5,4 @@ labels: ["Bug"] ## Description -Latest Docker check failed. Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. +Latest Docker check failed. Please [check the logs]({{ `env.WORKFLOW_URL` }}) for more information. diff --git a/.github/INTEGRATION_TESTS_ISSUE_TEMPLATE.md b/.github/INTEGRATION_TESTS_ISSUE_TEMPLATE.md index 6588f4587dc1..55fcf4867227 100644 --- a/.github/INTEGRATION_TESTS_ISSUE_TEMPLATE.md +++ b/.github/INTEGRATION_TESTS_ISSUE_TEMPLATE.md @@ -5,4 +5,4 @@ labels: ["Bug"] ## Description -Integration tests failed. Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. +Integration tests failed. Please [check the logs]({{ `env.WORKFLOW_URL` }}) for more information. diff --git a/.github/ISSUE_TEMPLATE/6-network-upgrade.md b/.github/ISSUE_TEMPLATE/6-network-upgrade.md index 6025da16f37a..2b91852618af 100644 --- a/.github/ISSUE_TEMPLATE/6-network-upgrade.md +++ b/.github/ISSUE_TEMPLATE/6-network-upgrade.md @@ -5,9 +5,9 @@ title: "NVXX Tracking" labels: "Type: Epic" --- - + -# Tracking issue for the NVXX network upgrade +# Tracking issue for the `NVXX` network upgrade diff --git a/.github/RPC_PARITY_ISSUE_TEMPLATE.md b/.github/RPC_PARITY_ISSUE_TEMPLATE.md index cbff9a8bbb32..67b7a04298c8 100644 --- a/.github/RPC_PARITY_ISSUE_TEMPLATE.md +++ b/.github/RPC_PARITY_ISSUE_TEMPLATE.md @@ -5,4 +5,4 @@ labels: ["Bug"] ## Description -Latest RPC parity test failed. Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. +Latest RPC parity test failed. Please [check the logs]({{ `env.WORKFLOW_URL` }}) for more information. diff --git a/.github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md b/.github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md index f1e3f59f6b66..5bdc83725dbf 100644 --- a/.github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md +++ b/.github/SNAPSHOT_PARITY_ISSUE_TEMPLATE.md @@ -5,4 +5,4 @@ labels: ["Bug"] ## Description -Latest snapshot parity test failed. Please [check the logs]({{ env.WORKFLOW_URL }}) for more information. +Latest snapshot parity test failed. Please [check the logs]({{ `env.WORKFLOW_URL` }}) for more information. diff --git a/docs/docs/developers/deep_dives/chain_follower.md b/docs/docs/developers/deep_dives/chain_follower.md index 98bd799a987c..5f85ef9387d2 100644 --- a/docs/docs/developers/deep_dives/chain_follower.md +++ b/docs/docs/developers/deep_dives/chain_follower.md @@ -11,9 +11,9 @@ The `ChainFollower` is the orchestrator of the chain synchronization process in - Managing a pool of candidate tipsets that are potential heads of the chain. - Scheduling tasks to either fetch missing parent tipsets or validate tipsets whose parents are already known. - Executing intensive validation logic to ensure the integrity of each block and its messages. -- Updating the `ChainStore` struct with newly validated tipsets, which may involve changing the node's view of the heaviest chain (the "head"). +- Updating the `ChainStore` `struct` with newly validated tipsets, which may involve changing the node's view of the heaviest chain (the "head"). -This entire process is managed by a state machine within the [chain_follower.rs](https://github.com/ChainSafe/forest/blob/main/src/chain_sync/chain_follower.rs) module, ensuring that tipsets are processed in the correct order and that the node can handle multiple competing forks simultaneously. +This entire process is managed by a state machine within the [`chain_follower.rs`](https://github.com/ChainSafe/forest/blob/main/src/chain_sync/chain_follower.rs) module, ensuring that tipsets are processed in the correct order and that the node can handle multiple competing forks simultaneously. ## Visual Workflow @@ -79,11 +79,11 @@ graph TD ## `ChainFollower` Working -The `ChainFollower` struct spawns 4 concurrent tasks to sync the chain and track its progress: +The `ChainFollower` `struct` spawns 4 concurrent tasks to sync the chain and track its progress: -1. **Forward tipsets from peers to the SyncStateMachine**: Listens for [NetworkEvents](https://github.com/ChainSafe/forest/blob/main/src/libp2p/service.rs), processes incoming blocks from gossip, fetches the `FullTipset` if necessary, and submits it to the state machine. +1. **Forward tipsets from peers to the `SyncStateMachine`**: Listens for [`NetworkEvents`](https://github.com/ChainSafe/forest/blob/main/src/libp2p/service.rs), processes incoming blocks from gossip, fetches the `FullTipset` if necessary, and submits it to the state machine. 2. **Forward tipsets from miners to the `SyncStateMachine`**: Listens on a dedicated channel for locally-produced tipsets submitted via the API. -3. **Execute `SyncStateMachine` tasks**: Manages the main event loop, taking tasks generated by the `SyncStateMachine` struct (like fetching or validating) and spawning them for execution. It also updates the node's overall sync status. +3. **Execute `SyncStateMachine` tasks**: Manages the main event loop, taking tasks generated by the `SyncStateMachine` `struct` (like fetching or validating) and spawning them for execution. It also updates the node's overall sync status. 4. **Periodically report sync progress**: Logs the current sync status at regular intervals, providing visibility into how far behind the network head the node is. ## Details of `ChainFollower` working @@ -94,23 +94,23 @@ New tipsets are introduced to the `ChainFollower` from two main sources: - **P2P Network (Gossip):** - **File:** `src/libp2p/service.rs` - - **Flow:** Forest nodes listen on the `/fil/blocks` pubsub topic. When a peer broadcasts a new block, the `Libp2pService` struct receives it in the `handle_gossip_event` function. This event is just for a single block's CID. The `ChainFollower` receives this `NetworkEvent::PubsubMessage` and realizes it needs the full block and its sibling blocks to form a `FullTipset`. It then issues a "chain exchange" request to the network using the `chain_exchange_fts` method of the `SyncNetworkContext` struct (present in `src/chain_sync/network_context.rs`). This is a direct request to a peer to provide the `FullTipset` corresponding to the block's tipset key. + - **Flow:** Forest nodes listen on the `/fil/blocks` pubsub topic. When a peer broadcasts a new block, the `Libp2pService` `struct` receives it in the `handle_gossip_event` function. This event is just for a single block's CID. The `ChainFollower` receives this `NetworkEvent::PubsubMessage` and realizes it needs the full block and its sibling blocks to form a `FullTipset`. It then issues a "chain exchange" request to the network using the `chain_exchange_fts` method of the `SyncNetworkContext` `struct` (present in `src/chain_sync/network_context.rs`). This is a direct request to a peer to provide the `FullTipset` corresponding to the block's tipset key. - **Local Miner:** - A connected miner can submit a newly created `FullTipset` directly to the `ChainFollower` through the `tipset_sender` channel field. This bypasses the network fetching step. ### The `SyncStateMachine` -Once a `FullTipset` struct is acquired, it's handed over to the `SyncStateMachine` struct. This is the core of the chain follower, managing all candidate tipsets and deciding what to do next. +Once a `FullTipset` `struct` is acquired, it's handed over to the `SyncStateMachine` `struct`. This is the core of the chain follower, managing all candidate tipsets and deciding what to do next. - **State:** The state machine maintains a `tipsets` field (a `HashMap`) of all tipsets it is currently aware of but has not yet fully validated. -- **`SyncEvent` enum:** The state machine is driven by `SyncEvent` variants: +- **`SyncEvent` `enum`:** The state machine is driven by `SyncEvent` variants: - `NewFullTipsets`: Triggered when a new tipset is discovered. The state machine adds it to its internal `tipsets` map to be processed. - `BadTipset`: Triggered when a tipset fails validation. The state machine will remove it and all its descendants from its internal map. - `ValidatedTipset`: Triggered when a tipset successfully passes validation. The state machine removes it from its map and commits it to the `ChainStore`. -- **`SyncTask` Generation:** The `tasks()` method of the `SyncStateMachine` is its heart. It iterates through the known tipsets, builds out the potential fork chains, and generates the next set of actions (`SyncTask` enums) required to make progress. +- **`SyncTask` Generation:** The `tasks()` method of the `SyncStateMachine` is its heart. It iterates through the known tipsets, builds out the potential fork chains, and generates the next set of actions (`SyncTask` `enums`) required to make progress. - If a tipsets parent is present in the `ChainStore` (meaning it's already validated), a `SyncTask::ValidateTipset` task is created. - If a tipsets parent is not in the `ChainStore`, a `SyncTask::FetchTipset` task is created for the missing parent. This recursive fetching is the important mechanism that allows Forest to sync the chain by walking backward from a given head. @@ -118,31 +118,31 @@ Once a `FullTipset` struct is acquired, it's handed over to the `SyncStateMachin When a `SyncTask::ValidateTipset` task is executed, it kicks off a comprehensive validation process defined in the `validate_block` function in `src/chain_sync/tipset_syncer.rs`. This is the most computationally intensive part of chain synchronization. For each `Block` in the `FullTipset`, the following checks are performed in parallel: -1. **Parent Tipset State Execution**: This is the most critical step. The `StateManager` struct loads the parent tipset and re-executes all of its messages to compute the final state root and message receipt root. These computed roots are compared against the `state_root` and `message_receipts` fields in the current block's header. A mismatch indicates an invalid state transition, and the block is rejected. +1. **Parent Tipset State Execution**: This is the most critical step. The `StateManager` `struct` loads the parent tipset and re-executes all of its messages to compute the final state root and message receipt root. These computed roots are compared against the `state_root` and `message_receipts` fields in the current block's header. A mismatch indicates an invalid state transition, and the block is rejected. 2. **Message Validation**: The `check_block_messages` function performs several checks: - The aggregate BLS signature for all BLS messages in the block is verified. - - The individual signature of every SecP256k1 message is verified against the sender's key. + - The individual signature of every `SecP256k1` message is verified against the sender's key. - The `nonce` (sequence number) of each message is checked against the sender's current nonce in the parent state. - The `gas_limit` of all messages is summed to ensure it does not exceed the `BLOCK_GAS_LIMIT`. - - The message root (`TxMeta` struct) is re-computed from all messages and compared to the `messages` CID in the block header. + - The message root (`TxMeta` `struct`) is re-computed from all messages and compared to the `messages` CID in the block header. 3. **Block Signature Verification**: The block header's `signature` is verified to ensure it was signed by the declared `miner_address`. -4. **Consensus Validation**: The `validate_block` method of the `FilecoinConsensus` struct is called to verify consensus-specific rules, primarily the `ElectionProof`. +4. **Consensus Validation**: The `validate_block` method of the `FilecoinConsensus` `struct` is called to verify consensus-specific rules, primarily the `ElectionProof`. ### Handling Bad Blocks When the `SyncStateMachine` receives a `SyncEvent::BadTipset` event, it takes two important actions to protect the node: -1. **Cache the Bad Block:** It adds the CID of every block in the failed tipset to the `BadBlockCache` struct. This is an LRU cache that prevents the node from wasting resources by re-fetching or re-validating a block that is already known to be invalid. (`src/chain_sync/bad_block_cache.rs`) +1. **Cache the Bad Block:** It adds the CID of every block in the failed tipset to the `BadBlockCache` `struct`. This is an LRU cache that prevents the node from wasting resources by re-fetching or re-validating a block that is already known to be invalid. (`src/chain_sync/bad_block_cache.rs`) 2. **Prune Descendants:** It traverses its internal map of tipsets and removes all known descendants of the bad tipset. Since a child of an invalid block is also invalid, this prunes entire invalid forks from the processing queue. ### Committing to the Chain If a tipset and all its blocks pass validation, a `SyncEvent::ValidatedTipset` event is sent to the `SyncStateMachine`, which triggers the final step of committing it to the local chain. (`src/chain/store/chain_store.rs`) -1. **Store the Tipset**: The `SyncStateMachine` calls the `put_tipset` method on the `ChainStore` struct. -2. **Expand the Tipset**: The `put_tipset` method first calls the `expand_tipset` method, which checks the `TipsetTracker` struct for any other valid blocks at the same epoch with the same parents. This merges them into a single, more complete tipset, making the view of the head more robust. +1. **Store the Tipset**: The `SyncStateMachine` calls the `put_tipset` method on the `ChainStore` `struct`. +2. **Expand the Tipset**: The `put_tipset` method first calls the `expand_tipset` method, which checks the `TipsetTracker` `struct` for any other valid blocks at the same epoch with the same parents. This merges them into a single, more complete tipset, making the view of the head more robust. 3. **Update the Head**: The new, expanded tipsets weight is compared to the current head's weight in the `update_heaviest` method. If it's heavier, the `set_heaviest_tipset` method of the `ChainStore` is invoked. 4. **Broadcast Head Change**: The `set_heaviest_tipset` method updates the head in the database and broadcasts a `HeadChange::Apply` event. This notification is critical, as it allows other Forest subsystems like the Message Pool and RPC API to update their own state based on the new head of the chain. diff --git a/docs/docs/developers/guides/network_upgrades.md b/docs/docs/developers/guides/network_upgrades.md index 021be7ea2f0c..2d4a9b416cf6 100644 --- a/docs/docs/developers/guides/network_upgrades.md +++ b/docs/docs/developers/guides/network_upgrades.md @@ -13,7 +13,7 @@ The network upgrades rough schedule is published in [Filecoin Core Devs discussi ### Network upgrade scope -The network upgrades scope is published in the [Filecoin Core Devs discussions](https://github.com/filecoin-project/core-devs/discussions) (see the [NV23 scope](https://github.com/filecoin-project/core-devs/discussions/149)). The scope includes the changes in the Filecoin protocol in the form of accepted FIPs. +The network upgrades scope is published in the [Filecoin Core Devs discussions](https://github.com/filecoin-project/core-devs/discussions) (see the [`NV23` scope](https://github.com/filecoin-project/core-devs/discussions/149)). The scope includes the changes in the Filecoin protocol in the form of accepted FIPs. Some FIPs require changes in the FVM, some (most) in the Builtin Actors, and some in the Forest. Additionally, some changes require state migrations, which may not be trivial to implement and require significant computing resources. @@ -37,7 +37,7 @@ graph TD #### Skeleton with base migration -This provides the base for the state migrations and network-aware node changes. See the sample PR for NV24 [here](https://github.com/ChainSafe/forest/pull/4819). +This provides the base for the state migrations and network-aware node changes. See the sample PR for `NV24` [here](https://github.com/ChainSafe/forest/pull/4819). #### State migrations @@ -61,7 +61,7 @@ The `fil-actor-states` repository is updated to the latest bundle release. The c Some changes are required in the Forest itself but outside migrations. These changes are usually related to the network upgrade itself, e.g., changes in the block validation rules. -#### 2k network testing +#### `2k` network testing The changes are tested locally on the devnet with a Lotus RC and a `builtin-actors` bundle RC. @@ -118,7 +118,7 @@ The most crucial part of the network upgrade is coordinating with other Filecoin We communicate the network upgrades via the following channels: -- [Forest Discussions](https://github.com/ChainSafe/forest/discussions). See the [NV23 announcement](https://github.com/ChainSafe/forest/discussions/4488) for an example. +- [Forest Discussions](https://github.com/ChainSafe/forest/discussions). See the [`NV23` announcement](https://github.com/ChainSafe/forest/discussions/4488) for an example. - The `#fil-forest-announcements` channel in the Filecoin Slack. ## Network upgrade monitoring diff --git a/docs/docs/users/getting_started/install.md b/docs/docs/users/getting_started/install.md index e25f2d17606c..846590d3dfd3 100644 --- a/docs/docs/users/getting_started/install.md +++ b/docs/docs/users/getting_started/install.md @@ -77,7 +77,7 @@ More information about Docker setup and usage can be found in the [Docker docume - Rust compiler (install via [rustup](https://rustup.rs/)) - OS `Base-Devel`/`Build-Essential` - Clang compiler -- Go for building F3 sidecar module +- Go for building `F3` sidecar module For Ubuntu, you can install the dependencies (excluding Rust) with: diff --git a/docs/docs/users/guides/monitoring/health_checks.md b/docs/docs/users/guides/monitoring/health_checks.md index d308c889fba3..17194ac58d32 100644 --- a/docs/docs/users/guides/monitoring/health_checks.md +++ b/docs/docs/users/guides/monitoring/health_checks.md @@ -3,7 +3,7 @@ title: Health Checks --- import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +import `TabItem` from '@theme/TabItem'; All health check endpoints operate on port `2346` by default. This behavior can be changed via the `--healthcheck-address` flag. All endpoints expose a @@ -75,7 +75,7 @@ Sample _ready_ response: [+] sync complete [+] epoch up to date [+] rpc server running -[+] f3 running⏎ +[+] `f3` running⏎ ``` Sample _not ready_ response: @@ -84,7 +84,7 @@ Sample _not ready_ response: [!] sync incomplete [!] epoch outdated [+] rpc server running -[+] f3 running⏎ +[+] `f3` running⏎ ``` @@ -107,7 +107,7 @@ Sample _healthy_ response: [+] rpc server running [+] sync ok [+] peers connected -[+] f3 running⏎ +[+] `f3` running⏎ ``` Sample _unhealthy_ response: @@ -117,7 +117,7 @@ Sample _unhealthy_ response: [+] rpc server running [+] sync ok [+] peers connected -[+] f3 running⏎ +[+] `f3` running⏎ ``` diff --git a/docs/docs/users/guides/monitoring/metrics.md b/docs/docs/users/guides/monitoring/metrics.md index 7f430db560e0..2e6b70a8d8ba 100644 --- a/docs/docs/users/guides/monitoring/metrics.md +++ b/docs/docs/users/guides/monitoring/metrics.md @@ -2,7 +2,7 @@ title: Metrics --- -Prometheus metrics are exposed on localhost's port `6116` by default, under `/metrics`. They are enabled by default and can be disabled with the `--no-metrics` flag. The metrics endpoint can be modified with the `--metrics-address` flag. +Prometheus metrics are exposed on `localhost`'s port `6116` by default, under `/metrics`. They are enabled by default and can be disabled with the `--no-metrics` flag. The metrics endpoint can be modified with the `--metrics-address` flag. ```bash curl localhost:6116/metrics diff --git a/docs/docs/users/knowledge_base/docker_tips.md b/docs/docs/users/knowledge_base/docker_tips.md index bd196c2396ea..901f618de725 100644 --- a/docs/docs/users/knowledge_base/docker_tips.md +++ b/docs/docs/users/knowledge_base/docker_tips.md @@ -11,7 +11,7 @@ sidebar_position: 3 the following engines: - Docker Engine (Community) on Linux, - Docker for macOS - - Docker on Windows Subsystem for Linux 2(WSL2) + - Docker on Windows Subsystem for Linux 2(`WSL2`) Native images are available for the following platform/architecture(s): @@ -19,7 +19,7 @@ Native images are available for the following platform/architecture(s): - `linux/amd64` The images will work out-of-the box on both Intel processors and macOS with -M1 / M2. +`M1` / `M2`. ## Tags diff --git a/docs/docs/users/knowledge_base/network_upgrades_state_migrations.md b/docs/docs/users/knowledge_base/network_upgrades_state_migrations.md index 3516f66f9e4d..2db1f0983df6 100644 --- a/docs/docs/users/knowledge_base/network_upgrades_state_migrations.md +++ b/docs/docs/users/knowledge_base/network_upgrades_state_migrations.md @@ -14,7 +14,7 @@ Some preparation is required for a smooth transition from one network version to State migration is part of the network upgrade. Given the size of the Filecoin state, it usually requires the node to go through every Actor, which takes several seconds. If more changes are required, the migration might take significantly more time and resources. The implementation teams announce the expected upgrade duration and requirements beforehand so that the node can be prepared accordingly. :::tip -On average, ~3-4 network upgrades are performed annually. This number varies based on the FIPs proposed and implementer capacities. This means that the node shouldn't need all the resources that state migrations require. For example, during the NV22 network upgrade, Forest required 64 GiB memory. The following update needed at most 16 GiB memory. It may make sense to upgrade the node only around specific network upgrades. +On average, ~3-4 network upgrades are performed annually. This number varies based on the FIPs proposed and implementer capacities. This means that the node shouldn't need all the resources that state migrations require. For example, during the `NV22` network upgrade, Forest required 64 GiB memory. The following update needed at most 16 GiB memory. It may make sense to upgrade the node only around specific network upgrades. ::: ## Avoiding migrations / node recovery @@ -24,7 +24,7 @@ Sometimes, it is not feasible to perform a network migration. If a node is hoste Forest snapshots are available in the [forest-archive](https://forest-archive.chainsafe.dev/list/) (they can also be used with Lotus). Latest snapshots for mainnet are offered by ChainSafe [here](https://forest-archive.chainsafe.dev/list/mainnet/latest). The link to the latest produced snapshot is [here](https://forest-archive.chainsafe.dev/latest/mainnet/). To avoid the network migration, stop it before the network upgrade and wait until a snapshot is generated **after** the upgrade. :::info example -You read that in the [Forest NV23 support announcement](https://github.com/ChainSafe/forest/discussions/4488) the mainnet is going to be upgraded to NV23 at the epoch `4154640`, which corresponds to `2024-08-06T12:00:00Z`. You stop your note at least a minute before the upgrade, so before `2024-08-06T11:59:00Z` and wait until the latest snapshot at the [forest-archive](https://forest-archive.chainsafe.dev/latest/mainnet/) is newer than the epoch `4154640`. +You read that in the [Forest `NV23` support announcement](https://github.com/ChainSafe/forest/discussions/4488) the mainnet is going to be upgraded to `NV23` at the epoch `4154640`, which corresponds to `2024-08-06T12:00:00Z`. You stop your note at least a minute before the upgrade, so before `2024-08-06T11:59:00Z` and wait until the latest snapshot at the [forest-archive](https://forest-archive.chainsafe.dev/latest/mainnet/) is newer than the epoch `4154640`. You use `curl` to check the latest snapshot. ```bash @@ -43,7 +43,7 @@ You see that the snapshot is past the upgrade epoch by ten epochs. You download aria2c -x5 https://forest-archive.chainsafe.dev/latest/mainnet/ ``` -You start your node with `--import-snapshot ` and enjoy the new, fancy NV23 features. Hooray! +You start your node with `--import-snapshot ` and enjoy the new, fancy `NV23` features. Hooray! Alternatively, if you are fine with purging the current database, you can do it and use Forest's `--auto-download-snapshot` feature after confirming that the latest snapshot is past the upgrade epoch. diff --git a/docs/docs/users/reference/cli.md b/docs/docs/users/reference/cli.md index 9eb338590914..7e56e7e23911 100644 --- a/docs/docs/users/reference/cli.md +++ b/docs/docs/users/reference/cli.md @@ -340,7 +340,7 @@ SUBCOMMANDS: info Print node info shutdown Shutdown Forest healthcheck Print healthcheck info - f3 Manages Filecoin Fast Finality (F3) interactions + f3 Manages Filecoin Fast Finality (`F3`) interactions wait-api Wait for lotus API to come online help Print this message or the help of the given subcommand(s) @@ -832,16 +832,16 @@ Options: ### `forest-cli f3` ``` -Manages Filecoin Fast Finality (F3) interactions +Manages Filecoin Fast Finality (`F3`) interactions Usage: forest-cli f3 Commands: - manifest Gets the current manifest used by F3 - status Checks the F3 status - certs Manages interactions with F3 finality certificates [aliases: c] - powertable Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: pt] - ready Checks if F3 is in sync + manifest Gets the current manifest used by `F3` + status Checks the `F3` status + certs Manages interactions with `F3` finality certificates [aliases: c] + powertable Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: pt] + ready Checks if `F3` is in sync help Print this message or the help of the given subcommand(s) Options: @@ -851,7 +851,7 @@ Options: ### `forest-cli f3 manifest` ``` -Gets the current manifest used by F3 +Gets the current manifest used by `F3` Usage: forest-cli f3 manifest [OPTIONS] @@ -872,7 +872,7 @@ Options: ### `forest-cli f3 status` ``` -Checks the F3 status +Checks the `F3` status Usage: forest-cli f3 status @@ -883,13 +883,13 @@ Options: ### `forest-cli f3 certs` ``` -Manages interactions with F3 finality certificates +Manages interactions with `F3` finality certificates Usage: forest-cli f3 certs Commands: - get Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified - list Lists a range of F3 finality certificates + get Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified + list Lists a range of `F3` finality certificates help Print this message or the help of the given subcommand(s) Options: @@ -899,7 +899,7 @@ Options: ### `forest-cli f3 certs get` ``` -Gets an F3 finality certificate to a given instance ID, or the latest certificate if no instance is specified +Gets an `F3` finality certificate to a given instance ID, or the latest certificate if no instance is specified Usage: forest-cli f3 certs get [OPTIONS] [INSTANCE] @@ -924,7 +924,7 @@ Options: ### `forest-cli f3 certs list` ``` -Lists a range of F3 finality certificates +Lists a range of `F3` finality certificates Usage: forest-cli f3 certs list [OPTIONS] [RANGE] @@ -957,12 +957,12 @@ Options: ### `forest-cli f3 powertable` ``` -Gets F3 power table at a specific instance ID or latest instance if none is specified +Gets `F3` power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable Commands: - get Gets F3 power table at a specific instance ID or latest instance if none is specified [aliases: g] + get Gets `F3` power table at a specific instance ID or latest instance if none is specified [aliases: g] get-proportion Gets the total proportion of power for a list of actors at a given instance [aliases: gp] help Print this message or the help of the given subcommand(s) @@ -973,7 +973,7 @@ Options: ### `forest-cli f3 powertable get` ``` -Gets F3 power table at a specific instance ID or latest instance if none is specified +Gets `F3` power table at a specific instance ID or latest instance if none is specified Usage: forest-cli f3 powertable get [OPTIONS] [INSTANCE] @@ -1004,17 +1004,17 @@ Options: ### `forest-cli f3 ready` ``` -Checks if F3 is in sync +Checks if `F3` is in sync Usage: forest-cli f3 ready [OPTIONS] Options: --wait - Wait until F3 is in sync + Wait until `F3` is in sync --threshold - The threshold of the epoch gap between chain head and F3 head within which F3 is considered in sync [default: 20] + The threshold of the epoch gap between chain head and `F3` head within which `F3` is considered in sync [default: 20] --no-progress-timeout - Exit after F3 making no progress for this duration [default: 10m] + Exit after `F3` making no progress for this duration [default: 10m] -h, --help Print help ``` diff --git a/docs/docs/users/reference/env_variables.md b/docs/docs/users/reference/env_variables.md index 3475862d30f8..8c386803021f 100644 --- a/docs/docs/users/reference/env_variables.md +++ b/docs/docs/users/reference/env_variables.md @@ -32,16 +32,16 @@ process. | `RUST_LOG` | string | empty | `debug,forest_libp2p::service=info` | Allows for log level customization. | | `FOREST_IGNORE_DRAND` | 1 or true | empty | 1 | Ignore Drand validation. | | `FOREST_LIBP2P_METRICS_ENABLED` | 1 or true | empty | 1 | Include `libp2p` metrics in Forest's Prometheus output. | -| `FOREST_F3_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of F3 sidecar. | -| `FOREST_F3_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the F3 sidecar via FFI | -| `FOREST_F3_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the F3 consensus to the node | -| `FOREST_F3_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in F3 manifest | -| `FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in F3 permanently | -| `FOREST_F3_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the F3 initial power table CID | -| `FOREST_F3_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for F3 | -| `FOREST_F3_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for F3 | -| `FOREST_DRAND_MAINNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_MAINNET` config | -| `FOREST_DRAND_QUICKNET_CONFIG` | string | empty | refer to Drand config format section | Override `DRAND_QUICKNET` config | +| `FOREST_F3_SIDECAR_RPC_ENDPOINT` | string | 127.0.0.1:23456 | `127.0.0.1:23456` | An RPC endpoint of `F3` sidecar. | +| `FOREST_F3_SIDECAR_FFI_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to start the `F3` sidecar via FFI | +| `FOREST_F3_CONSENSUS_ENABLED` | 1 or true | hard-coded per chain | 1 | Whether or not to apply the `F3` consensus to the node | +| `FOREST_F3_FINALITY` | integer | inherited from chain configuration | 900 | Set the chain finality epochs in `F3` manifest | +| `FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES` | comma delimited strings | empty | `t0100,t0101` | Set the miner addresses that participate in `F3` permanently | +| `FOREST_F3_INITIAL_POWER_TABLE` | string | empty | `bafyreicmaj5hhoy5mgqvamfhgexxyergw7hdeshizghodwkjg6qmpoco7i` | Set the `F3` initial power table CID | +| `FOREST_F3_ROOT` | string | [FOREST_DATA_ROOT]/f3 | `/var/tmp/f3` | Set the data directory for `F3` | +| `FOREST_F3_BOOTSTRAP_EPOCH` | integer | -1 | 100 | Set the bootstrap epoch for `F3` | +| `FOREST_DRAND_MAINNET_CONFIG` | string | empty | refer to Drand `config` format section | Override `DRAND_MAINNET` config | +| `FOREST_DRAND_QUICKNET_CONFIG` | string | empty | refer to Drand `config` format section | Override `DRAND_QUICKNET` config | | `FOREST_TRACE_FILTER_MAX_RESULT` | positive integer | 500 | 1000 | Sets the maximum results returned per request by `trace_filter` | | `FOREST_CHAIN_INDEXER_ENABLED` | 1 or true | false | 1 | Whether or not to index the chain to support the Ethereum RPC API | | `FOREST_MESSAGES_IN_TIPSET_CACHE_SIZE` | positive integer | 100 | 42 | The size of an internal cache of tipsets to messages | @@ -54,10 +54,10 @@ process. ### `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT` -This is an environment variable that allows users to opt out of building the f3-sidecar. It's only useful when building +This is an environment variable that allows users to opt out of building the `f3`-sidecar. It's only useful when building the binary. -By default, the Go f3-sidecar is built and linked into Forest binary unless environment +By default, the Go `f3`-sidecar is built and linked into Forest binary unless environment variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. ### `FOREST_DB_DEV_MODE` @@ -86,7 +86,7 @@ Intended for controlled cross-system token sharing where expiration validation m > Disabling expiration checks for all JWTs will also allow expired tokens. > This significantly weakens security and should only be used in tightly controlled environments. Not recommended for general use. -### Drand config format +### Drand `config` format ```json { diff --git a/docs/docs/users/reference/json_rpc.mdx b/docs/docs/users/reference/json_rpc.mdx index c936364900a5..7f6fe1672b76 100644 --- a/docs/docs/users/reference/json_rpc.mdx +++ b/docs/docs/users/reference/json_rpc.mdx @@ -1,6 +1,6 @@ --- title: JSON-RPC Schema -sidebar_position: 4 +`sidebar_position`: 4 --- export const style = { diff --git a/docs/docs/users/reference/json_rpc_overview.md b/docs/docs/users/reference/json_rpc_overview.md index 00fe1230df2e..744fb69ddf2f 100644 --- a/docs/docs/users/reference/json_rpc_overview.md +++ b/docs/docs/users/reference/json_rpc_overview.md @@ -24,12 +24,12 @@ Need a specific method? Let us know on The RPC interface is the primary mechanism for interacting with Forest. Until June 2025, the Lotus -[V0](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v0-deprecated.md) +[`V0`](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v0-deprecated.md) and -[V1](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v1-stable.md) +[`V1`](https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v1-stable.md) APIs served as the reference for Forest's implementation. -Since June 2025, the [Common Node API](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0104.md) has been the standard for RPC methods across Filecoin clients, replacing the Lotus-specific API as the primary reference for V1 methods. +Since June 2025, the [Common Node API](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0104.md) has been the standard for RPC methods across Filecoin clients, replacing the Lotus-specific API as the primary reference for `V1` methods. :::info diff --git a/f3-sidecar/README.md b/f3-sidecar/README.md index 4253224e1f5c..0ff575403fa2 100644 --- a/f3-sidecar/README.md +++ b/f3-sidecar/README.md @@ -17,15 +17,15 @@ Follow this [guide](https://go.dev/doc/install) to install or use one of the ver `--save-token jwt_path`) - import a shared miner key for testing `forest-wallet --remote-wallet import` (the shared miner worker key can be found in `scripts/tests/api_compare/.env`) -- run f3 sidecar `go run . -jwt $(cat jwt_path)` +- run `f3` sidecar `go run . -jwt $(cat jwt_path)` - (optional) to inspect RPC calls, run `mitmproxy --mode reverse:http://localhost:2345 --listen-port 8080` then `go run . -rpc http://127.0.0.1:8080/rpc/v1` -### How F3 sidecar interacts with Forest +### How `F3` sidecar interacts with Forest -An F3 sidecar node is a standalone node that is a part of a p2p network and -participates in the f3 protocol. +An `F3` sidecar node is a standalone node that is a part of a p2p network and +participates in the `f3` protocol. Besides what have been handled internally(e.g. p2p communications) in the `go-f3` lib @@ -40,7 +40,7 @@ Besides what have been handled internally(e.g. p2p communications) in the participating miners - it requires a backend that provides the actor IDs of the participating miners - it requires a p2p node as bootstrapper to discover more peers via Kademlia -- additionally, to power the `Filecoin.F3*` RPC methods in forest, a sidecar +- additionally, to power the `Filecoin.F3*` RPC methods in forest, a `f3` sidecar node runs an RPC server that implements the same RPC methods to which the associated forest node can delegate the RPC requests @@ -57,10 +57,10 @@ flowchart TD A --> |dynamic manifest backend| D[manifest p2p server] ``` -### To build and run F3 sidecar within Forest via FFI +### To build and run `F3` sidecar within Forest via FFI -By default, the Go F3-sidecar is built and linked into Forest binary unless +By default, the Go `F3`-sidecar is built and linked into Forest binary unless environment variable `FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT=1` is set. -F3 sidecar is not started by default, set `FOREST_F3_SIDECAR_FFI_ENABLED=1` to +`F3` sidecar is not started by default, set `FOREST_F3_SIDECAR_FFI_ENABLED=1` to opt in. diff --git a/scripts/tests/bootstrapper/README.md b/scripts/tests/bootstrapper/README.md index afd5c500f1d8..3fdd8e731d4b 100644 --- a/scripts/tests/bootstrapper/README.md +++ b/scripts/tests/bootstrapper/README.md @@ -26,7 +26,7 @@ flowchart TD ./test_bootstrapper.sh lotus ``` -## Teardown +## `Teardown` ```bash docker compose -f ./docker-compose-forest.yml down -v --rmi all From 7de371a0f97775b382f7172fd0ab8395d66cd1bb Mon Sep 17 00:00:00 2001 From: signor1 Date: Sun, 16 Nov 2025 10:11:04 +0100 Subject: [PATCH 34/34] fix: spellcheck passed successfully with no errors --- .config/spellcheck.toml | 2 +- docs/docs/users/guides/monitoring/health_checks.md | 10 +++++----- docs/docs/users/knowledge_base/docker_tips.md | 2 +- src/utils/proofs_api/paramfetch.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.config/spellcheck.toml b/.config/spellcheck.toml index e6af131f888a..1e536bf9e8c4 100644 --- a/.config/spellcheck.toml +++ b/.config/spellcheck.toml @@ -22,7 +22,7 @@ transform_regex = [ "^\\{\\{$", "^\\}\\}$", # YAML frontmatter - skip underscore_words common in config - "^[a-z]+_[a-z]+.*$", + "^[a-z]+_[a-z]+$", # Numbers with underscores like 30_000 "^[0-9_]+$", # Plus signs and other operators diff --git a/docs/docs/users/guides/monitoring/health_checks.md b/docs/docs/users/guides/monitoring/health_checks.md index 17194ac58d32..d308c889fba3 100644 --- a/docs/docs/users/guides/monitoring/health_checks.md +++ b/docs/docs/users/guides/monitoring/health_checks.md @@ -3,7 +3,7 @@ title: Health Checks --- import Tabs from '@theme/Tabs'; -import `TabItem` from '@theme/TabItem'; +import TabItem from '@theme/TabItem'; All health check endpoints operate on port `2346` by default. This behavior can be changed via the `--healthcheck-address` flag. All endpoints expose a @@ -75,7 +75,7 @@ Sample _ready_ response: [+] sync complete [+] epoch up to date [+] rpc server running -[+] `f3` running⏎ +[+] f3 running⏎ ``` Sample _not ready_ response: @@ -84,7 +84,7 @@ Sample _not ready_ response: [!] sync incomplete [!] epoch outdated [+] rpc server running -[+] `f3` running⏎ +[+] f3 running⏎ ``` @@ -107,7 +107,7 @@ Sample _healthy_ response: [+] rpc server running [+] sync ok [+] peers connected -[+] `f3` running⏎ +[+] f3 running⏎ ``` Sample _unhealthy_ response: @@ -117,7 +117,7 @@ Sample _unhealthy_ response: [+] rpc server running [+] sync ok [+] peers connected -[+] `f3` running⏎ +[+] f3 running⏎ ``` diff --git a/docs/docs/users/knowledge_base/docker_tips.md b/docs/docs/users/knowledge_base/docker_tips.md index 901f618de725..38294401b237 100644 --- a/docs/docs/users/knowledge_base/docker_tips.md +++ b/docs/docs/users/knowledge_base/docker_tips.md @@ -18,7 +18,7 @@ Native images are available for the following platform/architecture(s): - `linux/arm64` - `linux/amd64` -The images will work out-of-the box on both Intel processors and macOS with +The images will work out-of-the-box on both Intel processors and macOS with `M1` / `M2`. ## Tags diff --git a/src/utils/proofs_api/paramfetch.rs b/src/utils/proofs_api/paramfetch.rs index 3f08cd600c42..637167d87f40 100644 --- a/src/utils/proofs_api/paramfetch.rs +++ b/src/utils/proofs_api/paramfetch.rs @@ -173,7 +173,7 @@ async fn fetch_params_ipfs_gateway(path: &Path, info: &ParameterData) -> anyhow: /// Downloads the parameter file from Cloudflare `R2` to the given path. It wraps the [`download_from_cloudflare`] function with a retry and timeout mechanisms. async fn fetch_params_cloudflare(name: &str, path: &Path) -> anyhow::Result<()> { - info!("Fetching param file {name} from Cloudflare `R2` {CLOUDFLARE_PROOF_PARAMETER_DOMAIN}"); + info!("Fetching param file {name} from Cloudflare R2 {CLOUDFLARE_PROOF_PARAMETER_DOMAIN}"); let result = (|| download_from_cloudflare(name, path)) .retry(ExponentialBuilder::default()) .notify(|err, dur| {