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] connect authority to adapter #43

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

sblackshear
Copy link
Collaborator

Lots more to be done here, but this is a start at finally connecting these two key components!

  • Add Storage trait + implement it for AuthorityState
  • Implement the ResourceResolver and ModuleResolver traits for AuthorityState so it can be used as a DB by the Move VM
  • Generalize adapter to operate over Storage trait rather than FastXStateView
  • Add logic for handling MoveCall order type in the authority
  • Add e2e test that creates a MoveCall order invoking a nonexistent module that fails appropriately

Note: this temporarily breaks the CLI version of the fastX adapter (which is not hooked up to tests anyway). It can be fixed by implementing the Storage trait for FastXStateView + doing a few other things, but I left it broken for now since this PR is already quite meaty.

@@ -555,8 +555,8 @@ where
self.next_sequence_number = new_next_sequence_number;
// Sanity check
assert_eq!(
self.sent_certificates.len(),
self.next_sequence_number.into()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I do not understand, the compiler becomes unhappy with this into() after my PR! Perhaps it has a resource budget for inference (into() is pretty magical) and I've exceeded it with my changes elsewhere?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In those cases, you can just mention the qualified syntax of the instance of From / Into that you plan to use:
https://github.com/sblackshear/fastnft/pull/1

Lots more to be done here, but this is a start at finally connecting these two key components!

- Add `Storage` trait + implement it for `AuthorityState`
- Implement the `ResourceResolver` and `ModuleResolver` traits for `AuthorityState` so it can be used as a DB by the Move VM
- Generalize adapter to operate over `Storage` trait rather than `FastXStateView`
- Add logic for handling `MoveCall` order type in the authority
- Add e2e test that creates a `MoveCall` order invoking a nonexistent module that fails appropriately

Note: this temporarily breaks the CLI version of the fastX adapter. It can be fixed by implementing the `Storage` trait for `FastXStateView` + doing a few other things, but I left it broken for now since this PR is already quite meaty.
@@ -169,6 +182,9 @@ impl Authority for AuthorityState {
let output_sequence_number = input_sequence_number.increment()?;
output_object.next_sequence_number = output_sequence_number;

let input_ref = input_object.to_object_reference();
let output_ref = output_object.to_object_reference();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan to pass input_ref to adaptor call as well and generate output_ref based on adaptor call result?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will change a lot... see #39 for a peek into the future.

The order should carry a list of input ObjectRef's, and executing the order will create a list of output ObjectRef's (as you suggest).

@sblackshear sblackshear merged commit 4766cb5 into MystenLabs:main Dec 10, 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.

[fastx] Merge the traits from fastnftexec-experimental and example execution into the fastnft
3 participants