-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add precompiles to support signature checking on provided and historic headers #772
Conversation
…tor/slashing-precompiles
…tor/slashing-precompiles
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.
Please update the "Other changes" section of the PR
@@ -691,7 +729,7 @@ func (c *blockNumberFromHeader) Run(input []byte, caller common.Address, evm *EV | |||
var header types.Header | |||
err = rlp.DecodeBytes(input, &header) | |||
if err != nil { | |||
return nil, gas, err | |||
return nil, gas, ErrInputDecode |
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 worried that returning a different error will mean we won't log the more informative 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.
It's my understanding that errors returned from the EVM need to be deterministic so I wanted to avoid relaying error messages that may change in future updates.
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.
Interesting, why do they need to be deterministic?
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 had just assumed error messages to be included under the umbrella of EVM determinism, but maybe they aren't. If not, I'm happy to put the rlp errors back.
Description
This PR modifies the
getValidatorAddress
andnumberValidators
precompiles accept a block number to query a historic validator set, and adds theTested
Unit tests
Other changes
VerifySeal
function on the Istanbul consensus engine to have a more useful verification of the seal. (The previous definition was an incomplete implementation of verification and was almost certainly implemented to satisfy theconsensus.Engine
interface.)core/evm.go
tocore/vm/context.go
to allow code sharing withcontract_comm/evm.go
and testing incore/vm/contracts_test.go
Related issues
Backwards compatibility
Not backwards compatible due to a change in the validator set precompiles.