Skip to content

feat: add support for Base Token Holder contract in server#4630

Open
Raid5594 wants to merge 75 commits intodraft-v31from
ra/base-token-holder
Open

feat: add support for Base Token Holder contract in server#4630
Raid5594 wants to merge 75 commits intodraft-v31from
ra/base-token-holder

Conversation

@Raid5594
Copy link
Contributor

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?

  • Yes
  • No

Operational changes

Checklist

  • 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.

@@ -1,5 +1,17 @@
genesis_protocol_semantic_version: 0.31.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file might be irrelevant to PR

/// 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([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't you set this in the genesis upgrade? but it might be ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we could set it during genesis upgrade, but I don't think there will be any practical difference.

genesis_protocol_version: null
genesis_root: 0x9470ae067ffd2b8661281c0d7d5a6f57697a1d32cd352f41efea06c696c4136a
genesis_rollup_leaf_index: 107
genesis_batch_commitment: 0x19df9a1ed1b5ddf93f41c38be7cfca4ab35aba92ba926ec7b03a8e3422729b64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[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

@Raid5594 Raid5594 force-pushed the ra/base-token-holder branch from a037fb3 to e1c38c7 Compare January 28, 2026 16:52
@Raid5594 Raid5594 force-pushed the ra/base-token-holder branch from e1c38c7 to 4ed1fd0 Compare January 28, 2026 17:01
zkzoomer and others added 14 commits February 8, 2026 16:05
## 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>
@Raid5594 Raid5594 changed the base branch from draft-v31 to sma/fix-migration-tests February 11, 2026 16:23
kelemeno and others added 5 commits February 12, 2026 12:55
## 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`.
Base automatically changed from sma/fix-migration-tests to draft-v31 February 23, 2026 11:46
@kelemeno kelemeno requested a review from a team as a code owner February 23, 2026 11:46
@kelemeno kelemeno requested review from alexandrst88, artmakh, hatemosphere, iluwaa, onyxet and yorik and removed request for a team February 23, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants