starknet-devnet-rs
starknet-devnet-rs copied to clipboard
Make `self.blocks.pending_block` optional and refactor of restart_pending_block() logic
related to https://github.com/0xSpaceShard/starknet-devnet-rs/pull/430
Currently if you run devnet with --blocks-on-demand and do starknet_call with block_id=pending and there is no pending block, it will not default to latest
I'll like to hop on this
I recommend to find something else
@muheebyusufbaba1 please just consider tasks with the "ODHack" label :)
I don't think there's any ODHack issue left for me to work on :/ But if you will add new ODHack issues, I am up for it @ivpavici
since this task is related to https://github.com/0xSpaceShard/starknet-devnet-rs/pull/430 after my vacation I'll also check:
- ~~abort of pending block, this should not be possible~~
- defaulting to the latest state in case calls are done on pending (and there is no pending)
- check if blocks_on_demand can be removed from StarknetBlocks during this refactor of restart_pending_block()
- ~~clarify if declaring, deploying, and invoking the same contract can be done in one block in Starknet? (Also this problem is related to nonce implementation)~~
also to note: In devnet-py we always had a pending state which, on block creation, would get converted to latest state. Block creation was done after each tx in normal mode and on demand in blocks-on-demand mode.
Currently we are treating this pending state differently (maybe due to some language or blockifier limitations, not sure) - there are several checks if mode is on-demand or not
- clarify if declaring, deploying, and invoking the same contract can be done in one block in Starknet? (Also this problem is related to nonce implementation)
regarding that it should be possible
- clarify if declaring, deploying, and invoking the same contract can be done in one block in Starknet? (Also this problem is related to nonce implementation)
regarding that it should be possible
addressed in https://github.com/0xSpaceShard/starknet-devnet-rs/commit/bcd68e71afdee71cb19594fb88e1ec2f232f362c
I planned to do the same refactoring to pending_state in StarknetState but now it seems it's necessary
Actually, after consultation with starkware, we realized that this should work differently. This PR will address that https://github.com/0xSpaceShard/starknet-devnet-rs/pull/480 (Please check Development related changes).