Skip to content

speed up toolkit syncing#1263

Merged
gilescope merged 22 commits into
mainfrom
giles-subxt-simplify
Apr 10, 2026
Merged

speed up toolkit syncing#1263
gilescope merged 22 commits into
mainfrom
giles-subxt-simplify

Conversation

@gilescope

@gilescope gilescope commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Batch block-number-to-hash RPC calls into a single request instead of one call per block, reducing network round trips during toolkit sync. Also simplifies several function parameters across the fetcher module.

🗹 TODO before merging

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other: Toolkit-only change, no fork impact
  • N/A

Links

ozgb and others added 18 commits April 2, 2026 15:22
Complete the API migration across toolkit, upgrader, relay, e2e tests,
and scripts for the subxt v0.50 rewrite. Key changes:

- Block-centric API: api.blocks().at() → api.at_block(), api.storage().at_latest() → api.at_current_block().storage()
- Transaction types: TxProgress → TransactionProgress, TxInBlock → TransactionInBlock, TxStatus → TransactionStatus
- api.tx() is now async, encode_call_data() → tx().call_data()
- api.metadata() removed from OnlineClient; use at_current_block().metadata_ref()
- Metadata no longer Clone; use ArcMetadata (Arc<Metadata>) for shared ownership
- Granular error types: OnlineClientAtBlockError, ExtrinsicError, RuntimeApiError, etc.
- Event API: variant_name() → event_name(), as_event() → decode_fields_as(), field_values() removed
- Storage API: key now passed to fetch(addr, key) instead of address constructor
- Block from streams: extrinsics/events accessed via block.at().await? first
- dynamic::tx().into_value() requires Composite::unnamed() instead of Vec
- RpcConfig trait impl required for LegacyRpcMethods
Share the RPC WebSocket connection within each client, cap fetch workers
to actual workload size, and retry transient transport errors during
transaction submission with exponential backoff.
Signed-off-by: Giles Cope <gilescope@gmail.com>
Signed-off-by: Giles Cope <gilescope@gmail.com>
Signed-off-by: Giles Cope <gilescope@gmail.com>
@gilescope gilescope requested a review from a team as a code owner April 8, 2026 13:05
@gilescope gilescope requested a review from ozgb April 9, 2026 10:55

@ozgb ozgb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good - needs a rebase

Signed-off-by: Giles Cope <gilescope@gmail.com>
Signed-off-by: Giles Cope <gilescope@gmail.com>
gilescope and others added 2 commits April 10, 2026 10:53
Signed-off-by: Giles Cope <gilescope@gmail.com>
@gilescope gilescope enabled auto-merge April 10, 2026 09:54
@gilescope gilescope added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 8515f2b Apr 10, 2026
28 of 31 checks passed
@gilescope gilescope deleted the giles-subxt-simplify branch April 10, 2026 11:25
m2ux added a commit that referenced this pull request Apr 23, 2026
* chore(deps): migrate subxt from v0.44 to v0.50

Complete the API migration across toolkit, upgrader, relay, e2e tests,
and scripts for the subxt v0.50 rewrite. Key changes:

- Block-centric API: api.blocks().at() → api.at_block(), api.storage().at_latest() → api.at_current_block().storage()
- Transaction types: TxProgress → TransactionProgress, TxInBlock → TransactionInBlock, TxStatus → TransactionStatus
- api.tx() is now async, encode_call_data() → tx().call_data()
- api.metadata() removed from OnlineClient; use at_current_block().metadata_ref()
- Metadata no longer Clone; use ArcMetadata (Arc<Metadata>) for shared ownership
- Granular error types: OnlineClientAtBlockError, ExtrinsicError, RuntimeApiError, etc.
- Event API: variant_name() → event_name(), as_event() → decode_fields_as(), field_values() removed
- Storage API: key now passed to fetch(addr, key) instead of address constructor
- Block from streams: extrinsics/events accessed via block.at().await? first
- dynamic::tx().into_value() requires Composite::unnamed() instead of Vec
- RpcConfig trait impl required for LegacyRpcMethods

* chore: add change file for subxt v0.50 migration

* chore: fix tags in change file

* docs: add pr link to change file

* chore: cargo fmt

* fix(toolkit): add retry with backoff for RPC 429 rate limiting

Share the RPC WebSocket connection within each client, cap fetch workers
to actual workload size, and retry transient transport errors during
transaction submission with exponential backoff.

* chore: cargo fmt

* docs: add issue link to change file

* fix: compile tests in e2e tests

* chore: fix metadata

* test: fix deploy_tx race condition causing test failures

* more robust decoding

Signed-off-by: Giles Cope <gilescope@gmail.com>

* feat: optimise block_number to hash

Signed-off-by: Giles Cope <gilescope@gmail.com>

* fix: tweak

Signed-off-by: Giles Cope <gilescope@gmail.com>

* chore: fmt

Signed-off-by: Giles Cope <gilescope@gmail.com>

* chore: changelog

Signed-off-by: Giles Cope <gilescope@gmail.com>

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Apr 23, 2026
* chore(deps): migrate subxt from v0.44 to v0.50

Complete the API migration across toolkit, upgrader, relay, e2e tests,
and scripts for the subxt v0.50 rewrite. Key changes:

- Block-centric API: api.blocks().at() → api.at_block(), api.storage().at_latest() → api.at_current_block().storage()
- Transaction types: TxProgress → TransactionProgress, TxInBlock → TransactionInBlock, TxStatus → TransactionStatus
- api.tx() is now async, encode_call_data() → tx().call_data()
- api.metadata() removed from OnlineClient; use at_current_block().metadata_ref()
- Metadata no longer Clone; use ArcMetadata (Arc<Metadata>) for shared ownership
- Granular error types: OnlineClientAtBlockError, ExtrinsicError, RuntimeApiError, etc.
- Event API: variant_name() → event_name(), as_event() → decode_fields_as(), field_values() removed
- Storage API: key now passed to fetch(addr, key) instead of address constructor
- Block from streams: extrinsics/events accessed via block.at().await? first
- dynamic::tx().into_value() requires Composite::unnamed() instead of Vec
- RpcConfig trait impl required for LegacyRpcMethods

* chore: add change file for subxt v0.50 migration

* chore: fix tags in change file

* docs: add pr link to change file

* chore: cargo fmt

* fix(toolkit): add retry with backoff for RPC 429 rate limiting

Share the RPC WebSocket connection within each client, cap fetch workers
to actual workload size, and retry transient transport errors during
transaction submission with exponential backoff.

* chore: cargo fmt

* docs: add issue link to change file

* fix: compile tests in e2e tests

* chore: fix metadata

* test: fix deploy_tx race condition causing test failures

* more robust decoding

Signed-off-by: Giles Cope <gilescope@gmail.com>

* feat: optimise block_number to hash

Signed-off-by: Giles Cope <gilescope@gmail.com>

* fix: tweak

Signed-off-by: Giles Cope <gilescope@gmail.com>

* chore: fmt

Signed-off-by: Giles Cope <gilescope@gmail.com>

* chore: changelog

Signed-off-by: Giles Cope <gilescope@gmail.com>

---------

Signed-off-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Mike Clay <mike.clay@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants