-
Couldn't load subscription status.
- Fork 113
feat(l2): shared bridge router contract #4834
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
Open
ManuelBilbao
wants to merge
42
commits into
main
Choose a base branch
from
shared_bridge_router
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
caea86a
Create router contract
ManuelBilbao 2284147
Add router feature to contracts
ManuelBilbao d3d9985
Add router to deployer
ManuelBilbao a023188
Update contracts
ManuelBilbao 109e234
Send messages across L2s
ManuelBilbao 508438a
Merge branch 'main' into shared_bridge_router
ManuelBilbao f104f5c
Fix merge
ManuelBilbao 018a63d
Burn gas in src L2
ManuelBilbao dfdb8ea
Merge branch 'main' into shared_bridge_router
ManuelBilbao a57fead
Change contracts flow
ManuelBilbao 21ad3aa
Add contracts docs
ManuelBilbao 1901b1d
Improve documentation
ManuelBilbao 1a99f05
Revert changes
ManuelBilbao c220c3e
Add docs
ManuelBilbao d937327
Move router contract to main path
ManuelBilbao 19df3e8
Refactor deployer
ManuelBilbao 81fbdd9
Merge branch 'main' into shared_bridge_router
ManuelBilbao 78011eb
Fix event signature
ManuelBilbao 0bc4f04
Update genesis L2
ManuelBilbao b102114
Add L2toL2Messages to store
ManuelBilbao f127bdc
Implement L2toL2Messages in block fetcher
ManuelBilbao d55eed5
Implement get L2->L2 messages for SQL store
ManuelBilbao 12bc29c
Remove unwraps
ManuelBilbao 29cac02
Merge branch 'main' into shared_bridge_router
ManuelBilbao b5b3a76
Fix sql
ManuelBilbao f3f083a
Fix wording
ManuelBilbao 41b8adc
Merge branch 'main' into shared_bridge_router
ManuelBilbao 7c826ed
Add preliminar shared bridge documentation
ilitteri af2558d
Merge branch 'main' into shared_bridge_router
ManuelBilbao 0b35959
Apply format suggestion
ManuelBilbao 17e3f1f
Apply format suggestion
ManuelBilbao 02d20de
Rename shared bridge variable
ManuelBilbao 54010cf
Rename message_hashes field
ManuelBilbao 36463e3
Fix missing rename
ManuelBilbao c806c25
Fix tests
ManuelBilbao 8f95d80
Unlink router and OCP
ManuelBilbao 089e3df
Fix deposit when no calldata
ManuelBilbao 486e5aa
Merge branch 'main' into shared_bridge_router
ManuelBilbao df9c9d8
Merge branch 'main' into shared_bridge_router
ManuelBilbao 425dbd7
Merge branch 'main' into shared_bridge_router
ManuelBilbao 9be647d
Fix: store L2->L2 txs when sealing batch
ManuelBilbao 5329629
Fix based commitment transaction
ManuelBilbao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| pub mod batch; | ||
| pub mod fee_config; | ||
| pub mod l2_to_l2_message; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| use bytes::Bytes; | ||
| use ethereum_types::{Address, U256}; | ||
| use ethrex_rlp::{decode::RLPDecode, structs::Decoder}; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| #[derive(Debug, Clone, Default, Serialize, Deserialize)] | ||
| /// Represents a message from the L2 to another L2 | ||
| pub struct L2toL2Message { | ||
| /// Chain id of the destination chain | ||
| pub chain_id: U256, | ||
| /// Address that originated the transaction | ||
| pub from: Address, | ||
| /// Address of the recipient in the destination chain | ||
| pub to: Address, | ||
| /// Amount of ETH to send to the recipient | ||
| pub value: U256, | ||
| /// Gas limit for the transaction execution in the destination chain | ||
| pub gas_limit: U256, | ||
| /// Calldata for the transaction in the destination chain | ||
| pub data: Bytes, | ||
| } | ||
|
|
||
| impl RLPDecode for L2toL2Message { | ||
| fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), ethrex_rlp::error::RLPDecodeError> { | ||
| let decoder = Decoder::new(rlp)?; | ||
|
|
||
| let (chain_id, decoder) = decoder.decode_field("chain_id")?; | ||
| let (from, decoder) = decoder.decode_field("from")?; | ||
| let (to, decoder) = decoder.decode_field("to")?; | ||
| let (value, decoder) = decoder.decode_field("value")?; | ||
| let (gas_limit, decoder) = decoder.decode_field("gas_limit")?; | ||
| let (data, decoder) = decoder.decode_field("data")?; | ||
|
|
||
| Ok(( | ||
| L2toL2Message { | ||
| chain_id, | ||
| from, | ||
| to, | ||
| value, | ||
| gas_limit, | ||
| data, | ||
| }, | ||
| decoder.finish()?, | ||
| )) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.