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(precompiles): EIP-7212: secp256r1 curve #1922
Conversation
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.
LGTM! One last thing I did is add the bech32 address to the slice so the address can't accept transfers. Added in precompiles/common/types.go
@@ -189,6 +191,11 @@ func (n *IntegrationNetwork) GetChainID() string { | |||
return n.cfg.chainID | |||
} | |||
|
|||
// GetEIP155ChainID returns the network EIp-155 chainID number |
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.
// GetEIP155ChainID returns the network EIp-155 chainID number | |
// GetEIP155ChainID returns the network EIP-155 chainID number |
@@ -25,6 +28,7 @@ func DefaultConfig() Config { | |||
account, _ := testtx.NewAccAddressAndKey() | |||
return Config{ | |||
chainID: utils.MainnetChainID + "-1", | |||
eip155ChainID: big.NewInt(9001), |
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.
Why this hardcoded number? The const used at the line above has this docstring:
// MainnetChainID defines the Evmos EIP155 chain ID for mainnet
MainnetChainID = "evmos_9001"
Isn't this one the eip155 chain id?
@@ -0,0 +1,82 @@ | |||
// Copyright 2014 The go-ethereum Authors |
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.
Is it correct this copyright?
// See https://eips.ethereum.org/EIPS/eip-7212 for details | ||
type Precompile struct{} | ||
|
||
// Address defines the address of the staking compile contract. |
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.
// Address defines the address of the staking compile contract. | |
// Address defines the address of the p256 compile contract. |
// Address defines the address of the staking compile contract. | ||
// address: 0x0000000000000000000000000000000000000013 | ||
func (Precompile) Address() common.Address { | ||
return common.BytesToAddress([]byte{19}) |
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.
Why don't we use the address as a const instead of passing []byte{19}?
Hello! Thanks and congrats on the very first implementations on the EIP-7212. I am not sure if it's available on the mainnet now, I couldn't see in the documentation, but I just wanted to take attention of the current status of the EIP-7212. The original EIP is currently on the Review phase which means that it can have significant changes on the implementation. At the same time, the proposal is being discussed in the RollCall's to standardize it as an RIP to be integrated by the EVM-like rollups. Then, most of the rollups are planning implement it to their protocol without waiting the EIP. We are planning to finalize the decision in the next RollCall at the 13th of the December. I recommend you to follow this discussion to have an identical version with most of the other EVMs. Also, we have a PR to change the implementation address, it's not merged. I think that it's good to follow the RIP discussions for the address selection as the address will be blocked for this specific precompile and will prevent overlaps in the general ecosystem. |
Hello! I am happy to share that the specification of the proposal has been finalized by moving into the RIPs repository and the last changes will be applied with this PR. The |
Thanks for the update @ulerdogan! 🙏 we'll adjust the implementation address accordingly. |
Description
Integrates EIP-7212 as a precompile. Uses ethereum/go-etherum#27540 as reference
Closes #XXX