feat: add support for Base Token Holder contract in server#4630
feat: add support for Base Token Holder contract in server#4630
Conversation
etc/env/file_based/genesis.yaml
Outdated
| @@ -1,5 +1,17 @@ | |||
| genesis_protocol_semantic_version: 0.31.0 | |||
There was a problem hiding this comment.
This file might be irrelevant to PR
core/lib/types/src/storage/mod.rs
Outdated
| /// The initial balance of the BaseTokenHolder contract (2^127 - 1). | ||
| /// This value is used in L2BaseToken.totalSupply() calculation: | ||
| /// totalSupply = INITIAL_BASE_TOKEN_HOLDER_BALANCE - balance[BASE_TOKEN_HOLDER_ADDRESS] | ||
| pub const INITIAL_BASE_TOKEN_HOLDER_BALANCE: U256 = U256([ |
There was a problem hiding this comment.
can't you set this in the genesis upgrade? but it might be ok
There was a problem hiding this comment.
Yes, we could set it during genesis upgrade, but I don't think there will be any practical difference.
etc/env/file_based/genesis.yaml
Outdated
| genesis_protocol_version: null | ||
| genesis_root: 0x9470ae067ffd2b8661281c0d7d5a6f57697a1d32cd352f41efea06c696c4136a | ||
| genesis_rollup_leaf_index: 107 | ||
| genesis_batch_commitment: 0x19df9a1ed1b5ddf93f41c38be7cfca4ab35aba92ba926ec7b03a8e3422729b64 |
There was a problem hiding this comment.
these were removed, you need to run zkstackup --local probably and do regensis. Changes should be minimal here
| } | ||
| self.0.insert( | ||
| "prover.recursion_scheduler_level_vk_hash", | ||
| "prover.snark_wrapper_vk_hash", |
There was a problem hiding this comment.
why is this change needed?
There was a problem hiding this comment.
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct L1VerifierConfig {
// Rename is required to not introduce breaking changes in the API for existing clients.
#[serde(
alias = "recursion_scheduler_level_vk_hash",
rename(serialize = "recursion_scheduler_level_vk_hash")
)]
pub snark_wrapper_vk_hash: String,
pub fflonk_snark_wrapper_vk_hash: Option,
}
It is using aliasing for reading, so we'll just write the renamed version straightaway
a037fb3 to
e1c38c7
Compare
e1c38c7 to
4ed1fd0
Compare
This reverts commit e55d6b1.
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`. --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
## What ❔ matter-labs/era-contracts#2019 <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`.
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`.
## What ❔ Uses contracts from matter-labs/era-contracts#1993. They add additional protections for chains migrating to and from gateway as well as during withdrawal verification. No new server functionality should be required. ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`.
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## 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 `zkstack dev fmt` and `zkstack dev lint`.
What ❔
Add support for Base Token Holder contract in server.
Why ❔
Base tokens have to be minted to the contract at genesis.
Is this a breaking change?
Operational changes
Checklist
zkstack dev fmtandzkstack dev lint.