Skip to content

Conversation

@dimartiro
Copy link

@dimartiro dimartiro commented Nov 21, 2025

Description

This PR implements forking functionality for anvil-polkadot, allowing users to fork from a remote Substrate/Polkadot node and run local tests against live network state.

Adds the ability to fork from a running anvil-polkadot node (or compatible Substrate node) using the --fork-url flag. The implementation uses a lazy-loading approach to fetch state from the remote node on-demand, caching values locally for performance

Manual testing

After compiling the entire project using cargo build --release

1. Start base node

RUST_LOG=info ./target/release/anvil-polkadot --port 9970

2. Modify state on base node

./target/release/cast send 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \
    --value 5ether \
    --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
    --rpc-url http://localhost:9970

3. Verify modified balance

./target/release/cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
    --rpc-url http://localhost:9970

Expected Output: ~9995 ETH (10000 - 5 - gas)

4. Start fork node (inherits modified state)

RUST_LOG=info ./target/release/anvil-polkadot \
    --port 8545 \
    --fork-url http://localhost:9944

5. Verify fork inherited state

./target/release/cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
    --rpc-url http://localhost:8545

Expected Output: ~9995 ETH ✅ (matches base node)

6. Make changes on fork (doesn't affect base)

./target/release/cast send 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \
    --value 1ether \
    --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
    --rpc-url http://localhost:8545

7. Verify isolation

./target/release/cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
    --rpc-url http://localhost:9970

Exepected Output: ~9995 ETH (unchanged)

./target/release/cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
    --rpc-url http://localhost:8545

Expected Output: ~9994 ETH (changed)

Integration tests

  • Check forked node retrieves right state
  • Test forking using latest finalized block and block height (positive and negative numbers)
  • Fork a node with a smart contract deployed and check storage is the same

Closes: ChainSafe/gossamer-parity#52, ChainSafe/gossamer-parity#58, ChainSafe/gossamer-parity#65, ChainSafe/gossamer-parity#84

@dimartiro dimartiro changed the title [WIP] Implement forking support with lazy loading backend Implement forking support with lazy loading backend Nov 24, 2025
Copy link

@alindima alindima left a comment

Choose a reason for hiding this comment

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

Looking good. Let's bring in the latest changes from the feature branch

@dimartiro dimartiro requested a review from alindima November 25, 2025 16:49
/// Tests that forking preserves contract state from source chain and that multiple contract
/// instances maintain independent storage
#[tokio::test(flavor = "multi_thread")]
async fn test_fork_with_contract_deployment() {

Choose a reason for hiding this comment

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

not neccessarily for this PR, but have a look at what other forking-related test scenarios regular anvil has. We should mirror them where it makes sense

Choose a reason for hiding this comment

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

as an example, what we discussed earlier in the call, using calls which mutate the state on top of a forked network (anvil_setBalance, etc)

Copy link
Author

@dimartiro dimartiro Nov 25, 2025

Choose a reason for hiding this comment

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

But we are already doing that with test_fork_preserves_state_and_allows_modifications right?

Choose a reason for hiding this comment

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

I'm talking about the RPCs that use node-side state mutation, so mutating the state without sending extrinsics (using the BackendWithOverlay we mentioned yesterday).

like set_chainid, set_balance, set_code, set_storageAt, setNonce

// List of general purpose DRPC keys to rotate through
static DRPC_KEYS: LazyLock<Vec<String>> = LazyLock::new(|| {
let mut keys = vec!["AgasqIYODEW_j_J0F91L8oETmhtHCXkR8JAVssvAG40d".to_owned()];
let mut keys = vec![

Choose a reason for hiding this comment

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

I see that the tests are still failing because of invalid API keys. Let's try to debug this a bit.

Comment the if block which starts on line 42

@alindima
Copy link

Let's also fix clippy

@alindima
Copy link

alindima commented Nov 26, 2025

While playing around with this branch locally I ran into another panic.

I was just sending balances around on both the original node and the fork

Full logs:

2025-11-26T08:42:15.123948Z  INFO eth-rpc::client: Node does not have getAutomine RPC. Defaulting to automine=false. error: Client(JsonRpc(ErrorObject { code: MethodNotFound, message: "Method not found", data: None }))
2025-11-26T08:42:15.123990Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (BestBlocks)
2025-11-26T08:42:15.124031Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (FinalizedBlocks)
2025-11-26T08:44:30.184510Z  INFO node::user: eth_chainId
2025-11-26T08:44:30.184826Z  INFO node::user: eth_getTransactionCount
2025-11-26T08:44:30.190551Z  INFO node::user: eth_feeHistory
2025-11-26T08:44:30.190847Z  INFO node::user: eth_estimateGas
2025-11-26T08:44:30.209642Z  INFO node::user: eth_sendRawTransaction
2025-11-26T08:44:30.221004Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.221036Z  WARN db::blockchain: Block 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 exists in chain but not found when following all leaves backwards
2025-11-26T08:44:30.221051Z  INFO sc_basic_authorship::basic_authorship: 🙌 Starting consensus session on top of parent 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 (#4)
2025-11-26T08:44:30.221213Z  INFO node::user: eth_getBlockByNumber
2025-11-26T08:44:30.224070Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.224373Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.225716Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.271945Z  INFO sc_basic_authorship::basic_authorship: 🎁 Prepared block for proposing at 5 (50 ms) hash: 0x465d21e14f9ee33b87becb9882cb532a58da077219f6e0f421887e34dbba4a02; parent_hash: 0xc996…e029; end: NoMoreTransactions; extrinsics_count: 2
2025-11-26T08:44:30.477467Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.477526Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.487494Z  INFO node::user: eth_getBlockByNumber
The application panicked (crashed).
Message:  Dropped receiver: Success(Object {"baseFeePerGas": String("0xf41f5"), "blobGasUsed": String("0x0"), "difficulty": String("0x0"), "excessBlobGas": String("0x0"), "extraData": String("0x"), "gasLimit": String("0x2465686b0ae8"), "gasUsed": String("0x9b9655e2"), "hash": String("0xe836a311311c3fd1a002ae69a08af45d6b932c21c59a7033af403efe6ded1a31"), "logsBloom": String("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), "miner": String("0x0000000000000000000000000000000000000000"), "mixHash": String("0x0000000000000000000000000000000000000000000000000008e1bc9bf04000"), "nonce": String("0x0000000000000000"), "number": String("0x5"), "parentHash": String("0x97e029f51d706dfc721d8937ab92a7c4646e0812bd20c7b7c3ca8f323ea13662"), "receiptsRoot": String("0x6761f029db02d9711aa6a2615f5f6012c4a23b836f62c77fc4f7cf85e0b7c593"), "sha3Uncles": String("0x0000000000000000000000000000000000000000000000000000000000000000"), "size": String("0x0"), "stateRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "timestamp": String("0x6926bded"), "transactions": Array [String("0x0d190d026cc00043c19f54da32eb711880d2bb3cde6361aeb5b917762063adff")], "transactionsRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "uncles": Array [], "withdrawals": Array [], "withdrawalsRoot": String("0x0000000000000000000000000000000000000000000000000000000000000000")})
Location: crates/anvil-polkadot/src/api_server/server.rs:159

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 11 frames hidden ⋮                              
  12: <core::pin::Pin<P> as core::future::future::Future>::poll::h7ff0caf88bbd4379
      at <unknown source file>:<unknown line>
  13: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll::hb22a2a23cd5ff836
      at <unknown source file>:<unknown line>
  14: tokio::runtime::task::core::Core<T,S>::poll::heacd3e03a74f74b2
      at <unknown source file>:<unknown line>
  15: tokio::runtime::task::harness::Harness<T,S>::poll::hea7c32e55760cbcf
      at <unknown source file>:<unknown line>
  16: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h3672c8cb41e5765c
      at <unknown source file>:<unknown line>
  17: tokio::runtime::scheduler::multi_thread::worker::Context::run::h6d66aec1eaa19239
      at <unknown source file>:<unknown line>
  18: tokio::runtime::context::scoped::Scoped<T>::set::hd0b9f670ca0250d5
      at <unknown source file>:<unknown line>
  19: tokio::runtime::context::runtime::enter_runtime::h6c45339057bc35ab
      at <unknown source file>:<unknown line>
  20: tokio::runtime::scheduler::multi_thread::worker::run::h4f4861b3c2108d6a
      at <unknown source file>:<unknown line>
  21: tokio::runtime::task::core::Core<T,S>::poll::h53e7a83a9ac3a913
      at <unknown source file>:<unknown line>
  22: tokio::runtime::task::harness::Harness<T,S>::poll::h887c52cb50225052
      at <unknown source file>:<unknown line>
  23: tokio::runtime::blocking::pool::Inner::run::h5f95c19ff29b49d3
      at <unknown source file>:<unknown line>
  24: std::sys::backtrace::__rust_begin_short_backtrace::hc6ac59c8dd7a0530
      at <unknown source file>:<unknown line>
  25: core::ops::function::FnOnce::call_once{{vtable.shim}}::hdcd1e6f25ac79775
      at <unknown source file>:<unknown line>
  26: std::sys::pal::unix::thread::Thread::new::thread_start::h447d747a543e4adc
      at <unknown source file>:<unknown line>
  27: __pthread_cond_wait<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

@alindima
Copy link

While playing around with this branch locally I ran into another panic.

I was just sending balances around on both the original node and the fork

Full logs:

2025-11-26T08:42:15.123948Z  INFO eth-rpc::client: Node does not have getAutomine RPC. Defaulting to automine=false. error: Client(JsonRpc(ErrorObject { code: MethodNotFound, message: "Method not found", data: None }))
2025-11-26T08:42:15.123990Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (BestBlocks)
2025-11-26T08:42:15.124031Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (FinalizedBlocks)
2025-11-26T08:44:30.184510Z  INFO node::user: eth_chainId
2025-11-26T08:44:30.184826Z  INFO node::user: eth_getTransactionCount
2025-11-26T08:44:30.190551Z  INFO node::user: eth_feeHistory
2025-11-26T08:44:30.190847Z  INFO node::user: eth_estimateGas
2025-11-26T08:44:30.209642Z  INFO node::user: eth_sendRawTransaction
2025-11-26T08:44:30.221004Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.221036Z  WARN db::blockchain: Block 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 exists in chain but not found when following all leaves backwards
2025-11-26T08:44:30.221051Z  INFO sc_basic_authorship::basic_authorship: 🙌 Starting consensus session on top of parent 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 (#4)
2025-11-26T08:44:30.221213Z  INFO node::user: eth_getBlockByNumber
2025-11-26T08:44:30.224070Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.224373Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.225716Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.271945Z  INFO sc_basic_authorship::basic_authorship: 🎁 Prepared block for proposing at 5 (50 ms) hash: 0x465d21e14f9ee33b87becb9882cb532a58da077219f6e0f421887e34dbba4a02; parent_hash: 0xc996…e029; end: NoMoreTransactions; extrinsics_count: 2
2025-11-26T08:44:30.477467Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.477526Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.487494Z  INFO node::user: eth_getBlockByNumber
The application panicked (crashed).
Message:  Dropped receiver: Success(Object {"baseFeePerGas": String("0xf41f5"), "blobGasUsed": String("0x0"), "difficulty": String("0x0"), "excessBlobGas": String("0x0"), "extraData": String("0x"), "gasLimit": String("0x2465686b0ae8"), "gasUsed": String("0x9b9655e2"), "hash": String("0xe836a311311c3fd1a002ae69a08af45d6b932c21c59a7033af403efe6ded1a31"), "logsBloom": String("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), "miner": String("0x0000000000000000000000000000000000000000"), "mixHash": String("0x0000000000000000000000000000000000000000000000000008e1bc9bf04000"), "nonce": String("0x0000000000000000"), "number": String("0x5"), "parentHash": String("0x97e029f51d706dfc721d8937ab92a7c4646e0812bd20c7b7c3ca8f323ea13662"), "receiptsRoot": String("0x6761f029db02d9711aa6a2615f5f6012c4a23b836f62c77fc4f7cf85e0b7c593"), "sha3Uncles": String("0x0000000000000000000000000000000000000000000000000000000000000000"), "size": String("0x0"), "stateRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "timestamp": String("0x6926bded"), "transactions": Array [String("0x0d190d026cc00043c19f54da32eb711880d2bb3cde6361aeb5b917762063adff")], "transactionsRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "uncles": Array [], "withdrawals": Array [], "withdrawalsRoot": String("0x0000000000000000000000000000000000000000000000000000000000000000")})
Location: crates/anvil-polkadot/src/api_server/server.rs:159

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 11 frames hidden ⋮                              
  12: <core::pin::Pin<P> as core::future::future::Future>::poll::h7ff0caf88bbd4379
      at <unknown source file>:<unknown line>
  13: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll::hb22a2a23cd5ff836
      at <unknown source file>:<unknown line>
  14: tokio::runtime::task::core::Core<T,S>::poll::heacd3e03a74f74b2
      at <unknown source file>:<unknown line>
  15: tokio::runtime::task::harness::Harness<T,S>::poll::hea7c32e55760cbcf
      at <unknown source file>:<unknown line>
  16: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h3672c8cb41e5765c
      at <unknown source file>:<unknown line>
  17: tokio::runtime::scheduler::multi_thread::worker::Context::run::h6d66aec1eaa19239
      at <unknown source file>:<unknown line>
  18: tokio::runtime::context::scoped::Scoped<T>::set::hd0b9f670ca0250d5
      at <unknown source file>:<unknown line>
  19: tokio::runtime::context::runtime::enter_runtime::h6c45339057bc35ab
      at <unknown source file>:<unknown line>
  20: tokio::runtime::scheduler::multi_thread::worker::run::h4f4861b3c2108d6a
      at <unknown source file>:<unknown line>
  21: tokio::runtime::task::core::Core<T,S>::poll::h53e7a83a9ac3a913
      at <unknown source file>:<unknown line>
  22: tokio::runtime::task::harness::Harness<T,S>::poll::h887c52cb50225052
      at <unknown source file>:<unknown line>
  23: tokio::runtime::blocking::pool::Inner::run::h5f95c19ff29b49d3
      at <unknown source file>:<unknown line>
  24: std::sys::backtrace::__rust_begin_short_backtrace::hc6ac59c8dd7a0530
      at <unknown source file>:<unknown line>
  25: core::ops::function::FnOnce::call_once{{vtable.shim}}::hdcd1e6f25ac79775
      at <unknown source file>:<unknown line>
  26: std::sys::pal::unix::thread::Thread::new::thread_start::h447d747a543e4adc
      at <unknown source file>:<unknown line>
  27: __pthread_cond_wait<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

hmm actually I'm getting similar panic on a node that uses master. Looks like only a problem when using cast and sending requests one after the other (if we wait a bit more there is no issue). I'll investigate. Probably cast is not properly waiting for the response before sending the next request

@alindima
Copy link

While playing around with this branch locally I ran into another panic.
I was just sending balances around on both the original node and the fork
Full logs:

2025-11-26T08:42:15.123948Z  INFO eth-rpc::client: Node does not have getAutomine RPC. Defaulting to automine=false. error: Client(JsonRpc(ErrorObject { code: MethodNotFound, message: "Method not found", data: None }))
2025-11-26T08:42:15.123990Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (BestBlocks)
2025-11-26T08:42:15.124031Z  INFO eth-rpc::client: 🔌 Subscribing to new blocks (FinalizedBlocks)
2025-11-26T08:44:30.184510Z  INFO node::user: eth_chainId
2025-11-26T08:44:30.184826Z  INFO node::user: eth_getTransactionCount
2025-11-26T08:44:30.190551Z  INFO node::user: eth_feeHistory
2025-11-26T08:44:30.190847Z  INFO node::user: eth_estimateGas
2025-11-26T08:44:30.209642Z  INFO node::user: eth_sendRawTransaction
2025-11-26T08:44:30.221004Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.221036Z  WARN db::blockchain: Block 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 exists in chain but not found when following all leaves backwards
2025-11-26T08:44:30.221051Z  INFO sc_basic_authorship::basic_authorship: 🙌 Starting consensus session on top of parent 0xc996491397f4f3b401aff03856b13543d7b8b6765a81d4ddb2371d4ea634e029 (#4)
2025-11-26T08:44:30.221213Z  INFO node::user: eth_getBlockByNumber
2025-11-26T08:44:30.224070Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.224373Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.225716Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.271945Z  INFO sc_basic_authorship::basic_authorship: 🎁 Prepared block for proposing at 5 (50 ms) hash: 0x465d21e14f9ee33b87becb9882cb532a58da077219f6e0f421887e34dbba4a02; parent_hash: 0xc996…e029; end: NoMoreTransactions; extrinsics_count: 2
2025-11-26T08:44:30.477467Z  INFO node::user: eth_blockNumber
2025-11-26T08:44:30.477526Z  INFO node::user: eth_getTransactionReceipt
2025-11-26T08:44:30.487494Z  INFO node::user: eth_getBlockByNumber
The application panicked (crashed).
Message:  Dropped receiver: Success(Object {"baseFeePerGas": String("0xf41f5"), "blobGasUsed": String("0x0"), "difficulty": String("0x0"), "excessBlobGas": String("0x0"), "extraData": String("0x"), "gasLimit": String("0x2465686b0ae8"), "gasUsed": String("0x9b9655e2"), "hash": String("0xe836a311311c3fd1a002ae69a08af45d6b932c21c59a7033af403efe6ded1a31"), "logsBloom": String("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), "miner": String("0x0000000000000000000000000000000000000000"), "mixHash": String("0x0000000000000000000000000000000000000000000000000008e1bc9bf04000"), "nonce": String("0x0000000000000000"), "number": String("0x5"), "parentHash": String("0x97e029f51d706dfc721d8937ab92a7c4646e0812bd20c7b7c3ca8f323ea13662"), "receiptsRoot": String("0x6761f029db02d9711aa6a2615f5f6012c4a23b836f62c77fc4f7cf85e0b7c593"), "sha3Uncles": String("0x0000000000000000000000000000000000000000000000000000000000000000"), "size": String("0x0"), "stateRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "timestamp": String("0x6926bded"), "transactions": Array [String("0x0d190d026cc00043c19f54da32eb711880d2bb3cde6361aeb5b917762063adff")], "transactionsRoot": String("0xed144b747e4af31314e6742d04696915cbab6b09af8133b7ef36258f09386d13"), "uncles": Array [], "withdrawals": Array [], "withdrawalsRoot": String("0x0000000000000000000000000000000000000000000000000000000000000000")})
Location: crates/anvil-polkadot/src/api_server/server.rs:159

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 11 frames hidden ⋮                              
  12: <core::pin::Pin<P> as core::future::future::Future>::poll::h7ff0caf88bbd4379
      at <unknown source file>:<unknown line>
  13: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll::hb22a2a23cd5ff836
      at <unknown source file>:<unknown line>
  14: tokio::runtime::task::core::Core<T,S>::poll::heacd3e03a74f74b2
      at <unknown source file>:<unknown line>
  15: tokio::runtime::task::harness::Harness<T,S>::poll::hea7c32e55760cbcf
      at <unknown source file>:<unknown line>
  16: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h3672c8cb41e5765c
      at <unknown source file>:<unknown line>
  17: tokio::runtime::scheduler::multi_thread::worker::Context::run::h6d66aec1eaa19239
      at <unknown source file>:<unknown line>
  18: tokio::runtime::context::scoped::Scoped<T>::set::hd0b9f670ca0250d5
      at <unknown source file>:<unknown line>
  19: tokio::runtime::context::runtime::enter_runtime::h6c45339057bc35ab
      at <unknown source file>:<unknown line>
  20: tokio::runtime::scheduler::multi_thread::worker::run::h4f4861b3c2108d6a
      at <unknown source file>:<unknown line>
  21: tokio::runtime::task::core::Core<T,S>::poll::h53e7a83a9ac3a913
      at <unknown source file>:<unknown line>
  22: tokio::runtime::task::harness::Harness<T,S>::poll::h887c52cb50225052
      at <unknown source file>:<unknown line>
  23: tokio::runtime::blocking::pool::Inner::run::h5f95c19ff29b49d3
      at <unknown source file>:<unknown line>
  24: std::sys::backtrace::__rust_begin_short_backtrace::hc6ac59c8dd7a0530
      at <unknown source file>:<unknown line>
  25: core::ops::function::FnOnce::call_once{{vtable.shim}}::hdcd1e6f25ac79775
      at <unknown source file>:<unknown line>
  26: std::sys::pal::unix::thread::Thread::new::thread_start::h447d747a543e4adc
      at <unknown source file>:<unknown line>
  27: __pthread_cond_wait<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

hmm actually I'm getting similar panic on a node that uses master. Looks like only a problem when using cast and sending requests one after the other (if we wait a bit more there is no issue). I'll investigate. Probably cast is not properly waiting for the response before sending the next request

yeah, this was the issue: #438

@dimartiro
Copy link
Author

yeah, this was the issue: #438

Great finding!

@alindima alindima merged commit d43a539 into paritytech:feature/forking Nov 27, 2025
14 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants