-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add in BlockType
enum for controlling block number during emulation
#418
Comments
I'll take this, and add it to #417 |
I just saw this now -- we should not add it to that PR. We should do it the right way and introduce it a bit later. |
I think we should handle this differently after the other feedback to include the ability to mine blocks with some kind of admin control. I can add this in the middleware. |
Option
for incrementing block numberOption
for incrementing block number
I think we should externalize this more and make it more than just an Option. Perhaps an enum for this along the lines of: pub enum BlockType {
UserControlled,
Randomized(f64, u32),
None,
}
This |
Option
for incrementing block numberBlockType
enum for controlling block number during emulation
Idea
Updated from a comment below:
I think we should externalize this more and make it more than just an Option. Perhaps an enum for this along the lines of:
UserControlled
: will give the user the ability to make calls such asclient.mine_block()
andclient.set_block_timestamp()
.Randomized(f64, u32)
: would give the user the the Poisson chosen block sizes with the block rate via thef64
inner and we would let the block times update via theu32
inner.None
: The user would not update the blocks ever.This
BlockType
can go into theEnvironmentParameters
.Other details
We should probably try to implement this in some sort of RPC-like way such as listed in the Anvil documentation. For example, we can implement the request:
We should link this issue to #464.
Since blocks are not actually mined per se, we can maybe just implement a method on the
RevmMiddleware
such asnext_block
so that any clients may access this.For those who will not need this feature, having the block number increment is just another chance for a bug a bit of overhead. Also, it relies on the user knowing what the block rate setting is doing.- [ ] Add in an option for therate_parameter
when creating an environment.The text was updated successfully, but these errors were encountered: