Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🟦 EPIC: IBC and IBC Receiver contracts should have tests #42

Open
16 of 19 tasks
Tracked by #27
kakucodes opened this issue Jun 28, 2024 · 7 comments
Open
16 of 19 tasks
Tracked by #27

🟦 EPIC: IBC and IBC Receiver contracts should have tests #42

kakucodes opened this issue Jun 28, 2024 · 7 comments
Assignees

Comments

@kakucodes
Copy link

kakucodes commented Jun 28, 2024

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

Tasks

  1. enhancement
    kakucodes
  2. kakucodes
  3. kakucodes
  4. kakucodes
  5. kakucodes
@kakucodes
Copy link
Author

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

@jonathanpberger jonathanpberger changed the title write some tests for IBC and IBC Reciever contracts IBC and IBC Receiver contracts should have tests Jul 15, 2024
@jonathanpberger
Copy link

blocked on #58

@jonathanpberger
Copy link

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

@kakucodes
Copy link
Author

kakucodes commented Aug 2, 2024

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

@kakucodes
Copy link
Author

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
Loading

@kakucodes
Copy link
Author

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

@jonathanpberger
Copy link

@nik-suri sez "maybe share the mermaid in #wormhole-dev slack channel" in case it's useful to anyone else

@jonathanpberger jonathanpberger changed the title IBC and IBC Receiver contracts should have tests 🟦 EPIC: IBC and IBC Receiver contracts should have tests Oct 11, 2024
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

No branches or pull requests

2 participants