Problem: (CRO-294) Client can generate invalid transactions#537
Problem: (CRO-294) Client can generate invalid transactions#537bors[bot] merged 1 commit intocrypto-com:masterfrom devashishdxt:tx-validity
Conversation
Solution: Added balance checks when creating network ops transactions
Codecov Report
@@ Coverage Diff @@
## master #537 +/- ##
==========================================
- Coverage 67.23% 67.22% -0.01%
==========================================
Files 122 122
Lines 14102 14129 +27
==========================================
+ Hits 9481 9498 +17
- Misses 4621 4631 +10
|
tomtau
left a comment
There was a problem hiding this comment.
looks ok, but is it only for staked state operations?
e.g. if one sends TX that spends some tx inputs... if the client doesn't sync, those inputs would still be "unspent" in the internal state (rather than "potentially spent" with some TXID to check whether it was really committed), is that correct?
That is correct. Client won't know if some inputs are spent until it syncs the block in which they were spent. |
ok, I created CRO-524 for that |
|
bors r+ |
calvinaco
left a comment
There was a problem hiding this comment.
Look good to me, leave a small suggestion about using view_key when checking wallet existence.
| inputs: &[TxoPointer], | ||
| ) -> Result<bool> { | ||
| // Check if wallet exists | ||
| self.wallet_service.view_key(name, passphrase)?; |
There was a problem hiding this comment.
A small suggestion: I notice we are using view_key to check for wallet existence or passphrase correctness in wallet client, maybe we can add a wallet_service.has_wallet() ?
535: Problem(CRO-392)outdated dependencies in client's storage encryption r=tomtau a=linfeng-crypto Solution: - use crate `aes-gcm-siv` and `aead` instead of `miscreant` - use crate `rust-argon2` to the `passphrase` to a constant length, and store the `salt` at the end of the encrypted data. 537: Problem: (CRO-294) Client can generate invalid transactions r=tomtau a=devashishdxt Solution: Added balance checks when creating network ops transactions 538: Problem:(CRO-521) Problem: unbonded from custom time is ignored in genesis initconfig r=tomtau a=linfeng-crypto Solution: change the parameters of `new_init`: change `genesis_time` from `Timespec` into `Option<Timespec>`, remove the `bool` type parameter `bonded`, add a `&StakedStateDestination` type parameter. Co-authored-by: ylf <cxwcylf@126.com> Co-authored-by: Devashish Dixit <devashish@crypto.com> Co-authored-by: linfeng <linfeng@crypto.com>
Build failed (retrying...) |
|
bors retry |
|
Already running a review |
Build failed |
|
bors retry |
537: Problem: (CRO-294) Client can generate invalid transactions r=tomtau a=devashishdxt Solution: Added balance checks when creating network ops transactions 538: Problem:(CRO-521) Problem: unbonded from custom time is ignored in genesis initconfig r=tomtau a=linfeng-crypto Solution: change the parameters of `new_init`: change `genesis_time` from `Timespec` into `Option<Timespec>`, remove the `bool` type parameter `bonded`, add a `&StakedStateDestination` type parameter. 540: Problem: (CRO-501) Integration tests is not running in HW SGX r=tomtau a=calvinlauco Solution: Add integration tests in Drone CI running in HW SGX --- - Integration tests will run as SW mode in TravisCI and HW mode in Drone Co-authored-by: Devashish Dixit <devashish@crypto.com> Co-authored-by: linfeng <linfeng@crypto.com> Co-authored-by: Calvin Lau <calvinlauco@gmail.com>
Build failed (retrying...) |
|
bors r+ |
537: Problem: (CRO-294) Client can generate invalid transactions r=tomtau a=devashishdxt Solution: Added balance checks when creating network ops transactions 542: Problem: app hash changes even if app state didn't change (CRO-526) r=tomtau a=tomtau Solution: added a flag to chainabci node to signal whether rewards pool was updated in that block (either by slashing events or transaction fees -- in the future reward distribution), so that its "last_block_height" (which denotes when it was updated last time) is only updated when the amount changed. TODO: perhaps move the rewards pool update logic to rewards pool code (rather than in abci)? Co-authored-by: Devashish Dixit <devashish@crypto.com> Co-authored-by: Tomas Tauber <2410580+tomtau@users.noreply.github.com>
Solution: Added balance checks when creating network ops transactions