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

Refactor TokenBridge to use transient storage for the ReentrancyGuard implementation #610

Open
3 of 8 tasks
kyzooghost opened this issue Jan 28, 2025 · 0 comments
Open
3 of 8 tasks
Assignees
Labels
Contracts Smart Contract related P2: Medium Issue priority: medium

Comments

@kyzooghost
Copy link
Contributor

kyzooghost commented Jan 28, 2025

Description

Refactor TokenBridge to use transient storage for the ReentrancyGuard implementation. Existing ReentrancyGuard implementation using transient storage exist in:

Note that transient storage is only available from Cancun, and currently all our L2 contracts are compiled for London. This is because we can generate ZK proofs for execution traces using London EVM rules.

Motivation

More gas efficient implementation of ReentrancyGuard

Tasks

  • Refactor TokenBridge to use transient storage for the ReentrancyGuard implementation

Acceptance criteria

  • Passing unit test for new implementation of ReentrancyGuard

Risks

If we compile the TokenBridge with EVM_VERSION: cancun, then we should eventually compile all L2 contracts with EVM_VERSION: cancun to minimize version skew. If however the prover is then unable to generate proofs of Cancun EVM execution, then finalization of L2->L1 messages should fail. The E2E tests should capture this.

  • E2E tests will break if provers are unable to generate proofs of Cancun EVM execution
  • Version skew of L2 contracts - some L2 contracts compile in London, other L2 contracts compile in Cancun
  • Upgrades of deployed contracts should not occur without i.) No version skew, ii.) provers being able to generate Cancun EVM execution proofs

Remember to

  • Add the documentation label in case there is an impact on the documentation
  • Add priority and team labels
  • Add Task for updating the Runbook or adding/updating existing metrics and alerts.
@kyzooghost kyzooghost added Contracts Smart Contract related P2: Medium Issue priority: medium labels Jan 28, 2025
@kyzooghost kyzooghost self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contracts Smart Contract related P2: Medium Issue priority: medium
Projects
None yet
Development

No branches or pull requests

1 participant