-
Notifications
You must be signed in to change notification settings - Fork 2
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
RCP-241101A: Consensus ordering v2 #15
Comments
Thinking about this, I see some issues.
Some examples to clarify the mentioned points, assuming the contract commits to a blockchain-specific parameter of 3 and that StA inputs have 3+ confirmations already.
|
Yes, I agree this seems to be a problem. I think I have come to understanding how we can live without any consensus ordering at all; working on proof of concept. |
Background
Consensus ordering is a way how we deterministically define a order in which contract operations are validated and added to the contract state. The details of the current procedure and discussion can be found in RCP-241013A and RCP-240731A.
Motivation
Assume a sequence of state transitions
StA
,StB
,StC
, with each one following transition spending inputs of the previous one. Let us name the corresponding witness transactionsWtxA
,WtxB
,WtxC
. Lets assume these transactions are otherwise unrelated (i.e. they do not spend outputs of each other neither directly or indirectly, i.e. do not belong to the same transaction graph onchain). In this case, a re-org may happen such thatWtxC
will be included in a block beforeWtxB
, puttingStC
in a consensus ordering beforeStB
, makingStB
state either invalid - or requiring a validation algorithm to include state from arbitrary state transition, including unvalidated ones. This is in fact a side-channeling which makes it really hard to formally ensure and audit that all state transitions are validated in the right way.The problem is doubled by the fact that one contract may operate over multiple chains.
Proposal
Example
Order = height + pow / factor
Rationale
The proposed approach allows to run all parts of the validation and contract state computation in one go, without an introduction of any side-channel information which may potentially skip the normal validation flow. It is also easy to audit.
The use of PoW value instead of nonce is needed to prevent malicious actors from using high value for the nonce, requiring beneficiaries to wait a long time before being able to use assets in a secure way.
PoW is divided over a blockchain-specific factor since each blockchain has a different block production time, and thus a different amount of work would be needed
The text was updated successfully, but these errors were encountered: