svm/wormhole-core-shims: allow anchor interfaces to be used from any anchor version#4559
Conversation
+ wider compiler support for chain id parsing
ee9bcb2 to
3b687e8
Compare
+ wider compiler support for chain id parsing
Any chance you could document the required features in the README? The idea here would be to make it easier for us to check this crate against Anchor's changelogs going forward to figure out if we're gonna get into trouble. |
a5a1d9e to
783ae2d
Compare
not sure I can explicitly enumerate these, but I think we will know if something breaks because it will fail to compile |
…anchor version (wormhole-foundation#4559) * svm/wormhole-core-shims: allow anchor interfaces to be used from any anchor version * svm/wormhole-core-shims: fine-grained definitions + wider compiler support for chain id parsing * svm/wormhole-core-shims: fine-grained definitions + wider compiler support for chain id parsing * svm/wormhole-core-shims: token-bridge definitions * svm/wormhole-core-shims: make chain-id opt-in
We relax the anchor version bounds of the
*-interfacecrates so they can be used from any anchor program. This works, because the interface crates rely on a very small subset of anchor features that are hopefully stable enough to not need to be tied to version bounds. Knock on wood.Additionally, the definitions crate now has fine-grained control over which addresses to expose. This is only interesting in the
from-envcase, which rely on environment variables to be set. For example, if a user of this crate wants only the core bridge address (and its PDAs), it should not need to define the verify-vaa-shim program id.This is in preparation for using this crate as the ultimate source of truth for all program ids and constants. As such, we also use hand-rolled u16 const parser, as the previously used version doesn't work on older compiler versions required by some anchor versions out there (looking at you, 0.29).
This is also a breaking change of the definitions crate, so bumped the major version to 1.0.0. Breaking, because the default flags now only provide core bridge ids, as opposed to all the ids.