-
Notifications
You must be signed in to change notification settings - Fork 91
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
Gas Profiling Implementation #2616
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
c87032e
to
2141623
Compare
c79e00b
to
1a93d61
Compare
72b6901
to
3dbc581
Compare
enable the gas event recording finish the gas profiling convert linear gas event list to stacked implement flamegraph for execution cargo clippy render html template add the content of the execution trace Put the gas profiling in moveos repo implement ClassifiedGasMeter and SwitchableGasMeter for GasProfiler cargo fmt add function execute_tx_locally add an command line argument for getStates command integrate gas profiler into the tx execution flow
900a100
to
1dd7886
Compare
@@ -146,7 +146,12 @@ impl Handler<StatesMessage> for ReaderExecutorActor { | |||
msg: StatesMessage, | |||
_ctx: &mut ActorContext, | |||
) -> Result<Vec<Option<ObjectState>>, anyhow::Error> { | |||
let resolver = RootObjectResolver::new(self.root.clone(), &self.moveos_store); | |||
let resolver = if let Some(state_root) = msg.state_root { | |||
let root_object_meta = ObjectMeta::root_metadata(state_root, 55); |
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 should we handle the size parameter?
Should it be passed from the client or retrieved from Node?
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.
Another way to implement it is to modify the state_resolver StateReader trait to support get_states and list_states by state root, so there is no need to construct a new RootObject
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.
In the read-only case, the VM do not use the size param, it can be zero.
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 is workable to implement this by directly setting the RootObject size to 0, but is there any ambiguity in constructing the RootObject for any state root query, such as the state root of a child object tree?
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.
The size is used by the ObjectRuntime; if the contract removes an element, the size will reduce. We do not record all Global root objects. This is a workaround solution; we will need to refactor in the future.
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.
Do not need to record all Global root objects , just modify the state_resolver StateReader trait to support get_states and list_states by state root , and it can elegantly solve the querying arbitrary state root scenarios.
It can be put in the subsequent refactor.
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.
There is already a StatelessResolver, which supports get_states by root; StateResolver is for the pin on a state_root and get states many times.
@@ -146,7 +146,12 @@ impl Handler<StatesMessage> for ReaderExecutorActor { | |||
msg: StatesMessage, | |||
_ctx: &mut ActorContext, | |||
) -> Result<Vec<Option<ObjectState>>, anyhow::Error> { | |||
let resolver = RootObjectResolver::new(self.root.clone(), &self.moveos_store); | |||
let resolver = if let Some(state_root) = msg.state_root { | |||
let root_object_meta = ObjectMeta::root_metadata(state_root, 55); |
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.
In the read-only case, the VM do not use the size param, it can be zero.
No description provided.