Skip to content

Allow empty crossChainAddress#572

Merged
huangzhen1997 merged 3 commits intomainfrom
NONEVM-3625/allow-zero-cross-chain-address
Feb 3, 2026
Merged

Allow empty crossChainAddress#572
huangzhen1997 merged 3 commits intomainfrom
NONEVM-3625/allow-zero-cross-chain-address

Conversation

@huangzhen1997
Copy link
Contributor

No description provided.

@huangzhen1997 huangzhen1997 marked this pull request as ready for review February 2, 2026 22:40
@huangzhen1997 huangzhen1997 requested a review from a team as a code owner February 2, 2026 22:40
Copilot AI review requested due to automatic review settings February 2, 2026 22:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the CrossChainAddress validation logic to allow empty addresses. Previously, empty cross-chain addresses were explicitly rejected; now they are permitted.

Changes:

  • Removed the validation check that prevented empty cross-chain addresses
  • Updated the corresponding test case to reflect that empty addresses are now valid

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/ccip/bindings/common/common.go Removed the empty address validation check in the ToCell() method
pkg/ccip/bindings/common/common_test.go Updated test expectation for empty addresses from error to success

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

builder := cell.BeginCell()
err := builder.StoreSlice([]byte{uint8(addrLength)}, 8) // store the first byte as length
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

When addrLength is 0 (empty address), this will store a zero-length byte, but the subsequent StoreSlice(c, addrLength*8) call on the next line will attempt to store 0 bits. Verify that the cell builder correctly handles storing an empty slice and that downstream consumers can properly interpret a cross-chain address with length 0.

Copilot uses AI. Check for mistakes.
@huangzhen1997 huangzhen1997 merged commit ffd7498 into main Feb 3, 2026
36 of 37 checks passed
@huangzhen1997 huangzhen1997 deleted the NONEVM-3625/allow-zero-cross-chain-address branch February 3, 2026 14:13
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