-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow tracking l2 fees for L2-based chains (#2563)
## What ❔ In this PR we add changes to the GasAdjuster needed to track the fees on L2-based chains. The PR aims to preserve type-safety for places that should work when L1 interface is available only, so `DynClient<L1>` is left in a lot of places and generally `L1` is the default network to be used. However, some methods were extended to work with any network. Overall what was added: - A new resource for accessing L2-specific endpoints. - A new field is returned from `fee_history`. Clients should not rely on this field. However, we added it so we could test things. - Some refactoring - While some new new config fields are added into the Rust code, they are not added to the config so that in case something has to be changed, we do not introduce legacy (esp. in protobuf) - Into protobuf we only added `RelayedL2Calldata` pubdata type, which would symbolize that the calldata is being relayed to L1 through another L2. I am pretty confident that this type will be needed anyway. ## Why ❔ ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
1 parent
d40ff5f
commit e3f7804
Showing
63 changed files
with
959 additions
and
413 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,16 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// An enum which is used to describe whether a zkSync network settles to L1 or to the gateway. | ||
/// Gateway is an Ethereum-compatible L2 and so it requires different treatment with regards to DA handling. | ||
#[derive(Default, Debug, Copy, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
pub enum SettlementMode { | ||
#[default] | ||
SettlesToL1, | ||
Gateway, | ||
} | ||
|
||
impl SettlementMode { | ||
pub fn is_gateway(self) -> bool { | ||
matches!(self, Self::Gateway) | ||
} | ||
} |
This file contains 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 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
47 changes: 47 additions & 0 deletions
47
...lib/dal/.sqlx/query-1bfcc02ac79958dcbd20f3680df7517f5d61f7f1472e7d152f575ffd56ad8633.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
...lib/dal/.sqlx/query-83a931ceddf34e1c760649d613f534014b9ab9ca7725e14fb17aa050d9f35eb8.json
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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.