Skip to content

Commit

Permalink
allow earlier proofs from other regular provers
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Aug 25, 2023
1 parent daa9b30 commit 1c807c8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ library LibProving {
revert L1_INVALID_ORACLE_PROVER();
}
} else {
// Regular prover
// A block can be proven by a regular prover in the following cases:
// 1. The actual prover is the assigned prover
// 2. The block has at least one fork choice (which must be from the
// assigned prover)
// 3. The block has become open
if (
evidence.prover != blk.prover
evidence.prover != blk.prover && blk.nextForkChoiceId == 1
&& block.timestamp <= blk.proposedAt + config.proofWindow
) revert L1_NOT_PROVEABLE();
}
Expand Down
6 changes: 3 additions & 3 deletions packages/protocol/test/L1/TaikoL1Oracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ contract TaikoL1OracleTest is TaikoL1TestBase {
printVariables("");
}

/// @dev Test if system proofs can be verified
/// @dev Test if oracle proofs can be verified
function test_L1_if_oracle_proofs_can_be_verified_without_regular_proofs()
external
{
Expand Down Expand Up @@ -433,7 +433,7 @@ contract TaikoL1OracleTest is TaikoL1TestBase {
printVariables("");
}

/// @dev Test if there is no system/oracle proofs
/// @dev Test if there is no oracle proofs
function test_L1_if_there_is_no_oracle_prover_there_is_no_overwrite_at_all()
external
{
Expand Down Expand Up @@ -483,7 +483,7 @@ contract TaikoL1OracleTest is TaikoL1TestBase {
);

// Carol could not overwrite it
vm.expectRevert(TaikoErrors.L1_NOT_PROVEABLE.selector);
vm.expectRevert(TaikoErrors.L1_ALREADY_PROVEN.selector);
proveBlock(
Carol,
Carol,
Expand Down
4 changes: 2 additions & 2 deletions packages/status-page/src/utils/buildStatusIndicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export async function buildStatusIndicators(
indicators.push({
provider: config.l1Provider,
contractAddress: config.l1TaikoAddress,
header: "Latest System Proof",
header: "Latest Oradle Proof",
intervalInMs: 0,
status: "0",
watchStatusFunc: async (
Expand Down Expand Up @@ -449,7 +449,7 @@ export async function buildStatusIndicators(
colorFunc: function (status: Status) {
return "green"; // todo: whats green, yellow, red?
},
tooltip: "The timestamp of the latest system proof",
tooltip: "The timestamp of the latest oracle proof",
});

indicators.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/status-page/src/utils/getNumProvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getNumProvers = async (
uniqueProversResp.data.provers.splice(index, 1);
uniqueProversResp.data.uniqueProvers--;
}
// Filter out the system prover address since it doesn't submit the actual zk proof
// Filter out the oracle prover address since it doesn't submit the actual zk proof
const systemIndex = uniqueProversResp.data.provers.findIndex(
(uniqueProver) =>
uniqueProver.address === "0x0000000000000000000000000000000000000001"
Expand Down
4 changes: 2 additions & 2 deletions packages/website/pages/docs/concepts/proving.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Currently, you only need a single proof from any prover to verify a block.

The oracle prover is a prover from a unique address (our own address) that is able to override the community prover. This is a safety mechanism we have in place while the ZK-EVM is still in development and in case an invalid block was marked as verified from a community proof.

### System prover
### Oracle prover

A system prover generates a fake proof to mark a block as verified. We only require a real proof to be generated every N blocks. Otherwise, we accept a fake, system proof, and mark the block as verified. This is a temporary testnet feature to reduce the cost for community provers.
A oracle prover generates a fake proof to mark a block as verified. We only require a real proof to be generated every N blocks. Otherwise, we accept a fake, oracle proof, and mark the block as verified. This is a temporary testnet feature to reduce the cost for community provers.

### The proof cooldown period

Expand Down

0 comments on commit 1c807c8

Please sign in to comment.