-
Notifications
You must be signed in to change notification settings - Fork 29
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
Introduce TxInput::OrderAccountCommand
without nonces
#1888
Open
azarovh
wants to merge
18
commits into
master
Choose a base branch
from
fix/fill_order_no_nonce
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,659
−939
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fcf7fc6
to
b6d9b5d
Compare
6e4bf6f
to
461b8fa
Compare
TxInput::OrderAccountCommand
without nonces
b558f29
to
8c03c73
Compare
8c03c73
to
816b30b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Filled amount is now calculated based on the original ask/give price. This makes fill operations commutative. Though it has a negative consequence as potential remainder amounts, resulting in dust utxos produced on conclude, I don't think it's a major problem.
It is forbidden to fill order with 0 to enforce spending utxo in a tx making it unique and not replayable.
Nonce forAccountCommand::FillOrder
is ignored. This is a bit hacky because nonce is still present making it confusing. But I think that this is more like an exception and refactoring out nonce fromTxInput::AccountCommand
seems like not worth it.Nonce forAccountCommand::ConcludeOrder
is kept. Also I'm planning to keep it for the upcomingAccountCommand::FreezeOrder
. Though it seems like it can be removed I don't see a point in doing it.Ignoring nonce forced me to add fork logic toTransactionVerifier::disconnect_transaction
function because we don't need to decrement nonce for fill orders after the fork.Same fork logic goes intoapi-server
andwallet
. Though for wallet it required changingOutputCache
logic which looks messy and I'm don't quite like it (alternative solution below can fix that).UPDATE:
TxInput::OrderAccountCommand
with FillOrder and ConcludeOrder commands.OrderAccountCommand
are completely removed.OrderAccountCommand::ConcludeOrder
now contains remaining amounts that can be withdrawn from an account so that these amount can be used by hw wallet and also get into a signature. Also these amounts are checked in TransactionVerifier