Skip to content
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 Precompile for secp256r1 conditionally based on ArbOS version #303

Merged
merged 13 commits into from
Apr 29, 2024

Conversation

anodar
Copy link
Contributor

@anodar anodar commented Apr 15, 2024

@cla-bot cla-bot bot added the s CLA signed label Apr 15, 2024
@anodar anodar marked this pull request as ready for review April 15, 2024 11:19
@PlasmaPower PlasmaPower self-requested a review April 15, 2024 16:33
return PrecompiledAddressesArbitrum
var ret []common.Address
if rules.ArbOSVersion >= 30 {
ret = append(ret, PrecompiledAddressesP256Verify...)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This is called every tx, so I think we should consider caching this as PrecompiledAddressesArbOS30 or such
  • We also need to update the EVM's precompile method in core/vm/evm.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated evm's precompile as well and introduced PrecompiledAddresses[/Contracts]ArbOS30 that is populated in geth hook (OffchainLabs/nitro#2239).

Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just might need to remove PrecompiledAddressesP256Verify if it isn't used

PrecompiledAddressesIstanbul []common.Address
PrecompiledAddressesByzantium []common.Address
PrecompiledAddressesHomestead []common.Address
PrecompiledAddressesP256Verify []common.Address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this? looks like we include those addresses in PrecompiledAddressesArbOS30 instead

Copy link
Collaborator

@PlasmaPower PlasmaPower Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, I think it might've been needed in an older version of how precompile activation worked

Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PlasmaPower PlasmaPower merged commit 41e40f1 into master Apr 29, 2024
3 of 4 checks passed
@PlasmaPower PlasmaPower deleted the secp256r1-precompile branch April 29, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants