-
Notifications
You must be signed in to change notification settings - Fork 87
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
ENG-314: copy monza crates to suzuka #47
Conversation
Move and rename shared crates under protocol-units/execution/aptos: - opt-executor - utils
@@ -1,5 +1,5 @@ | |||
[package] | |||
name = "monza-opt-executor" | |||
name = "movement-opt-executor" |
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 would call this aptos-opt-executor
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.
This would make it look like one of the aptos-core crates, which would be confusing.
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.
How about suzuka-opt-executor
?
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.
This is now shared between Monza and Suzuka, though I don't know if it will always be so.
@@ -1,5 +1,5 @@ | |||
[package] | |||
name = "monza-execution-util" | |||
name = "movement-execution-util" |
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.
Again, if we're talking about extracting generalized aptos
executors, I would title these as such.
use aptos_types::transaction::SignedTransaction; | ||
|
||
#[derive(Clone)] | ||
pub struct MonzaExecutorV1 { |
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.
Should be called SuzukaExecutorV1
. Similar updates elsewhere.
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.
Thanks! Just renaming comments and a few questions.
@@ -1,19 +1,19 @@ | |||
#[derive(Debug, Clone, PartialEq, Eq)] | |||
pub struct Config { | |||
pub execution_config : monza_execution_util::config::Config, | |||
pub execution_config : movement_execution_util::config::Config, | |||
} |
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.
Should the directory for this file still be monza/monza-config/
? I think we want it renamed to networks/suzuka/suzuka-config/src/lib
, or are we keeping these monza dir names? Seems confusing if we kept them.
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.
If I understood @l-monninger correctly, there is to be the common part of configuration, now in movement_execution_util
, composed with the protocol-specific configuration like here in monza_config
.
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.
Yeah, that util will be shared across units using the movement-opt-executor
-> maptos-opt-executor
.
} | ||
|
||
impl Config { | ||
|
||
pub fn new(execution_config : monza_execution_util::config::Config) -> Self { | ||
pub fn new(execution_config : movement_execution_util::config::Config) -> Self { |
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.
pub fn new(execution_config : movement_execution_util::config::Config) -> Self { | |
pub fn new(execution_config : suzuka_execution_util::config::Config) -> Self { |
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.
Same as above.
|
||
Url::from_str( | ||
format!("http://{}", MONZA_CONFIG.monza_config.aptos_rest_listen_url.as_str()).as_str() | ||
).unwrap() |
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.
Same as above
#[tokio::test] | ||
async fn test_example_interaction() -> Result<()> { | ||
// :!:>section_1a | ||
let rest_client = Client::new(NODE_URL.clone()); |
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.
Can we drop the comments //!:>section_1a
they seem overally verbose
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.
Perhaps, I just copied this from the monza crate.
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.
It's because this is also a an example interaction copied from the Aptos upstream.
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.
Fine to leave for now IMO.
light_node_client: Arc<RwLock<LightNodeServiceClient<tonic::transport::Channel>>>, | ||
} | ||
|
||
impl <T : MonzaExecutor + Send + Sync + Clone>MonzaPartialFullNode<T> { |
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.
impl <T : MonzaExecutor + Send + Sync + Clone>MonzaPartialFullNode<T> { | |
impl <T : SuzukaExecutor + Send + Sync + Clone>SuzukaPartialFullNode<T> { |
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.
Also it looks like proper formatting is not enforced in the workspace, which it should be. I'll look into adding a CI check.
@@ -0,0 +1,68 @@ | |||
[package] | |||
name = "suzuka-executor" |
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.
👍
|
||
|
||
#[tonic::async_trait] | ||
pub trait MonzaExecutor { |
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.
If this is going to be a generalised Executor :
pub trait MonzaExecutor { | |
pub trait MovementExecutor { |
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.
No, this is a Suzuka-specific crate.
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.
But the trait itself could be migrated into a common crate if it needs to be, I haven't looked into such things yet.
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.
Yeah, this should be Suzuka specific.
/// The block is committed to the state, at this point | ||
/// fork choices must be resolved otherwise the commitment and subsequent execution will fail. | ||
Commit, | ||
} |
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's remove this enum, its dead code now. And all its doc comments
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.
@l-monninger agree?
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.
Yeah, I honestly thought I had already dropped this.
These environment variable names are prefixed with |
These names were confusing, rename to MonzaPartialNode and SuzukaPartialNode
1b0c7b3
to
664e786
Compare
I like prefixes targeting the particular unit. So, let's go with whatever we call the |
Also, @mzabaluev, why are you force pushing? Is something up? |
@mzabaluev @0xmovses |
@mzabaluev
I am going to approve. In particular, because Richard and I may have an easier time working on Suzuka over the weekend if this is merged. If you get a chance to merge, go for it. |
No, just coalescing some fixup commits into larger topical changes, also rebased against latest |
Idc. With PR flow it doesn't matter too much. Was just wondering. |
Create boilerplate for suzuka network and executor by copying the monza crates.
Shared crates renamed and moved under
protocol-units/execution/aptos
: