-
Notifications
You must be signed in to change notification settings - Fork 239
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
chore(core/types): remove Blocks
's Timestamp()
method
#1429
base: master
Are you sure you want to change the base?
Conversation
1926d99
to
1bc820a
Compare
…Number` + `blockTime`
…ber` + `blockTime`
…blockNumber` + `blockTime`
1bc820a
to
2cf8ef3
Compare
@@ -43,10 +44,10 @@ func (*configurator) MakeConfig() precompileconfig.Config { | |||
|
|||
// Configure configures [state] with the given [cfg] precompileconfig. | |||
// This function is called by the EVM once per precompile contract activation. | |||
func (c *configurator) Configure(chainConfig precompileconfig.ChainConfig, cfg precompileconfig.Config, state contract.StateDB, blockContext contract.ConfigurationBlockContext) error { | |||
func (c *configurator) Configure(chainConfig precompileconfig.ChainConfig, cfg precompileconfig.Config, state contract.StateDB, blockNumber *big.Int) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep both the block number and time here even if the time is unused? As we previously exposed this interface in precompile-evm
and it seems it could be used in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, one of the last commits removes the time argument, I wanted to see your opinion on this 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, similar question: what would be the cost to change the function signature in the future?
@@ -21,8 +21,8 @@ type AllowListConfig struct { | |||
} | |||
|
|||
// Configure initializes the address space of [precompileAddr] by initializing the role of each of | |||
// the addresses in [AllowListAdmins]. | |||
func (c *AllowListConfig) Configure(chainConfig precompileconfig.ChainConfig, precompileAddr common.Address, state contract.StateDB, blockContext contract.ConfigurationBlockContext) error { | |||
// the addresses in [AllowListConfig]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep the arguments for this method for symmetry with the other methods (even though unused)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what symmetry you are thinking about? With the Configurator.Configure
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my thought, even though the AllowList is not a precompile it follows through the phases of Configure along with the precompile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related question: what would be the cost of changing the signature of AllowListConfig.Configure if needed in the future? 🤔
2cf8ef3
to
a9b334c
Compare
29c0766
to
d590a04
Compare
Why this should be merged
See ava-labs/coreth#749
How this works
See commit messages, but TLDR:
blockContext
->blockNumber
+blockTime
PrecompileBlockContext
implementing a now changed BlockContext interface (Timestamp -> Time)How this was tested
Existing CI passing
Need to be documented?
Maybe? The template changed 🤔
Need to update RELEASES.md?