Skip to content

e2e: add backward compatibility test for older CLI versions#2797

Open
snormore wants to merge 13 commits intomainfrom
snor/backward-compat-e2e-test
Open

e2e: add backward compatibility test for older CLI versions#2797
snormore wants to merge 13 commits intomainfrom
snor/backward-compat-e2e-test

Conversation

@snormore
Copy link
Contributor

@snormore snormore commented Feb 2, 2026

Summary

  • Add TestE2E_BackwardCompatibility that validates older CLI versions (back to the onchain program's min_compatible_version) can perform all read and write operations against the current upgraded program
  • Test clones account state from live environments, deploys the current branch's program .so, then installs each old CLI version from Cloudsmith and runs read/write workflows
  • Environments (testnet, mainnet-beta) run as parallel sub-tests with a combined compatibility matrix rendered at the end
  • Per-environment Cloudsmith repos: mainnet-beta uses doublezero, testnet uses doublezero-testnet, devnet uses doublezero-devnet
  • Configurable via DZ_COMPAT_CLONE_ENV, DZ_COMPAT_MIN_VERSION, DZ_COMPAT_MAX_NUM_VERSIONS env vars
  • Replace inline Python in the ledger entrypoint with a fork-accounts Rust tool that uses the serviceability SDK for proper Borsh serialization when patching GlobalState accounts
  • Migrate e2e tests to use the new serviceability SDK at sdk/serviceability/go/

Testing Verification

  • Ran full test against testnet and mainnet-beta in parallel
  • testnet: v0.8.2–v0.8.4 all passed (35/35 steps each)
  • mainnet-beta: v0.7.1–v0.8.0 each have 1 expected failure (multicast_group_create due to Borsh struct change in v0.8.1), v0.8.1 all passed (35/35)

@snormore snormore force-pushed the snor/backward-compat-e2e-test branch 2 times, most recently from 1c422b3 to c8e8541 Compare February 2, 2026 22:58
@snormore snormore force-pushed the snor/serviceability-telemetry-sdks branch from 59f1b57 to 79ded32 Compare February 2, 2026 23:54
@snormore snormore force-pushed the snor/backward-compat-e2e-test branch from 1380646 to 10c1088 Compare February 3, 2026 17:50
@snormore snormore force-pushed the snor/serviceability-telemetry-sdks branch from 77b5f96 to 0d56ff2 Compare February 3, 2026 17:55
@snormore snormore force-pushed the snor/backward-compat-e2e-test branch 2 times, most recently from 38a3cfe to da051c5 Compare February 3, 2026 18:16
@snormore snormore force-pushed the snor/serviceability-telemetry-sdks branch from 8ab0cd6 to 3bf2ac2 Compare February 4, 2026 18:27
Base automatically changed from snor/serviceability-telemetry-sdks to main February 5, 2026 17:23
@snormore snormore force-pushed the snor/backward-compat-e2e-test branch 3 times, most recently from 6b58298 to f71d299 Compare February 5, 2026 22:50
…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
@snormore snormore force-pushed the snor/backward-compat-e2e-test branch from 1778b41 to 44a4202 Compare February 6, 2026 03:55
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
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