Skip to content

refactor: move L1 network defaults source of truth to l1-contracts#24434

Open
fcarreiro wants to merge 1 commit into
merge-train/spartanfrom
fc/foundation-network-defaults
Open

refactor: move L1 network defaults source of truth to l1-contracts#24434
fcarreiro wants to merge 1 commit into
merge-train/spartanfrom
fc/foundation-network-defaults

Conversation

@fcarreiro

@fcarreiro fcarreiro commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Prep for the foundation / node / fairies repo split: make l1-contracts own the canonical L1 contract configuration defaults instead of deriving them from spartan/environments/network-defaults.yml. The new source of truth is l1-contracts/scripts/network-defaults.json, published via @aztec/l1-artifacts and consumed directly by both the Solidity deploy scripts and @aztec/ethereum. This flips the dependency to spartan → l1-contracts, the right direction for the split.

Worth noting is that now the defaults in @aztec/ethereum read from the JSON in @aztec/l1-artifacts and NOT from the yml files. IIUC the yml files are for kubernetes deployment and this change would not affect someone that wants to run a docker image with a sequencer/prover.

Changes

  • Add l1-contracts/scripts/network-defaults.json as the committed, canonical set of L1 contract defaults. This replaces the gitignored l1-contracts/generated/default.json that used to be generated from the yaml at bootstrap. It also adds the parameters RollupConfiguration.sol reads that were previously only defaulted in Solidity (AZTEC_SLASHING_QUORUM, AZTEC_ENTRY_QUEUE_*).
  • Publish the JSON through @aztec/l1-artifacts (new package export + copied into the bundled foundry subtree by copy-foundry-artifacts.sh).
  • @aztec/ethereum's config now imports the JSON from @aztec/l1-artifacts directly (import … with { type: 'json' }). Deleted the generated l1-contracts-defaults.ts and its generator (scripts/generate.sh), and dropped ethereum from the yarn-project bootstrap generate step.
  • l1-contracts/scripts/load_network_defaults.sh now reads the JSON — network-agnostic, no network argument, no yaml. spartan's deploy_rollup_upgrade.sh switches to spartan's own network-aware yaml loader for its per-network needs.
  • foundry.toml fs_permissions and the deploy .t.sol scripts read from scripts/network-defaults.json.
  • The l1-contracts section of network-defaults.yml is now a hand-synced mirror of the JSON (it still feeds the slasher / cli generators and the networks presets). Docs updated: spartan/CLAUDE.md, the yaml header, and the governance rollup-upgrade tutorial.
  • RollupConfiguration.sol now reads parameters via vm.envUint/envBool (required) instead of vm.envOr (silent Solidity fallback). Consequently the deploy-script tests (DeployAztecL1Contracts.t.sol, DeployRollupForUpgrade.t.sol) now forward those env vars from the JSON in setUp().

Behaviour change in l1-contracts tests

The tests now use the values in the network-agnostic JSON and therefore do NOT use the same values as before (devnet).

Testing

  • l1-contracts: forge test passes for both deploy suites — DeployAztecL1ContractsTest::test_SmokeTest and DeployRollupForUpgradeTest::test_DeployThenUpgrade.
  • @aztec/ethereum: builds cleanly; DefaultL1ContractsConfig loads from the JSON at runtime with exact bigint threshold values (no precision loss).

Closes https://linear.app/aztec-labs/issue/A-1358/decouple-spartan-network-configuration-and-l1-contracts

@fcarreiro fcarreiro force-pushed the fc/foundation-network-defaults branch 2 times, most recently from 2dee6a4 to a896ac0 Compare July 1, 2026 16:24
@fcarreiro fcarreiro force-pushed the fc/foundation-network-defaults branch from a896ac0 to 407ab69 Compare July 1, 2026 17:13
@AztecBot

AztecBot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/95ebff2feed46e35�95ebff2feed46e358;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/preferred_gossip_network.test.ts (199s) (code: 0) group:e2e-p2p-epoch-flakes

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.

2 participants