-
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
feat!: optional versions in transaction inputs #922
feat!: optional versions in transaction inputs #922
Conversation
This reverts commit 9294987.
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.
ACK
Submitted some transactions and tested and seems to be working.
Nice, looks like a good first step - happy to merge
I suspect the builder interface on the spec can be removed in favour of passing in the executor directly, it seems to be a way to keep the borrow checker happy (immutable self, mutable execute) but this is very minor so no change required at this point.
We'll need to update typescript bindings (this is currently a manual process) by running npm run build
in bindings/
Done |
…into no-address-version
4b5215a
* development: fix(engine): prevent creation of mismatched resource type bucket (tari-project#940) chore: update to latest feature-dan2 (tari-project#937) feat!: optional versions in transaction inputs (tari-project#922) feat: add tari-generate (tari-project#941)
* development: feat(walletd/js/client): use abstract transport to allow for WebRTC transport (tari-project#943) fix(engine): prevent creation of mismatched resource type bucket (tari-project#940) chore: update to latest feature-dan2 (tari-project#937) feat!: optional versions in transaction inputs (tari-project#922) feat: add tari-generate (tari-project#941)
Description
SubstateRequirement
struct instead of theSubstateAddress
we were using. This change cascaded through all the project.BlockTransactionExecutor
used by the consensus when voting on local blocks (I leave remote consensus out of the scope for now). The goal of the executor is to allow the re-execution of transactions taking into account the outputs of previous transactions in the block. The executor will be initialised at the beginning of the block, and will keep a temporary substate memory during the block execution, so each consecutive transaction will read the most recent versions of the inputs from there. After a transaction finishes, the outputs will be used to update the memory.Motivation and Context
We want to allow concurrent transactions that affect the same substates. Think for example of a Uniswap-like pool, in which each transaction alters the pool ratio (price impact), in this case transactions must be executed in strict sequential order without conflicts.
The implementation of concurrent transactions is going to spawn across multiple PRs. The goal of this PR is to set the foundation needed for concurrency:
Note that transaction execution and consensus behaviour has not been changed for transactions with specific input versions (the default way of interacting with the network). To trigger the new behaviour the user has to manually craft and send to a VN a transaction that has one or more inputs without version.
Current Limitations and Future Work
TariDanBlockTransactionExecutor
, which implements the consensus execution of transactions, has someTODO
comments for improvements to be made.How Has This Been Tested?
New cucumber scenario for concurrent transaction execution. Currently only one transaction without input versions is executed due to the behaviour of the consensus pacemaker (check Current Limitations and Future Work)
What process can a PR reviewer use to test or verify this change?
Run the new cucumber scenario or try to manually send a transaction with no input versions to the VN. I recommend the
counter
template for testing as it's easy to craft transactions that affect only one substate.Breaking Changes