e2e: add backward compatibility test for older CLI versions#2797
Open
e2e: add backward compatibility test for older CLI versions#2797
Conversation
1c422b3 to
c8e8541
Compare
59f1b57 to
79ded32
Compare
1380646 to
10c1088
Compare
nikw9944
approved these changes
Feb 3, 2026
77b5f96 to
0d56ff2
Compare
38a3cfe to
da051c5
Compare
8ab0cd6 to
3bf2ac2
Compare
6b58298 to
f71d299
Compare
…y SDK Add TestE2E_BackwardCompatibility that validates older CLI versions can perform all read and write operations against the current upgraded onchain program. The test clones account state from live environments (testnet and mainnet-beta by default), deploys the current branch's program, then installs each old CLI version via Cloudsmith and runs the full workflow. Also migrates e2e tests to use the new serviceability SDK at sdk/serviceability/go/.
The test was comparing the entire GlobalConfig struct, but the NextBGPCommunity field changes in the background while the activator runs, causing false failures. Since the test only verifies that RemoteASN was updated correctly, compare only that field.
…reated Add nil check before accessing GlobalConfig.LocalASN since the config may not exist yet when the program accounts have been created but initialization is still in progress.
Add ResourceExtension types, deserialization, and PDA functions to the serviceability SDK. Update the allocation verifier and e2e tests to use the new SDK instead of the smartcontract SDK. - Add ResourceExtensionType, AllocatorType, IpAllocator, IdAllocator, Allocator, and ResourceExtension types - Add DeserializeResourceExtension function - Add PDA functions for resource extension accounts - Add ProgramDataProvider interface - Update allocation verifier to use new SDK - Fix gofmt issue in devnet.go
The previous change made --onchain-allocation conditional on DZ_ONCHAIN_ALLOCATION=true, but this broke existing tests (IBRL, etc.) that relied on the default behavior of onchain allocation being enabled. Change the logic to default to enabled (matching main's behavior) and only disable when explicitly set to "false". This allows backward compatibility tests to opt out while preserving default behavior.
…tures - Fix deserialization to skip to fixed offset 88 for bitmap instead of reading a Vec<u8> with length prefix - Add Skip method to ByteReader for advancing reader position - Add unit tests for ResourceExtension deserialization (ID and IP allocators) - Add ResourceExtension fixtures to Rust generator for both allocator types - Add fixture tests to verify deserialization matches Rust serialization
1778b41 to
44a4202
Compare
The activator's Docker entrypoint defaults DZ_ONCHAIN_ALLOCATION to true when not set. The devnet code only passed this env var when explicitly enabled, so tests expecting legacy allocation were getting onchain mode instead, causing link activation to fail on cloned state without ResourceExtension PDAs. Always set the env var explicitly to ensure the intended allocation mode.
Add config for known CLI/program incompatibilities that reports expected failures as KNOWN_FAIL instead of FAIL, preventing test failures for documented incompatibilities. - multicast_group_create marked as known incompatible before v0.8.1 (Borsh struct changed: index and bump_seed fields were removed) - Known failures don't cascade to skip subsequent steps - Matrix display shows known failures separately from actual failures
- Change OnchainAllocation to *bool so nil = default (enabled) - Only set DZ_ONCHAIN_ALLOCATION=false when explicitly disabled - Add per-environment config for compat test (testnet=enabled, mainnet=disabled) - Preserves main's behavior: onchain allocation enabled by default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestE2E_BackwardCompatibilitythat validates older CLI versions (back to the onchain program'smin_compatible_version) can perform all read and write operations against the current upgraded programdoublezero, testnet usesdoublezero-testnet, devnet usesdoublezero-devnetDZ_COMPAT_CLONE_ENV,DZ_COMPAT_MIN_VERSION,DZ_COMPAT_MAX_NUM_VERSIONSenv varsfork-accountsRust tool that uses the serviceability SDK for proper Borsh serialization when patching GlobalState accountssdk/serviceability/go/Testing Verification
multicast_group_createdue to Borsh struct change in v0.8.1), v0.8.1 all passed (35/35)