Skip to content

Adds support for Zcash NU7 - #154

Merged
karim-en merged 15 commits into
mainfrom
update_nu7
Oct 9, 2026
Merged

karim-en merged 15 commits into
mainfrom
update_nu7

Conversation

@olga24912

Copy link
Copy Markdown
Contributor

Changes

  • Difficulty adjustment by height. After NU7 activation:

    • target block spacing 75s → 25s
    • averaging window 17 → 102 blocks
    • testnet min-difficulty gap 6 → 18 block spacings

    Testnet activation height is 4,465,026. Mainnet height is not set yet (None).

  • Bootstrap instead of initial blocks in init. init now takes only the genesis block (InitArgs.submit_blocks → genesis_block). The history needed for difficulty checks is submitted via submit_blocks until bootstrap_end_height: 12 blocks; 12 + averaging window for Zcash. While bootstrapping:

    • only DAO / UnrestrictedSubmitBlocks can submit
    • blocks must extend the tip
    • PoW checks and GC are skipped
  • Relayer.

    • --init-contract sends only the genesis block
    • compose-zec.yaml runs Zebra instead of zcashd
    • Zcash defaults: sleep_time_on_reach_last_block_sec = 15, max_fork_len = 600
  • Tests. Difficulty is checked against 300 real testnet blocks around the activation.

Upgrade

The state layout changed. Call migrate (no arguments) after deploying to every existing contract, for all chains. Existing contracts get bootstrap_end_height = 0 and keep their current behavior.

Parameters to review

  • nu7_activation_height for mainnet. Set it once it is announced (Oct 20), and deploy before the activation.
  • gc_threshold. It is counted in blocks, so after NU7 the same value covers 3x less time. It must stay ≥ 113 (difficulty window) and ≥ max_fork_len.
  • Confirmations. Integrators calling verify_transaction_inclusion get 3x less time per confirmation.
  • Relayer account role. For new deployments the relayer account needs UnrestrictedSubmitBlocks to bootstrap.
  • Relayer config.
    • Point the endpoint to the Zebra node.
    • Check sleep_time_on_reach_last_block_sec and max_fork_len: explicit config values override the new defaults.
    • Pin the Zebra version.
  • Batch size. A block costs about 17 Tgas after NU7 (estimated), so batches of 15 fit comfortably.

Comment thread btc-types/src/network.rs Outdated
Comment thread contract/src/lib.rs Outdated
Comment thread contract/tests/test_zcash.rs Outdated
Comment thread relayer/README.md Outdated
@karim-en

karim-en commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

let's bump the version

@olga24912
olga24912 requested a review from karim-en October 8, 2026 13:48
Comment thread contract/src/lib.rs
Comment thread btc-types/src/network.rs
@karim-en
karim-en merged commit ee344a4 into main Oct 9, 2026
3 checks passed
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.

3 participants