0xSpaceShard / starknet-devnet-rs

A local testnet for Starknet... in Rust
https://0xspaceshard.github.io/starknet-devnet-rs/
MIT License
107 stars 62 forks source link

Make `self.blocks.pending_block` optional and refactor of restart_pending_block() logic #445

Closed mikiw closed 5 months ago

mikiw commented 6 months ago

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

muheebyusufbaba1 commented 6 months ago

I'll like to hop on this

mikiw commented 6 months ago

I recommend to find something else

ivpavici commented 6 months ago

@muheebyusufbaba1 please just consider tasks with the "ODHack" label :)

muheebyusufbaba1 commented 6 months ago

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

mikiw commented 6 months ago

since this task is related to https://github.com/0xSpaceShard/starknet-devnet-rs/pull/430 after my vacation I'll also check:

FabijanC commented 6 months ago

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

mikiw commented 6 months ago
  • 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

mikiw commented 6 months ago
  • 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

mikiw commented 5 months ago

I planned to do the same refactoring to pending_state in StarknetState but now it seems it's necessary

mikiw commented 5 months ago

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