Skip to content

NDRS-299 client wasmless transfer#184

Merged
Fraser999 merged 9 commits intocasper-network:masterfrom
Fraser999:NDRS-299-client-wasmless-transfer
Aug 31, 2020
Merged

NDRS-299 client wasmless transfer#184
Fraser999 merged 9 commits intocasper-network:masterfrom
Fraser999:NDRS-299-client-wasmless-transfer

Conversation

@Fraser999
Copy link
Contributor

This PR adds a --transfer subcommand to the client which leverages the wasmless transfer functionality provided by the contract runtime.

It also sees the Deploy type cleaned up significantly, with validation of hashes now performed during deserialization, and better error reporting.

Copy link
Contributor

@afck afck left a comment

Choose a reason for hiding this comment

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

Looks good to me, but someone more familiar with the client code should review it, too.

values
.map(|hex_hash| {
let digest = Digest::from_hex(hex_hash)
.unwrap_or_else(|error| panic!("should parse {}: {}", ARG_NAME, error));
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a user input error, maybe:

panic!("could not parse --{} {} as hex-encoded deploy hash: {}", ARG_NAME, hex_hash, error)

approvals,
};

if let Err(error) = deploy.verify_approval(deploy.header.account(), Some(0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the other approvals for if we only verify the first one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm, not sure what the plan is in that regard. This provides similar functionality to that in the Python client, i.e. the ability for multiple signers to sign a given deploy. I imagine this will be built upon in the future. Either we'll need to include the signers' public keys in the deploy to enable verification during deserialization, or else it'll need to be done separately to deserialization, or else it might never need validated. Either way, I believe that'll need further planning.

Copy link
Contributor

Choose a reason for hiding this comment

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

In Scala we are verifying all signatures – so yes, it requires including signer's public key as well. Execution Engine assumes that node has verified that all signatures are valid when it checks whether deploy is allowed for execution. This is important in the multisignature context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @goral09 - I'll add that here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 1418a199.

@Fraser999 Fraser999 merged commit 656c871 into casper-network:master Aug 31, 2020
@Fraser999 Fraser999 deleted the NDRS-299-client-wasmless-transfer branch August 31, 2020 15:58
sacherjj pushed a commit that referenced this pull request Apr 4, 2022
47: Regression test for validation of empty blocks with accusations. r=Fraser999 a=afck

Test for https://github.com/casper-network/casper-node-private/pull/46.

This passed 3 out of 3 times for me. Without the fix, it failed 3 out of 3 times.

Closes [#184](https://github.com/casper-network/Governance/issues/184).

Co-authored-by: Andreas Fackler <andreas@casperlabs.io>
Co-authored-by: TomVasile <43349666+TomVasile@users.noreply.github.com>
rafal-ch pushed a commit that referenced this pull request Sep 11, 2024
As pointed by @mediremi , we might overflow on the post-execution gas
deduction.

That operation must be safe, so we have to use `checked_sub`
rafal-ch pushed a commit that referenced this pull request Sep 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

Successfully merging this pull request may close these issues.

4 participants