-
Notifications
You must be signed in to change notification settings - Fork 6
preemptive provable assertions #78
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
base: main
Are you sure you want to change the base?
Conversation
This is just a pass-through for L1QueriesPublicationTime but I will extend it with other types of assertions
The previous explanation for retroactively creating assertions was incorrect because any retroactive change will nullify a preconfirmation. Now the proposer can set an asserter address that can create new assertions at any time during the publication
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 current implementation focuses on making the block invalid if assertions fail, which is great for security. One thing to consider is whether the proposer's stake gets slashed in that event (since this is similar to an invalid block proposal).
This might be handled outside of this PR (perhaps by the Proposer/Prover market contract), but it’s part of the bigger picture: preemptive assertions provide a signal that a block is likely valid; if that signal is false, there should be consequences. Right?
uint256[] memory results = new uint256[](nQueries); | ||
for (uint256 i = 0; i < nQueries; i++) { | ||
require(queries[i].destination != address(publicationFeed), "Cannot query publication feed"); | ||
(bool success, bytes memory returndata) = queries[i].destination.call(queries[i].callData); |
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.
For safety, should we use .staticcall
instead of .call
when executing L1 queries in TaikoInbox.publish
here? We only need to read data.
{ | ||
constructor(address taikoAnchor) PreemptiveProvableAssertionsBase(taikoAnchor) {} | ||
|
||
function resolveAssertions(bytes32 attributesHash, bytes calldata proofs) external onlyAnchor { |
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.
Quick question on the gas usage of resolveAssertions(bytes32 attributesHash, bytes calldata proofs)
:
It seems the gas cost could grow with the number and complexity of assertions. How do we plan to balance this practically? Is there a recommended maximum number of assertions per publication, or perhaps guidelines for keeping assertion logic lightweight?
Draft PR to explain the idea in #67
To understand what's going on, I recommend starting with the comments in
PreemptiveProvableAssertionsBase
and the changes toTaikoAnchor
. Everything else is just examples of particular kinds of assertions that a proposer could make.