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

fix(core-transaction-pool): invalid transactions after rollback #2217

Merged
merged 2 commits into from
Mar 9, 2019
Merged

fix(core-transaction-pool): invalid transactions after rollback #2217

merged 2 commits into from
Mar 9, 2019

Conversation

spkjp
Copy link
Contributor

@spkjp spkjp commented Mar 9, 2019

Proposed changes

After a rollback, the transaction pool could end up with transactions where the block timestamp is used, therefore failing verification and resulting in invalid blocks:

This does not apply to develop, because of the much stricter separation of the transaction data introduced with AIP29.

|ark-relay  | [2019-03-08 08:15:32][INFO]: Received new block at height 1,714,194 with 5 transactions from 127.0.0.1
8|ark-relay  | [2019-03-08 08:15:32][WARN]: Block 1,714,194 (2420495039909631961) disregarded because verification failed 📜
8|ark-relay  | [2019-03-08 08:15:32][WARN]: {
8|ark-relay  |     "verified": false,
8|ark-relay  |     "errors": [
8|ark-relay  |         "One or more transactions are not verified:",
8|ark-relay  |         "=> ff011e009ae4b0030296893488d335ff818391da7c450cfeb7821a4eb535b15b95808ea733915fbfb140420f00000000001862656e63686461726b202d204461696c79207061796f757440db740300000000000000001efd043bfbbd454d510a07fdb28907d789292fc1b1304402201acf15e55b974242b3745322bfdf311115dbf86602eae238710a6f03787d2e95022053250abcd98a8a4b186603d3753daaa9fb71663c62a8dc915745914406d9c110",
8|ark-relay  |         "=> ff011e009ae4b0030296893488d335ff818391da7c450cfeb7821a4eb535b15b95808ea733915fbfb140420f00000000001862656e63686461726b202d204461696c79207061796f7574fa15290500000000000000001e0d54486c57a8d4ca4852233e8d9c83bb86bec001304402204ad339493098dc3b38d99359ca6a49c610f85d0e0aec778c64002c74a7278e6102205860098a29feab87d001af95b0fc8503a3075375f7958b9b2513048636c69752",
8|ark-relay  |         "=> ff011e009ae4b0030296893488d335ff818391da7c450cfeb7821a4eb535b15b95808ea733915fbfb140420f00000000001b62656e63686461726b202d2064656c6567617465207061796f7574fd0d270700000000000000001e0d54486c57a8d4ca4852233e8d9c83bb86bec00130450221008d4ef5df30af086c92d55719d7bb4d7bf5e6ceafe911b437275acf5bf981dc40022072b2cda839a3f8a95a6b7172faef16ec3be57b0f611d8f6c13ac494a907ff9db",
8|ark-relay  |         "=> ff011e009ae4b0030296893488d335ff818391da7c450cfeb7821a4eb535b15b95808ea733915fbfb140420f00000000001862656e63686461726b202d204461696c79207061796f757474a45d0b00000000000000001ed9a13631caf6b663916aa0a776e36429830584aa304402204c2f27aa2b8cf3dd9e1fc4d6aefd62bd9cffabff10e46662c1c1b5779ec30df00220418684a5819d166d5a38bbac62dafb4fa3e0966844882ef0ffbf66b8c26abdc3",
8|ark-relay  |         "=> ff011e009ae4b0030296893488d335ff818391da7c450cfeb7821a4eb535b15b95808ea733915fbfb140420f00000000001862656e63686461726b202d204461696c79207061796f75740657540800000000000000001e9e40641d8999099d05c03c9bca79e95c36ea5f2f3045022100d0843aa21985b8bf71649c8f830c30eb8aabd7545a8bb30a8e04cff4c00468fb02200725cb3fd58070b3f4087096dc84fc0145cd011f62b7a1c59e3a7d97152ee961"
8|ark-relay  |     ]
8|ark-relay  | }

This also caused the following errors:

