Skip to content

Commit 8630b41

Browse files
authored
fix: update testnet compatibility test and bust cache on pinned artifact changes (#22429)
## Summary Two changes to fix the testnet compatibility test breakage on v4-next: **1. Fix test to match actual testnet deployment** - Testnet was deployed without SponsoredFPC — remove it from genesis computation - Update expected genesis archive root to `0x15684c8c...` (verified against on-chain testnet L1 rollup at `0xf6d0...c1` on Sepolia) - All 3 values verified on-chain: VK tree root, protocol contracts hash, genesis archive root **2. Bust test cache when pinned artifacts change** - Mix hashes of `pinned-protocol-contracts.tar.gz`, `pinned-build.tar.gz` (VKs), and `mock-protocol-circuits/pinned-build.tar.gz` into the compatibility test cache prefix - This ensures the test re-runs whenever pinned artifacts are updated, preventing the CI cache from masking mismatches ## On-chain verification ``` $ cast call 0xf6d0...c1 "archiveAt(uint256)(bytes32)" 0 --rpc-url sepolia 0x15684c8c3d2106918d3860f777e50555b7166adff47df13cc652e2e5a50bf5c7 # genesis archive root $ cast storage 0xf6d0...c1 <config.vkTreeRoot slot> --rpc-url sepolia 0x1dd2644a17d1ddd8831287a78c5a1033b7ae35cdf2a3db833608856c062fc2ba # VK tree root $ cast storage 0xf6d0...c1 <config.protocolContractsHash slot> --rpc-url sepolia 0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141 # protocol contracts hash ```
2 parents b1e411e + fda1203 commit 8630b41

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

yarn-project/aztec/src/testnet_compatibility.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import type { InitialAccountData } from '@aztec/accounts/testing';
21
import { Fr } from '@aztec/aztec.js/fields';
3-
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
42
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
53
import { protocolContractsHash } from '@aztec/protocol-contracts';
64
import { getGenesisValues } from '@aztec/world-state/testing';
@@ -20,13 +18,11 @@ describe('Testnet compatibility', () => {
2018
);
2119
});
2220
it('has expected Genesis tree roots', async () => {
23-
const initialAccounts: InitialAccountData[] = [];
24-
const sponsoredFPCAddress = await getSponsoredFPCAddress();
25-
const initialFundedAccounts = initialAccounts.map(a => a.address).concat(sponsoredFPCAddress);
26-
const { genesisArchiveRoot } = await getGenesisValues(initialFundedAccounts);
21+
// Testnet was deployed without SponsoredFPC or any initial funded accounts
22+
const { genesisArchiveRoot } = await getGenesisValues([]);
2723

2824
expect(genesisArchiveRoot).toEqual(
29-
Fr.fromHexString('0x2727683df35594b1f073a681532520056ca8a775398c8b5a94574c67ef1ce6de'),
25+
Fr.fromHexString('0x15684c8c3d2106918d3860f777e50555b7166adff47df13cc652e2e5a50bf5c7'),
3026
);
3127
});
3228
});

yarn-project/bootstrap.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,16 @@ function test_cmds {
225225
aztec/bootstrap.sh test_cmds
226226

227227
if [[ "${TARGET_BRANCH:-}" =~ ^(v[0-9]+(-next)?|backport-to-v[0-9]+-(staging|next))$ ]]; then
228-
echo "$hash yarn-project/scripts/run_test.sh aztec/src/testnet_compatibility.test.ts"
229-
echo "$hash yarn-project/scripts/run_test.sh aztec/src/mainnet_compatibility.test.ts"
228+
# Mix in hashes of pinned artifact archives so the test cache busts when they change.
229+
# These archives contain protocol contracts, VKs, and circuit artifacts that determine
230+
# the on-chain genesis state the compatibility tests verify against.
231+
local compat_hash=$(hash_str $hash \
232+
$(cache_content_hash \
233+
"^noir-projects/noir-contracts/pinned-protocol-contracts.tar.gz" \
234+
"^noir-projects/noir-protocol-circuits/pinned-build.tar.gz" \
235+
"^noir-projects/mock-protocol-circuits/pinned-build.tar.gz"))
236+
echo "$compat_hash yarn-project/scripts/run_test.sh aztec/src/testnet_compatibility.test.ts"
237+
echo "$compat_hash yarn-project/scripts/run_test.sh aztec/src/mainnet_compatibility.test.ts"
230238
fi
231239
}
232240

0 commit comments

Comments
 (0)