-
Notifications
You must be signed in to change notification settings - Fork 206
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
CIP-31 - BLS12-381 Precompiles #1279
Conversation
hey @kilic, I'm starting to shephard client integration. :) Can you please do the following:
|
redefine precompileaddresses in tests
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.
First pass, generally looks good, but do remember to charge gas. This also applies to the PR for BLS12-377
} | ||
|
||
func (c *bls12381G1Add) Run(input []byte, caller common.Address, evm *EVM, gas uint64) ([]byte, uint64, error) { | ||
// Implements EIP-2537 G1Add 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.
FYI the first step of any pre-compile function should be to debit the gas
Example code:
gas, err := debitRequiredGas(c, input, gas)
if err != nil {
return nil, gas, err
}
Closed in favor of #1340 |
Description
This PR adds BLS12-381 elliptic curve precompiles as defined in EIP-2537.
Other changes
PrecompiledContractsDonut
Tested
Underlying elliptic curve library is heavily tested in terms of mathematical properties.
Original library BLS12-381 is subjected to the security audit under drand project and also made its way to be backend of EIP-2537 go-ethereum precompiles.