-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[programmability] processing logic for module publishing #59
Conversation
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.
I think we have a collision on 'handle_confirmation_order'. Happy for you to land this and me to merge, or the other way around.
|
||
// Order-specific logic | ||
// | ||
// TODO: think very carefully what to do in case we throw an Err here. | ||
match &order.kind { | ||
let outputs = match order.kind { |
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.
Sadly I think we modified the same section in 'handle_confirmation_order'. I think that the abstraction that records the outputs and deletions is now complete in #62 and you should be able to use it as it is. Right?
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.
Yep, your fix is much more general. I will use it.
@@ -234,23 +237,31 @@ impl Authority for AuthorityState { | |||
Some(c.gas_budget), | |||
) | |||
.map_err(|_| FastPayError::MoveExecutionFailure)?; | |||
// TODO: return output objects here | |||
Vec::new() |
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, PR #62 takes care of this.
// Note: State is mutated below and should be committed in an atomic way | ||
// to memory or persistent storage. Currently this is done in memory | ||
// through the calls to store being infallible. | ||
outputs |
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.
Here if you just to a 'write' to the temporary store (see #62 ) I think it works.
@@ -260,6 +271,7 @@ impl Authority for AuthorityState { | |||
|
|||
// Add new object, init locks and remove old ones | |||
self.insert_object(output_object); | |||
// TODO: no need to init order locks for immutable outputs |
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.
Let me address this in PR #62 .
Filling out the logic for processing a module publish message. This will allow us to define a fastX genesis transaction containing an initial set of modules, which we need for testing anything with programmability. This is a bit rough (see the many inline TODO's/tasks), but an important step toward getting a system w/ programmability working end-to-end! - Added the `TxContext` type, which knows how to generate globally unique ID's from the digest of the current transaction. - Add `adapter::publish`, which deserializes/verifies a set of input modules, generates fresh object ID's for them, and returns fastX objects containing each module - Filled out the authority code path that handles a module publish message, did some refactoring to make sure the modules get persisted as output objects - Added an end-to-end test demonstrating successful publishing of a module.
b9a2f32
to
17482e8
Compare
Filling out the logic for processing a module publish message. This will allow us to define a fastX genesis transaction containing an initial set of modules, which we need for testing anything with programmability.
This is a bit rough (see the many inline TODO's/tasks), but an important step toward getting a system w/ programmability working end-to-end!
TxContext
type, which knows how to generate globally unique ID's from the digest of the current transaction.adapter::publish
, which deserializes/verifies a set of input modules, generates fresh object ID's for them, and returns fastX objects containing each module