Skip to content

Local network: L2 finality trails ~32 blocks behind head, so one account stalls on the PXE tagging window after 27 private transfers #25474

Description

@1ll-main

Aztec version: 5.2.0 (aztec start --local-network, CLI wallet), Linux x86_64. Not run on nightly, but v6.0.0-nightly.20260910 has the same anvil launch line and the same window (84).

What happens

One account uses the bundled Token and calls transfer(self, 1) in a loop. The 28th transfer fails with:

Highest used index 84 is at or past the window end 84 (no index finalized yet). Tagging window length 84 is configured too low. Contact the Aztec team to increase it!

Retrying fails the same way. At that point the chain tips were proposed=34 proven=34 finalized=2, and the account's first tx on this tagging secret was in block 7.

Why

  • The local network starts anvil with default settings: anvil --silent --port "$ANVIL_PORT" in yarn-project/aztec/scripts/aztec.sh (now in aztec-labs-eng/aztec-node). L1 finalized is therefore latest - 64.
  • Anvil mines only when an L1 tx arrives (automine, as the Local Network RFC Local Network requirements #23258 describes), which came to about 2 L1 blocks per L2 block here. The L2 finalized tip ends up about 32 blocks behind the head.
  • Each self-transfer uses 3 tag indexes (the mint uses 1), so the account fills the 84-index window before any of its txs finalize.
  • On an idle local network nothing else advances L1, so it never recovers on its own.

Evidence

  • Mining 70 L1 blocks (JSON-RPC anvil_mine) moved L2 finalized from 2 to 34, and the same wallet DB then sent 5 more transfers.
  • With anvil pre-started on 8545 as anvil --silent --port 8545 --slots-in-an-epoch 1 (the wrapper's own anvil then fails to bind), 60 transfers in a row succeeded, with finalized one block behind the head.

Possibly missed in #21156

#21156 replaced the finalized-block heuristic (provenBlock - 2 * epochDuration) with L1 finality. It also gave the test helper startAnvil a --slots-in-an-epoch 1 default, "so the finalized block advances immediately, making tests that check L1-finality-based logic work without needing hundreds of mined blocks". aztec.sh already had the local-network anvil line then, and that PR didn't change it. The Local Network RFC (#23258) expects blocks to become proven near-immediately but doesn't mention finality.

If this is unintended, passing --slots-in-an-epoch 1 to the local-network anvil would avoid it. We haven't checked for side effects: some e2e tests raise slotsInAnEpoch (#21452 to 32, #21869 to 4) because near-immediate finality broke reorg and sentinel tests.

Repro

Token.json is the bundled token_contract-Token.json, copied to a path without @. The CLI treats paths containing @ as nargo package refs.

aztec start --local-network
aztec-wallet import-test-accounts
aztec-wallet deploy ./Token.json -f accounts:test0 -a token --args <test0> Token TKN 18
aztec-wallet send set_minter -ca contracts:token -c ./Token.json --args <test0> true -f accounts:test0
aztec-wallet send mint_to_private -ca contracts:token -c ./Token.json --args <test0> 1000000 -f accounts:test0
for i in $(seq 1 28); do
  aztec-wallet send transfer -ca contracts:token -c ./Token.json --args <test0> 1 -f accounts:test0 || break
done

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions