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(bridge): use deterministic message status slot (w/o mapping) #6861

Merged
merged 18 commits into from
Jan 5, 2023

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jan 3, 2023

This PR was created as a preparation for releaseERC20 and releaseEther. Previously message status are persisted in a mapping which is not convenient to calculate Merkel proof. Now, the slot for saving a message status is calculated as:

keccak256(abi.encodePacked("message_status", signal));

@vercel
Copy link

vercel bot commented Jan 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
bridge-ui 🔄 Building (Inspect) Jan 4, 2023 at 11:35AM (UTC)
website 🔄 Building (Inspect) Jan 4, 2023 at 11:35AM (UTC)

@dantaik dantaik changed the title feat(bridge): allow claim Ether/tokens if message failed feat(bridge): enable releaseEther and releaseERC20 on source bridge Jan 4, 2023
@dantaik dantaik changed the title feat(bridge): enable releaseEther and releaseERC20 on source bridge refactor(bridge): message status no longer use a mapping Jan 4, 2023
@dantaik dantaik changed the title refactor(bridge): message status no longer use a mapping refactor(bridge): allow for deterministic message status slot without using mapping Jan 4, 2023
@dantaik dantaik changed the title refactor(bridge): allow for deterministic message status slot without using mapping refactor(bridge): use deterministic message status slot without using mapping Jan 4, 2023
@dantaik dantaik changed the title refactor(bridge): use deterministic message status slot without using mapping refactor(bridge): use deterministic message status slot (w/o mapping) Jan 4, 2023
@dantaik dantaik marked this pull request as ready for review January 4, 2023 07:33
@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #6861 (d5ca2a4) into main (a8e82d5) will increase coverage by 1.24%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main    #6861      +/-   ##
==========================================
+ Coverage   65.99%   67.24%   +1.24%     
==========================================
  Files         108      109       +1     
  Lines        2929     2940      +11     
  Branches      355      355              
==========================================
+ Hits         1933     1977      +44     
+ Misses        919      886      -33     
  Partials       77       77              
Flag Coverage Δ *Carryforward flag
bridge-ui 95.05% <ø> (ø) Carriedforward from c513734
protocol 60.28% <80.00%> (+2.51%) ⬆️
relayer 69.10% <ø> (ø) Carriedforward from c513734
ui 100.00% <ø> (ø) Carriedforward from c513734

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...s/protocol/contracts/bridge/libs/LibBridgeData.sol 100.00% <ø> (ø)
...rotocol/contracts/bridge/libs/LibBridgeProcess.sol 17.64% <0.00%> (ø)
...protocol/contracts/bridge/libs/LibBridgeSignal.sol 69.56% <80.00%> (ø)
packages/protocol/contracts/bridge/Bridge.sol 66.66% <100.00%> (ø)
.../protocol/contracts/bridge/libs/LibBridgeRetry.sol 94.44% <100.00%> (ø)
...protocol/contracts/bridge/libs/LibBridgeStatus.sol 100.00% <100.00%> (ø)
...l/contracts/test/bridge/libs/TestLibBridgeData.sol 100.00% <100.00%> (ø)
...protocol/contracts/thirdparty/ERC20Upgradeable.sol 61.44% <0.00%> (+10.84%) ⬆️
packages/protocol/contracts/bridge/TokenVault.sol 60.86% <0.00%> (+34.78%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

davidtaikocha
davidtaikocha previously approved these changes Jan 4, 2023
@dantaik dantaik merged commit 915f3fe into main Jan 5, 2023
@dantaik dantaik deleted the claimTokens branch January 5, 2023 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants