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

[programmability] processing logic for module publishing #59

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

sblackshear
Copy link
Collaborator

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.

Copy link
Collaborator

@gdanezis gdanezis left a 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 {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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()
Copy link
Collaborator

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

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

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 .

fastx_types/src/base_types.rs Outdated Show resolved Hide resolved
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.
@sblackshear sblackshear merged commit 6474fa8 into MystenLabs:main Dec 16, 2021
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.

[genesis] fastx genesis with initial modules and state
2 participants