-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[fastx client / auth] Add OrderInfoRequest
to authority and use it for more robust sync.
#311
Conversation
OrderInfoRequest
to authority and use it for more robust sync.
@@ -207,6 +212,9 @@ impl Storage for AuthorityTemporaryStore { | |||
} | |||
} | |||
|
|||
// The adapter is not very disciplined at filling in the correct | |||
// previous transaction digest, so we ensure it is correct here. | |||
object.previous_transaction = self.tx_digest; |
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.
Good catch! Doesn't have to be here, but I think we should also move the increment of version
here to ensure that all the metadata update happens in one place (and I'm happy to tackle this--should be a small change). That will get us closer to a coherent discipline.
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.
My only worry is that objects before they are written to the temp_store are going around with the incorrect previous_transaction. As per issue: #312
pub events: Vec<Event>, | ||
/// The set of transaction digests this order depends on. | ||
pub dependencies: Vec<TransactionDigest>, |
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.
Wondering if we need this. If the client knows the input objects to this transaction (as we'd expect in practice), can't it derive the dependencies of an order on its own?
Further: my mental model of OrderEffects
is "the things that happened when the transaction got executed" (which I think is also suggested by the name). The other fields fit into this worldview--i.e., they are not knowable without executing the transaction (with the exception of transaction_digest
, which I think we could also consider eliminating). dependencies
also does not fit into this view because it can be known without executing the transaction.
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.
Ok, this is a tough one.
We need it somewhere that is either signed or within the chain of hashes from the latest objects / transactions to the genesis. The ideal place to put it would be within the certificate. This should in theory be possible, since the client should have the objects that are input into the cert, and is able to infer dependencies. But right now we are not at this place yet on the client side.
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.
Got it + very much aligned on the short-term and long-term plan.
7d4bed3
to
54a0468
Compare
OrderRequestInfo
on the authority that retrieves anOrderInfoResponse
byTransactionDigest
.dependencies
vector listing the transaction digests of the transactions that preceded this one, ie that are necessary to construct the version of the objects it relies on.previous_transaction
field of mutated objects not being updated by the adaptor.