-
Notifications
You must be signed in to change notification settings - Fork 19
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: allow multiple concurrent transactions into the same block #970
base: development
Are you sure you want to change the base?
Conversation
Test Results (CI)499 tests - 23 498 ✅ - 24 1h 43m 21s ⏱️ - 19m 48s For more details on these failures, see this check. Results for commit d7cc4a3. ± Comparison against base commit 5ecf68d. This pull request removes 23 tests.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a workaround for the partial implementation of late execution in consensus. The evidence should always contain all involved shards, and working around it may cause unexpected bugs. I think this would revert to the previous code when we implement a more complete solution for "consensus-executed" transactions. Currently, we insert a "dummy" executed transaction in the mempool.
Consensus can fetch unexecuted transaction using TransactionRecord::get
(loads either executed or unexecuted) instead of ExecutedTransaction::get (only executed) in some places and take appropriate action if the transaction was not executed in the mempool. I'd rather work towards correcting this than merge a workaround if that makes sense.
// TODO: update the evidence after execution so all transactions are treated equally here | ||
let db_transaction = t.get_transaction(tx)?; | ||
let involved = if db_transaction.transaction().has_inputs_without_version() { | ||
db_transaction.transaction().all_inputs_iter().count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of inputs is not necessarily (and usually not) the number of involved shards
Description
Motivation and Context
Following the previous work on concurrency (#922), this PR solves the problem of concurrent transactions not being batched together in the same block.
The problem happened on the new block calculation, the database function
transaction_pool_get_many_ready
uses theevidence
field to detect conflicts and select transactions. Theevidence
field for inputs without version was always adding the version 0, which result on blocks only picking up one concurrent transaction per block.This PR solves this problem by avoiding adding inputs without versions into the
evidence
field.How Has This Been Tested?
Using the
concurrency
cucumber scenario, setting a lot of concurrent transactions (e.g. 100) and checking logs and database for block commands. Transactions eventually fail but this is due to other problems in concurrency.What process can a PR reviewer use to test or verify this change?
See previous section
Breaking Changes