OAPP-2067 fix(ua-devtools): skip already-pinned libraries with areBytes32Equal#1947
OAPP-2067 fix(ua-devtools): skip already-pinned libraries with areBytes32Equal#1947St0rmBr3w wants to merge 6 commits into
Conversation
Checksum and padding mismatches caused configureSendLibraries / configureReceiveLibraries to re-propose set*Library after pin, which reverts with LZ_SameValue. Keep lock-defaults when still on the endpoint default. Co-authored-by: Cursor <cursoragent@cursor.com>
Unit canary proves main's receive === skip re-proposes when on-chain is checksummed and config is lowercase; send toLowerCase already survives that case. Runs without Hardhat/Docker. Co-authored-by: Cursor <cursoragent@cursor.com>
Checksum canary (proved against main-style skip logic)Added Result when temporarily restoring main's skip predicates:
With this PR's fix: all 3 canary tests pass. pnpm --filter @layerzerolabs/ua-devtools test:jest -- test/oapp/library-checksum-canary.test.ts |
🧪 E2E Test StatusE2E tests are non-blocking and validate real blockchain interactions. Failures may occur due to network issues, RPC rate limits, or external service downtime. Test Runs (Newest First): |
Unblocks Verify example lockfiles CI (ERR_PNPM_OUTDATED_LOCKFILE) after Version packages bumped example package.json specs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Bare areBytes32Equal throws on base58 library addresses after pin. Skip checks now normalize with the OApp local eid first (same pattern as peer equality), keeping lock-defaults and EVM checksum safety. Co-authored-by: Cursor <cursoragent@cursor.com>
…ng canary Release note now documents areBytes32Equal(normalizePeer(local eid)). Send canary adds padded-vs-bare address case that fails on main's toLowerCase() compare. Co-authored-by: Cursor <cursoragent@cursor.com>
Coverage remains in hardhat configure*Libraries idempotency tests. Co-authored-by: Cursor <cursoragent@cursor.com>
| }) | ||
| }) | ||
|
|
||
| describe('configureReceiveLibraryTimeouts', () => { |
There was a problem hiding this comment.
I believe we also want to run the normalized equality checks on configureReceiveLibraryTimeouts (packages/ua-devtools/src/oapp/config.ts:287).
|
|
||
| `configureSendLibraries` / `configureReceiveLibraries` (and read-library equivalents) | ||
| previously compared addresses with `toLowerCase()` or strict `===`. Checksum or | ||
| padding mismatches caused already-pinned libraries to be re-proposed, which reverts |
There was a problem hiding this comment.
Do we want to add some simple tests for hex padding and Solana base58 format?
What does this PR do?
Fixes wire idempotency for message libraries so already-pinned
setSendLibrary/setReceiveLibraryconfigs are not re-proposed.configureSendLibraries/configureReceiveLibraries(and the oapp-read equivalents) now compare on-chain vs configured library addresses withareBytes32Equalinstead oftoLowerCase()/ strict===. Checksum or padding mismatches no longer produce a secondset*Librarythat reverts withLZ_SameValue.Keeps the existing
!isDefaultLibrarygate so "lock defaults" behavior is unchanged: when the OApp is still on the endpoint default and config matches the resolved default ULN, the first wire still pins storage.Why is this change needed?
After libraries are already set on-chain, fragile address equality caused tooling to re-propose the same library. EndpointV2 rejects that with
LZ_SameValue, breaking idempotent re-wires.Note: this is unrelated to #1944 (ULN NIL sentinel pinning). That PR did not touch message-lib skip logic.
Type of Change
How was this tested?
Added hardhat regression tests that pin send/receive/read libraries, then re-run configure with lowercase config addresses and expect
[]transactions. Package build + lint for@layerzerolabs/ua-devtoolspass locally; full hardhat suite left to CI.Impact/Screenshots
N/A
Checklist
AI Provenance
Made with Cursor