starknet-devnet-rs
starknet-devnet-rs copied to clipboard
Test old state support
Some RPC methods like starknet_call offer the user to perform a call at a historic block, by providing an old block specifier (by hash or number). Candidate methods include those that read the state and have block_id as their argument in the RPC spec file: starknet_call, starknet_estimateFee, starknet_estimateMessageFee, starknet_getStorageAt, starknet_getNonce, starknet_getClass, starknet_simulateTransactions.
The old state support itself was introduced with #104, but not thoroughly tested. Currently we only test with BlockId::Tag(BlockTag::Latest), but it would make sense to also test with BlockId::Number(<HISTORIC_BLOCK_NUMBER>) and BlockId::Hash(<HISTORIC_BLOCK_HASH>)
@FabijanC please can you add more description and what to do for this issue? It will be my pleasure to tackle it
@vibenedict description updated
@vibenedict To avoid confusion, your task is this one. Saying this because you also applied for #130, but that one had another applicant, and since you are the only applicant here, you've been assigned with this one.
Hi @FabijanC, looking at the linked PR, I can't seems to find the file where BlockId::Tag(BlockTag::Latest) was tested. It would make my work faster if you could add link to the file in the description. Thanks
E.g. starknet_call is tested in https://github.com/0xSpaceShard/starknet-devnet-rs/blob/ed53233079c9dc338ea432d18e2eeb4e43ab85b2/crates/starknet-devnet/tests/test_call.rs#L28. Would be cool to test the case where there are e.g. 3 blocks, and you want to call with block_id being number 2. Also testing by hash would be good. Just be sure to spawn the background devnet with --state-archive-capacity full (see other instances of it).