[2019-03-08 00:35:28][INFO]: Undoing block 1,713,199
[2019-03-08 00:35:28][INFO]: Undoing block 1,713,198
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:1208867d04c014381017e701574de1f51e7329258ceb8d0640e81628897c9f3c from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:03b468516ac6659066b52d4a2bdd047099183170125fa248d6277bf85a483cc5 from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:26eeb5ff0f11100cfbc2fde2ce0af38d7e779549b3f9adfd91a3fb174c0eda3d from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:b633991f2d2ec85ec29cf48f9c54590ed3ca6e3c4211645a33031fe13cc05e60 from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:ea77d055825472c1086abaca63a291328edd58f54ae49d7d00b51105c3d15be1 from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][ERROR]: [PoolWalletManager] Can't apply transaction id:da9e0054e68ee2077a75c8dac10459d020453ddc21fe9c3f0e2c09cff25034ae from sender:DJpFwW39QnQvQRQJF2MCfAoKvsX4DJ28jq due to ["Failed to verify second-signature"]
[2019-03-08 00:35:28][INFO]: Undoing block 1,713,197
[2019-03-08 00:35:28][INFO]: Undoing block 1,713,196
[2019-03-08 00:35:28][INFO]: Undoing block 1,713,195

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@spkjp spkjp requested a review from faustbrian March 9, 2019 00:39
@spkjp spkjp requested a review from kristjank as a code owner March 9, 2019 00:39
@ghost ghost added Complexity: Low labels Mar 9, 2019
@ghost
Copy link

ghost commented Mar 9, 2019

The ci/circleci: test-node11-2 job is failing as of 0c6f5c061d4ddc4ed302311dc05277a4029340da. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@ghost
Copy link

ghost commented Mar 9, 2019

The ci/circleci: test-node10-2 job is failing as of 0c6f5c061d4ddc4ed302311dc05277a4029340da. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@codecov-io
Copy link

Codecov Report

Merging #2217 into 2.2 will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              2.2    #2217   +/-   ##
=======================================
  Coverage   79.23%   79.23%           
=======================================
  Files         331      331           
  Lines        7916     7916           
  Branches     1115     1098   -17     
=======================================
  Hits         6272     6272           
  Misses       1612     1612           
  Partials       32       32
Impacted Files Coverage Δ
packages/core-blockchain/src/state-storage.ts 100% <100%> (ø) ⬆️
packages/core-transaction-pool/src/connection.ts 100% <100%> (ø) ⬆️

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 0359c09...ee0bbb5. Read the comment docs.

@faustbrian faustbrian merged commit 6526856 into ArkEcosystem:2.2 Mar 9, 2019
faustbrian added a commit that referenced this pull request Mar 10, 2019
vasild added a commit that referenced this pull request Mar 11, 2019
* ArkEcosystem/core/develop:
  chore: update dependencies and remove unused imports (#2212)
  fix(core-tester-cli): Don't hide errors from HTTP failures (#2223)
  chore: update CircleCI config
  chore: use yarn setup on CircleCI
  fix: resolve core-tester-utils conflicts and various errors
  chore: yarn.lock
  chore: bump versions
  chore: resolve conflicts
  refactor(core): allow to provide yes/no callbacks for confirm
  feat(core): suggest another command if the requested one was not found
  fix(core): only quote string flags that contain whitespace
  fix(core-blockchain): node stuck during sync  (#2220)
  docs: add #2217 to the changelog
  refactor(core): use restart instead of reload
  refactor(core): log the stderr output for pm2 errors
  refactor(core): handle pm2 errors outside of the process manager
  refactor(core): log the pm2 status if it is unknown
  refactor(core-p2p): log concise error message instead of dumping the reply (#2215)
  fix(core-blockchain): return if last downloaded block changed (#2216)
  fix(core-transaction-pool): invalid transactions after rollback (#2217)
  feat(core-p2p): Don't spoil the quorum if the peer has !forgingAllowed (#2214)
  fix(core): escape string flags
  docs: add #2207 to the changelog
  refactor(core-forger): Increase timeout for getting the network state (#2208)
  fix: vote balance update (#2207)
  fix(core): exclude undefined values from string casting
  build(docker): use latest release in production images
  chore: install stable release via setup script
  test(core-p2p): toBeGreaterThanOrEqual instead of toBe
  release: 2.2.0
  chore: bump version
  fix: schema
  fix: max payload size
  fix: quorum issues (#2091)
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.

3 participants