Skip to content

Commit

Permalink
feat: penumbra ics-20 test cases (#1157)
Browse files Browse the repository at this point in the history
* test: working on penumbra<>penumbra ibc test case

* test: use proper chain for second test user

* wip: update to penumbra v0.61.0 and build out ibc support

* change tendermint to cometbft in rel path

* update penumbra and cometbft versions in test case and change flag

* proto: update penumbra protos to v0.62.0

* chore: go mod tidy

* chore: remove debug output & implement ics2_withdrawal support

* test: update network integration test

* test: implement ics_20 transfer tests

* test: update penumbra to v0.62.0 and cometbft to v0.37.0

* test: fall back to pcli ics20 withdrawal while debugging

* chore: update penumbra protos

* fix: adjust pcli cmd for generating keys and config.toml + make proper use of cli args

* test: update penumbra version to v0.63.3

* fix: remove unnecessary field usage in protos

* fix: properly parse the fvk and custody key from pcli instances

* fix: generate keys from mnemonics properly

* chore: remove commented out code & debug output

* chore: execute ics_20 withdrawals from pclientd instead of pcli

* chore: remove debug output

* test: update penumbra to v0.64.1, remove debug output, pass in valid ics_20 transfer timeout timestamp

* chore: update go.work.sum

* test: use math.Int instead of int64 where necessary

* chore: check errors that were previously being ignored

* chore: update go.work.sum

* Add documentation comments to Penumbra-related code.

This commit extends the Go documentation of the Penumbra-related types, state, and behaviors found across the entire codebase. A significant part of this update focuses on the structs and functions in Penumbra's chain logic and client node, as well as the related helpers and tests. These comments should make the purpose and functionality of the code more transparent and understandable for further development and usage.

* Refactor ibcTransferTimeouts to use a helper function.

This commit improves the readability and maintainability of the ibcTransferTimeouts function. Now, to check if default values should be used, a helper function called shouldUseDefaults is implemented. This eliminates the need for the switch case in the original function and makes for cleaner code.

* Add mutex lock to PenumbraChain and refine function signatures

A mutex lock has been introduced in PenumbraChain to ensure thread safety when manipulating the allocations. The function signatures of Acknowledgements, Timeouts, ExportState, and Start methods have also been simplified to exclude unused parameters.

* chore: go mod tidy

* test: run penumbra tests with relayer image built from main branch

* fix: add GRPCConn to PenumbraClientNode and refactor methods

Added a GRPCConn field to PenumbraClientNode to enable persistent gRPC connection. Refactored various functions to use this persistent connection rather than repeatedly dialing a new connection. This streamlines the code, reduces redundancy, and optimizes performance as a new gRPC connection does not need to be opened and closed with every invocation.

* chore: cleanup docs and comments

* test: debug timeouts on penumbra

* fix: cast block height properly

* test: update tests to handle int64

* fix: use correct images if set

* chore: re-generate penumbra code from protos

* chore: remove unnecessary lines in protogen script

* fix: update import paths and handle stream responses from RPC calls

* test: update Penumbra & CometBFT versions + comment out timeout checks

* fix: check for nil values when handling gRPC stream responses

* test: WIP fixing ibc related tests

* wip: add logs

* chore: update Penumbra protos

* chore: update Penumbra protos for v0.77.2

* tmp use only timestamp timeout offset

* assert both timeout height and timestamp are being respected

* Hold Penumbra correctly

* test fixes

* Fix cosmos/penumbra tests

* Add cosmos -> penumbra IBC timeout test

* Additional tests and fixes for penumbra

* Revert changes to configuredChains.yaml

* Clean up, use published docker images instead of local

* fix(test): `rand.Seed` linting deprecation

* fix: use `cfg.Env` instead of hardcoded `RUST_LOG=debug`

* context.WithTimeout for `buildResp.GetBuildProgress`

* use latest relayer proto

---------

Co-authored-by: jtieri <[email protected]>
Co-authored-by: Justin Tieri <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
Co-authored-by: Reece Williams <[email protected]>
  • Loading branch information
5 people authored Jul 14, 2024
1 parent e0c90b0 commit 5c5b565
Show file tree
Hide file tree
Showing 56 changed files with 128,436 additions and 71,603 deletions.
10 changes: 9 additions & 1 deletion chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,17 @@ func (tn *ChainNode) SendIBCTransfer(
if options.Timeout != nil {
if options.Timeout.NanoSeconds > 0 {
command = append(command, "--packet-timeout-timestamp", fmt.Sprint(options.Timeout.NanoSeconds))
} else if options.Timeout.Height > 0 {
}

if options.Timeout.Height > 0 {
command = append(command, "--packet-timeout-height", fmt.Sprintf("0-%d", options.Timeout.Height))
}

if options.AbsoluteTimeouts {
// ibc-go doesn't support relative heights for packet timeouts
// so the absolute height flag must be manually set:
command = append(command, "--absolute-timeouts")
}
}
if options.Memo != "" {
command = append(command, "--memo", options.Memo)
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/wasm/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ func WasmEncoding() *testutil.TestEncodingConfig {
wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry)

return &cfg
}
}
Loading

0 comments on commit 5c5b565

Please sign in to comment.