Skip to content
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

Merged
merged 9 commits into from
Jan 31, 2022

Conversation

gdanezis
Copy link
Collaborator

@gdanezis gdanezis commented Jan 29, 2022

  • This PR circumvents bug [fastx Authority] Deleted objects cause incorrect client reads #282 when doing client driven sync between authorities. It does that by implementing a call OrderRequestInfo on the authority that retrieves an OrderInfoResponse by TransactionDigest.
  • It also augments the effects structure to include a 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.
  • Incidentally a bug was corrected involving the previous_transaction field of mutated objects not being updated by the adaptor.

@gdanezis gdanezis changed the title [fastx client / auth] Fix [fastx client / auth] Add OrderInfoRequest to authority and use it for more robust sync. Jan 29, 2022
@gdanezis gdanezis added this to the Milestone 3 milestone Jan 29, 2022
@@ -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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

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>,
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@gdanezis gdanezis merged commit f06ff78 into main Jan 31, 2022
@gdanezis gdanezis deleted the order-info-flow branch January 31, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants