Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow transactions to explicitly specify mutual exclusion. #349
It is oftentimes nice to leave the fee field unconstrained (but capped at some
This commit adds a new msgpack field, "lock" (called Excludes in the
A new unit test was added to ledger_test.go.
It is oftentimes nice to leave the fee field unconstrained (but capped at some max value) so that a transaction submitter can later pick a fee appropriately at submission time. However, for contracts that don't close accounts, this leaves the possibility of replay open. This commit adds a new msgpack field, "lock" (called Excludes in the implementation), which allows transactions to specify that they are mutually exclusive with other transactions. If this field is nonzero in a transaction, then once the transaction is confirmed, it acquires the lock identified by the (Sender, Excludes) pair of the transaction until the LastValid round passes. While this transaction possesses the lock, no other transaction specifying this lock can be confirmed.