starknet-devnet-rs icon indicating copy to clipboard operation
starknet-devnet-rs copied to clipboard

Test old state support

Open FabijanC opened this issue 2 years ago • 5 comments

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 avatar Jul 25 '23 14:07 FabijanC

@FabijanC please can you add more description and what to do for this issue? It will be my pleasure to tackle it

vibenedict avatar Apr 22 '24 06:04 vibenedict

@vibenedict description updated

FabijanC avatar Apr 22 '24 07:04 FabijanC

@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.

FabijanC avatar Apr 22 '24 09:04 FabijanC

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

vibenedict avatar Apr 24 '24 14:04 vibenedict

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).

FabijanC avatar Apr 24 '24 15:04 FabijanC