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

Transaction signing #345

Merged
merged 21 commits into from
Oct 30, 2020
Merged

Transaction signing #345

merged 21 commits into from
Oct 30, 2020

Conversation

andynog
Copy link
Contributor

@andynog andynog commented Oct 27, 2020

Closes: #47

Description

This PR includes the logic to sign Tx. Currently there is logic to sign a MsgConnectionOpenInit against a gaia stargate-4 chain.

Will open this PR as a draft because even though the code works there's a few things to be worked on (bugs, tests) but it's easier to track through a PR than on the issue.


For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@andynog andynog changed the title Andy/tx sign Transaction signing Oct 27, 2020
@andynog
Copy link
Contributor Author

andynog commented Oct 27, 2020

Tests are failing because there's an issue with the way the signer is specified on tests. In the transaction signing of the raw message (proto) the signer is the bech32 account address.

@codecov-io
Copy link

Codecov Report

Merging #345 into master will increase coverage by 21.4%.
The diff coverage is 64.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #345      +/-   ##
=========================================
+ Coverage    13.6%   35.0%   +21.4%     
=========================================
  Files          69     137      +68     
  Lines        3752    8582    +4830     
  Branches     1374    2964    +1590     
=========================================
+ Hits          513    3012    +2499     
- Misses       2618    5380    +2762     
+ Partials      621     190     -431     
Impacted Files Coverage Δ
modules/src/events.rs 0.0% <0.0%> (ø)
modules/src/ics02_client/events.rs 0.0% <ø> (ø)
modules/src/ics02_client/raw.rs 0.0% <0.0%> (ø)
modules/src/ics03_connection/error.rs 13.6% <0.0%> (-19.7%) ⬇️
modules/src/ics04_channel/error.rs 75.0% <ø> (+50.0%) ⬆️
modules/src/ics04_channel/packet.rs 0.0% <0.0%> (ø)
modules/src/ics07_tendermint/client_def.rs 0.0% <0.0%> (ø)
modules/src/ics07_tendermint/error.rs 75.0% <ø> (+75.0%) ⬆️
modules/src/ics18_relayer/error.rs 0.0% <0.0%> (ø)
modules/src/ics26_routing/msgs.rs 0.0% <0.0%> (ø)
... and 254 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 052b574...6e489a6. Read the comment docs.

Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Andy, thanks again for working on this! I have a few comments but could be solved in different PRs. Haven't looked at the keyring stuff in detail, mostly at the IBC changes. We should start a conversation about the best way to refactor the auth, signing, keystore, etc. But for now I think this is good to go.

relayer-cli/src/commands/tx/connection.rs Show resolved Hide resolved
relayer/src/tx/connection.rs Outdated Show resolved Hide resolved
relayer-cli/src/commands/tx/client.rs Show resolved Hide resolved
relayer/src/chain/cosmos.rs Show resolved Hide resolved
relayer/src/chain/cosmos.rs Show resolved Hide resolved
relayer/src/tx/client.rs Show resolved Hide resolved
relayer/src/tx/client.rs Outdated Show resolved Hide resolved
relayer-cli/src/commands/tx/connection.rs Show resolved Hide resolved
andynog and others added 2 commits October 29, 2020 15:51
I had this in place so I could test. OK to change it back

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
OK, didn't know where to get it from, thanks.

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
relayer-cli/src/commands/tx/connection.rs Show resolved Hide resolved
relayer-cli/src/commands/tx/connection.rs Show resolved Hide resolved
relayer/src/chain/cosmos.rs Show resolved Hide resolved
relayer/src/tx/client.rs Show resolved Hide resolved
@andynog
Copy link
Contributor Author

andynog commented Oct 30, 2020

I believe we discussed most of the reviews on this draft PR and should be good for Review. Some of the discussions will lead into other issues/features that are outside the scope of this PR for now.

@andynog andynog marked this pull request as ready for review October 30, 2020 13:37
@andynog andynog requested a review from romac as a code owner October 30, 2020 13:37
@ancazamfir ancazamfir merged commit 2b5029b into master Oct 30, 2020
@ancazamfir ancazamfir deleted the andy/tx-sign branch October 30, 2020 13:46
@ancazamfir ancazamfir mentioned this pull request Oct 30, 2020
5 tasks
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Initial implementation for tx sign

* Adding logic to build the tx as part of the chain. Added broadcast tx to chain. informalsystems#47

* Added keys restore command boileplate for abscissa. Restore key functionality not implemented yet informalsystems#47

* Implemented changes to support tx signing (informalsystems#47):

* Implemented very basic keybase to store keys (memory store)

* Logic to restore key (private/public) from mnemonic

* Added keystore to the chain

* Implemented working 'keys restore' command on the relayer

* Refactoring keybase structure (informalsystems#47)

* Initial logic to send message (informalsystems#47)

* Got the logic to sign but MsgConnectionOpenInit test against stargate-4 not working (informalsystems#47)

* MsgConnectionOpenInit tx working logic! (informalsystems#47)

* Added option to tx raw conn-init to specify and read key file content (informalsystems#47)

* Logic to parse the key_seed.json file passed as tx raw parameter working (informalsystems#47)

* Added support to specify key file and account sequence for the tax raw conn-init command (informalsystems#47)

* Adding instructions on how to submit a transaction (informalsystems#345)

* Fixing format issues (informalsystems#345)

* Fixing tests (informalsystems#345)

* Update relayer/src/tx/client.rs

I had this in place so I could test. OK to change it back

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

* Update relayer/src/tx/connection.rs

OK, didn't know where to get it from, thanks.

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>

Co-authored-by: Anca Zamfir <ancazamfir@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Create and submit a transaction to SDK/TM chain
3 participants