-
Notifications
You must be signed in to change notification settings - Fork 148
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
pruntime: Event chain #1304
pruntime: Event chain #1304
Conversation
Concept ACK. Will review the detailed code soon. |
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.
Would be nice if we can also copy part of the PR description as a RFC in the repo for future reference.
} | ||
Err(_) => { | ||
error!("Contract emitted an invalid pink event"); | ||
} | ||
} | ||
} else { | ||
ink_events.push((address, event.topics, data)); | ||
ink_events.push((address.clone(), event.topics.clone(), data.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 know which tx the event belongs to based on the above information? If not, I suggest to add more data fields since it would be nice if we can group events emitted by a single call.
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.
Events are already grouped by single call because each call would emit a events block.
For contract call, we can further add the nonce
to the corresponding events block, so that it can be connect to the original tx from the Phala chain.
Added.
Added |
Also added entry contract to the block. @h4x3rotab |
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.
LGTM
Overview
This PR adds an events chain for external tools to track some public information about Clusters.
This is an alternative(maybe better) solution for #1287
The events chain blocks are emitted via logs so that pruntime can optionally turn it off.
Example log:
we can write some script to collect them.
Drawback of #1287
There is a drawback in #1287 that there is always storage overhead to store the history records for each contract and the storage usage is not charged to any account.
We might still need the
driver_history
part in #1287 since it is low storage overhead and charged, so I extract it to a new PR #1305.What information would be emitted?
All events from the
System::events()
except some private pink messages would be emitted.Please check the list below to make sure no privacy info would be leaked:
For the ink event we extended to communicate to runtime, we filtered out the private ones: