Skip to content

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

nikeshnazareth
Copy link
Collaborator

@nikeshnazareth nikeshnazareth commented Mar 20, 2025

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 to TaikoAnchor. Everything else is just examples of particular kinds of assertions that a proposer could make.

@xiaodino xiaodino self-requested a review March 24, 2025 05:41
Copy link
Collaborator

@xiaodino xiaodino left a 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);
Copy link
Collaborator

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 {
Copy link
Collaborator

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?

@LeoPatOZ LeoPatOZ mentioned this pull request Mar 27, 2025
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.

2 participants