-
Notifications
You must be signed in to change notification settings - Fork 154
feat(l2): pay base fee to fee vault #4536
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
Merged
Merged
Changes from 45 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
40948ec
feat(l2): pay base fee to coinbase
MegaRedHand 875ed1b
Revert "feat(l2): pay base fee to coinbase"
avilagaston9 2f11290
feat(l2): pay base_fee to fee_vault
avilagaston9 a99d587
Add fee_vault to blockchain
avilagaston9 d6a8571
Update modules to use fee_vault
avilagaston9 92319c0
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 107336d
Impplement feeVault endpoint
avilagaston9 c562dd2
Update replay to use fee_vault
avilagaston9 2fb0a58
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 c51c603
Fix tdx
avilagaston9 002f151
Rename fee vault to coinbase in tests
avilagaston9 605f14a
Fix linter
avilagaston9 bb68f7f
Update tests
avilagaston9 33930ee
Fix workflow
avilagaston9 57e8526
Fix integration tests
avilagaston9 818eb12
Fix based workflow
avilagaston9 d7b02b9
Remove fee_Vault from add_block
avilagaston9 df483ca
Rename base_fees to priority fees in test
avilagaston9 d29b1a0
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 e7ffedd
Update cli.md
avilagaston9 061a617
Add disclaimer to docs
avilagaston9 80d57dc
Move fee_vault to blockchain struct
avilagaston9 7beb781
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 9aa0407
Fix linter
avilagaston9 6445c83
Use cfg! macro to resolve fee_vault
avilagaston9 9ae2402
separate payload builder interfaces
avilagaston9 65da300
Store fee_vault in l2_hook
avilagaston9 ef38d69
Improve docs
avilagaston9 4316a28
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 7c692f2
Add disclaimer
avilagaston9 39d3a1b
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 a564e8a
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 8f57e41
Add fee_config to blockchain and vm l2 type
avilagaston9 df122ef
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 2846e16
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 3b3d001
Fix ethrex replay for l2
avilagaston9 aa01211
Fix tdx build
avilagaston9 9eaf648
Minor improvements
avilagaston9 d4dc659
Fix linter
avilagaston9 a364d37
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 0075f72
Update docs
avilagaston9 4b536c2
Remove extra line
avilagaston9 39109f6
Update summary
avilagaston9 a02fcde
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 ddb9a95
Restore replay
avilagaston9 ca0ce92
restore MAX_MEMPOOL_SIZE_DEFAULT
avilagaston9 39c196f
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 7172748
Fix clippy
avilagaston9 652fa08
Restore genesis
avilagaston9 4eafeb4
register default fee vault pk
avilagaston9 950540e
Skip fee vault check in l2 dev tests
avilagaston9 11c9789
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 749fda6
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 1b71dd7
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 c22ffc2
Free disk space in based
avilagaston9 29cacdf
Restore based workflow
avilagaston9 26e34c0
Merge based workflow in matrix
avilagaston9 704d9e6
Removed based from all-test
avilagaston9 e098174
Install rex in based
avilagaston9 e034fdc
Don't set fee vault in based
avilagaston9 fa54633
Merge branch 'main' into l2/dont-burn-base-fee
avilagaston9 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
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
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,2 @@ | ||
| pub mod batch; | ||
| pub mod fee_config; |
5 changes: 1 addition & 4 deletions
5
crates/common/types/batch.rs → crates/common/types/l2/batch.rs
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,26 @@ | ||
| use ethereum_types::Address; | ||
| use rkyv::{Archive, Deserialize as RDeserialize, Serialize as RSerialize}; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| use crate::rkyv_utils::{H160Wrapper, OptionH160Wrapper}; | ||
|
|
||
| #[derive( | ||
| Serialize, Deserialize, RDeserialize, RSerialize, Archive, Clone, Copy, Debug, Default, | ||
| )] | ||
| pub struct FeeConfig { | ||
| /// If set, the base fee is sent to this address instead of being burned. | ||
| #[rkyv(with=OptionH160Wrapper)] | ||
| pub fee_vault: Option<Address>, | ||
ManuelBilbao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pub operator_fee_config: Option<OperatorFeeConfig>, | ||
| } | ||
|
|
||
| /// Configuration for operator fees on L2 | ||
| /// The operator fee is an additional fee on top of the base fee | ||
| /// that is sent to the operator fee vault. | ||
| /// This is used to pay for the cost of running the L2 network. | ||
| #[derive(Serialize, Deserialize, RDeserialize, RSerialize, Archive, Clone, Copy, Debug)] | ||
| pub struct OperatorFeeConfig { | ||
| #[rkyv(with=H160Wrapper)] | ||
| pub operator_fee_vault: Address, | ||
| pub operator_fee: u64, | ||
| } | ||
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
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| use serde_json::Value; | ||
|
|
||
| use crate::{ | ||
| rpc::{RpcApiContext, RpcHandler}, | ||
| utils::RpcErr, | ||
| }; | ||
|
|
||
| pub struct GetFeeVaultAddress; | ||
|
|
||
| impl RpcHandler for GetFeeVaultAddress { | ||
| fn parse(_params: &Option<Vec<Value>>) -> Result<GetFeeVaultAddress, RpcErr> { | ||
| Ok(GetFeeVaultAddress) | ||
| } | ||
|
|
||
| async fn handle(&self, context: RpcApiContext) -> Result<Value, RpcErr> { | ||
| let fee_vault_address = match context.l1_ctx.blockchain.options.r#type { | ||
| ethrex_blockchain::BlockchainType::L1 => None, | ||
| ethrex_blockchain::BlockchainType::L2(fee_config) => fee_config.fee_vault, | ||
| }; | ||
|
|
||
| Ok( | ||
| serde_json::to_value(fee_vault_address.map(|addr| format!("{:#x}", addr))).map_err( | ||
| |e| { | ||
| ethrex_rpc::RpcErr::Internal(format!( | ||
| "Failed to serialize fee vault address: {}", | ||
| e | ||
| )) | ||
| }, | ||
| )?, | ||
| ) | ||
| } | ||
| } |
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,3 +1,4 @@ | ||
| pub mod batch; | ||
| pub mod fee_vault; | ||
| pub mod l1_message; | ||
| pub mod transaction; |
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
Oops, something went wrong.
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.