validating default libs are expected (302) before explicitly setting …#545
validating default libs are expected (302) before explicitly setting …#545ravinagill15 wants to merge 1 commit intofeat/pin-send-receive-libfrom
Conversation
|
| // `defaultSendLibrary(dstEid)` / `defaultReceiveLibrary(srcEid)` need a peer eid. | ||
| // Querying a chain's default for itself isn't a real concept, so pick any other | ||
| // chain in scope. (LZ today uses the same lib across all destinations per chain.) | ||
| const peer = contracts.find((c) => c.eid !== contract.eid) | ||
| if (!peer) { | ||
| throw new Error( | ||
| `Cannot fetch default message libraries for eid ${contract.eid}: at least one other chain must be in scope.` | ||
| ) | ||
| } | ||
|
|
There was a problem hiding this comment.
wondering if we should check defaults for all pathways instead of assuming they're uniform per chain. The Endpoint API stores defaults per destination, so it's technically possible for one chain's default to differ across destinations, and checking only one peer would silently miss that. That is not the case today, but could be in the future
There was a problem hiding this comment.
If we run in parallel using Promise.all, the fetches fan out across endpoints and version checks get de-duped to about 64 unique addresses, so performance should be more optimized
…in config