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

feat: support Arbitrum L2->L1 post dispatch hook #3853

Merged
merged 30 commits into from
Jul 3, 2024
Merged

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented May 27, 2024

Description

  • Contract support for the enabling postDispatch hook with the Arbitrum nitro bridge from L2 to L1
    • asynchronously via executeTransaction call to verifyMessageId first and then the relayer calling the verify message with no metadata (note: this supports msg.value)
    • synchronously via a single verify call which in turn calls executeTransaction on outbox to gets the message verified in the verifyMessageId (note: this doesn't support msg.value as ism.verify isn't payable)
    • Added a script for deploying the hook and ISM since the sdk doesn't support it yet.

Drive-by changes

  • changing the type from "rate_limited_hook" to "RATE_LIMITED" to maintain consistency

Related issues

Backward compatibility

Yes

Testing

Unit and e2e with arbitrumsepolia->sepolia

Copy link

changeset-bot bot commented May 27, 2024

⚠️ No Changeset found

Latest commit: 7bdcf5d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (c3c002a) to head (7bdcf5d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3853   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          1       1           
  Lines         14      14           
=====================================
  Misses        14      14           
Components Coverage Δ
core ∅ <ø> (∅)
hooks ∅ <ø> (∅)
isms ∅ <ø> (∅)
token ∅ <ø> (∅)
middlewares ∅ <ø> (∅)

solidity/script/DeployArbHook.s.sol Fixed Show fixed Hide fixed
solidity/script/DeployArbHook.s.sol Fixed Show fixed Hide fixed
solidity/script/DeployArbHook.s.sol Fixed Show fixed Hide fixed
solidity/contracts/hooks/ArbL2ToL1Hook.sol Fixed Show fixed Hide fixed
solidity/package.json Outdated Show resolved Hide resolved
solidity/remappings.txt Outdated Show resolved Hide resolved
solidity/test/isms/ArbL2ToL1Ism.t.sol Outdated Show resolved Hide resolved
solidity/test/isms/ArbL2ToL1Ism.t.sol Show resolved Hide resolved
solidity/contracts/hooks/ArbL2ToL1Hook.sol Outdated Show resolved Hide resolved
@aroralanuk aroralanuk marked this pull request as ready for review June 14, 2024 07:55
Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

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

I think we need to be slightly careful about this "caching" layer
we only want to write to the cache after someone has successfully called the outbox.executeTransaction

solidity/contracts/hooks/ArbL2ToL1Hook.sol Outdated Show resolved Hide resolved
solidity/contracts/hooks/ArbL2ToL1Hook.sol Show resolved Hide resolved
solidity/contracts/isms/hook/ArbL2ToL1Ism.sol Outdated Show resolved Hide resolved
solidity/contracts/isms/hook/ArbL2ToL1Ism.sol Outdated Show resolved Hide resolved
@aroralanuk aroralanuk enabled auto-merge July 2, 2024 19:53
@aroralanuk aroralanuk added this pull request to the merge queue Jul 3, 2024
Merged via the queue into main with commit f733379 Jul 3, 2024
38 of 39 checks passed
@aroralanuk aroralanuk deleted the kunal/arb-l2-l1-hook branch July 3, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arbitrum/Orbit L2 => L1 Hook and ISM
2 participants