-
Notifications
You must be signed in to change notification settings - Fork 146
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
#749
base: master
Are you sure you want to change the base?
Conversation
7f4bf55
to
ec26332
Compare
@darioush following your PR, I did another commit to try reducing diffs in cce6eab - what do you think? The only issue with re-using an interface was with Line 285 in cce6eab
Requiring a little wrapper for Or should we stick to the 'new' simple types and no blockContext interface? I would lean towards this since it's our own code, but thought about preserving it too. |
Timestamp()
method on Block typesTimestamp()
method on core/types.Block
Timestamp()
method on core/types.Block
Blocks
's Timestamp()
method
37cbc5c
to
5d7b0c4
Compare
5d7b0c4
to
19f0c6b
Compare
@@ -73,6 +68,7 @@ type Configurator interface { | |||
chainConfig precompileconfig.ChainConfig, | |||
precompileconfig precompileconfig.Config, | |||
state StateDB, | |||
blockContext ConfigurationBlockContext, | |||
blockNumber *big.Int, | |||
blockTime uint64, |
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.
Do we need this blockTime at the end? It doesn't seem used anywhere in subnet-evm. Waiting for a reply on ava-labs/subnet-evm#1429
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.
Let's keep them for symmetry, previously exposed interfaces, and possible future use, imo.
(same comments here ava-labs/subnet-evm#1429 (comment))
- `Time()` does the same as `Timestamp()` - `Time()` is present upstream, not `Timestamp()`
- modify our own custom code: `ApplyPrecompileActivations`, `ApplyUpgrades` to accept a block number + block time and push responsibility of the caller to get the block number and time and inject them
This reverts commit cce6eab.
1156f43
to
940bb2a
Compare
940bb2a
to
85ec7d0
Compare
Why this should be merged
In
core/types
, theBlock
methodTimestamp
does the same as the methodTime
and is not present upstream (this causes small difficulties in #750)How this works
core/types.Block
methodTimestamp()
removedcore/vm
new typePrecompileBlockContext
wrappingBlockContext
with custom methods, in order to have aTime()
method not conflicting theTime
field name.contract.ConfigurationBlockContext
:core.ApplyUpgrades
core.ApplyPrecompileActivations
precompile/modules.Configure
precompile/contract.ConfigurationBlockContext
interface removed and inlined inBlockContext
How this was tested
Existing CI passing
Need to be documented?
No
Need to update RELEASES.md?
No