Open kakucodes opened 4 months ago
RE governance vaa learnings: some background can be gleaned here https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0002_governance_messaging.md
list of available modules https://github.com/wormhole-foundation/wormhole/blob/main/sdk/vaa/payloads.go#L15 list of payloads https://github.com/wormhole-foundation/wormhole/blob/main/sdk/vaa/payloads.go#L117
for this task we need BodyContractUpgrade
and IbcReceiverUpdateChannelChain
blocked on #58
Q: "Is there a repo of sample VAAs that I can look at?" A: The VAAs are public, but you need to know the hash. There's an internal repo of all gov'ce comms, but the best option here is to ask in slack
It's complaining about bech32. @nik-suri sez there's a special way to encode. @kakucodes will post the command to slack and @nik-suri will help direct him from there
nikhil explained today that for all governance vaas manual/adhoc relaying is used so that is what i'll implement for this set of tests
https://strangeloveventures.slack.com/archives/C057DTCM76G/p1722606186283359
WIP diagramming as i've been debugging through the gov vaa encoding/decoding flow
---
title: Governance VAA Lifecycle
---
flowchart TD
subgraph Encode
WormchainStoreContract --> ContractCodeId["Contract Code Id"]
ContractCodeId .-> |"uint64 -> little endian byte order [32]byte"|CodeIdByteArray["[32]byte Representation of Code Id"]
CodeIdByteArray --> SubmitContractUpgradeGovernanceVAA["helpers.SubmitContractUpgradeGovernanceVAA"]
SubmitContractUpgradeGovernanceVAA .-> |"template into vaa.BodyContractUpgrade\n\nvaa.Serialize()\n\ngenerateGovernanceVaa\n\nmarshal vaa\n\nhex.EncodeToString"|WormchaindEncode["node.ExecTx/Wormchaind"]
end
subgraph Decode
Wormchaind["wormchaind wormhole execute-governance-vaa [vaa]"] -->
CmdExecuteGovernanceVAA
CmdExecuteGovernanceVAA .-> |"hex.DecodeString\n\ntypes.NewMsgExecuteGovernanceVaa"|ExecuteGovernanceVAA
ExecuteGovernanceVAA .-> |"ParseVAA - unmarshalling"|WormholeKeeper["keeper.VerifyGovernanceVaa"]
WormholeKeeper .-> |"keeper.verifyVAA\n\naction = v.Payload[32]"|End[" "]
end
WormchaindEncode --> Decode
had a breakthrough in progress with evan redirecting me with how the gov vaas for core upgrades and ibc receiver update channel chains should be handled.
the tldr is that coreupgrade is meant to be triggered not explicitly as a gov vaa but instead using tx wormhole migrate
and the ibcreceiverupdatechannelchains should be executed by executing the contract in question directly using the submit_v_a_a
method.
more can be read here
@nik-suri sez "maybe share the mermaid in #wormhole-dev
slack channel" in case it's useful to anyone else
description of the use of the ibc and ibc receiver contracts here: https://github.com/wormhole-foundation/wormhole/blob/dc3a6cf804137525239dbdb69cd56687322f8d50/whitepapers/0012_ibc_generic_messaging.md