Skip to content

OAPP-2067 fix(ua-devtools): skip already-pinned libraries with areBytes32Equal#1947

Open
St0rmBr3w wants to merge 6 commits into
mainfrom
krak/fix-library-samevalue-idempotency
Open

OAPP-2067 fix(ua-devtools): skip already-pinned libraries with areBytes32Equal#1947
St0rmBr3w wants to merge 6 commits into
mainfrom
krak/fix-library-samevalue-idempotency

Conversation

@St0rmBr3w

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes wire idempotency for message libraries so already-pinned setSendLibrary / setReceiveLibrary configs are not re-proposed.

configureSendLibraries / configureReceiveLibraries (and the oapp-read equivalents) now compare on-chain vs configured library addresses with areBytes32Equal instead of toLowerCase() / strict ===. Checksum or padding mismatches no longer produce a second set*Library that reverts with LZ_SameValue.

Keeps the existing !isDefaultLibrary gate 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

  • Bug fix
  • New feature
  • Breaking change
  • Refactor / Tech debt
  • Docs update
  • Chore
  • Performance improvement
  • Other

How was this tested?

  • Unit tests added/updated
  • Integration tests pass
  • Manual testing performed

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-devtools pass locally; full hardhat suite left to CI.

Impact/Screenshots

N/A

Checklist

  • PR is scoped and not too large
  • Self-review completed
  • Code follows style guidelines
  • Tests added for new functionality
  • Documentation updated
  • Hard-to-understand code is commented

AI Provenance

Made with Cursor

St0rmBr3w and others added 2 commits July 21, 2026 09:41
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>
@St0rmBr3w

Copy link
Copy Markdown
Contributor Author

Checksum canary (proved against main-style skip logic)

Added packages/ua-devtools/test/oapp/library-checksum-canary.test.ts (no Docker).

Result when temporarily restoring main's skip predicates:

  • configureReceiveLibraries with checksummed on-chain + lowercase config → FAILS (proposes setReceiveLibrary → would hit LZ_SameValue)
  • configureSendLibraries with the same casing mismatch → passes on main already (toLowerCase())
  • Documentation assertion: checksummed === lowercase is false, while areBytes32Equal is true

With this PR's fix: all 3 canary tests pass.

pnpm --filter @layerzerolabs/ua-devtools test:jest -- test/oapp/library-checksum-canary.test.ts

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Status

E2E 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):

  • Run #6782 - Failed - 2026-07-21 18:53 (UTC)
  • Run #6781 - Failed - 2026-07-21 18:24 (UTC)
  • Run #6780 - Failed - 2026-07-21 18:06 (UTC)
  • Run #6779 - Failed - 2026-07-21 18:00 (UTC)
  • Run #6778 - Failed - 2026-07-21 16:49 (UTC)

@St0rmBr3w St0rmBr3w changed the title fix(ua-devtools): skip already-pinned libraries with areBytes32Equal OAPP-2067 fix(ua-devtools): skip already-pinned libraries with areBytes32Equal Jul 21, 2026
Unblocks Verify example lockfiles CI (ERR_PNPM_OUTDATED_LOCKFILE)
after Version packages bumped example package.json specs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@socket-security

socket-security Bot commented Jul 21, 2026

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Jul 21, 2026

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @layerzerolabs/devtools-move is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: examples/oft-adapter-initia/package.jsonnpm/@layerzerolabs/devtools-move@2.0.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/devtools-move@2.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/devtools-move

Location: Package overview

From: examples/oft-adapter-initia/package.jsonnpm/@layerzerolabs/devtools-move@2.0.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/devtools-move@2.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/devtools-solana

Location: Package overview

From: examples/oapp-solana/package.jsonnpm/@layerzerolabs/devtools-solana@3.1.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/devtools-solana@3.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/metadata-tools

Location: Package overview

From: examples/ovault-evm/package.jsonnpm/@layerzerolabs/metadata-tools@4.0.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/metadata-tools@4.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/protocol-devtools-solana

Location: Package overview

From: examples/oapp-solana/package.jsonnpm/@layerzerolabs/protocol-devtools-solana@9.0.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/protocol-devtools-solana@9.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @layerzerolabs/ua-devtools-solana

Location: Package overview

From: examples/oapp-solana/package.jsonnpm/@layerzerolabs/ua-devtools-solana@9.0.0

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@layerzerolabs/ua-devtools-solana@9.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

St0rmBr3w and others added 3 commits July 21, 2026 11:03
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', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add some simple tests for hex padding and Solana base58 format?

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