Skip to content

Commit

Permalink
getInstance -> calcInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
dong77 committed Oct 19, 2023
1 parent ee4f93e commit 362ee57
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
* **pos-dashboard:** Changed font color of error message ([#14543](https://github.com/taikoxyz/taiko-mono/issues/14543)) ([279d4e9](https://github.com/taikoxyz/taiko-mono/commit/279d4e96bf378eb651b91976d7729b0675ea1368))
* **protocol:** block reward must be minted ([#14595](https://github.com/taikoxyz/taiko-mono/issues/14595)) ([e92b1da](https://github.com/taikoxyz/taiko-mono/commit/e92b1da2ced73c2b28a825fce916acededab0a39))
* **protocol:** change transition ID from uint16 to uint32 ([#14620](https://github.com/taikoxyz/taiko-mono/issues/14620)) ([c8969b6](https://github.com/taikoxyz/taiko-mono/commit/c8969b64bbaacf9ec6d239608509424fdc02ee97))
* **protocol:** remove proof from getInstance calculation ([#14623](https://github.com/taikoxyz/taiko-mono/issues/14623)) ([2eedc33](https://github.com/taikoxyz/taiko-mono/commit/2eedc33c213cb5d0abf9daa8bc9bd21b730ae6af))
* **protocol:** remove proof from calcInstance calculation ([#14623](https://github.com/taikoxyz/taiko-mono/issues/14623)) ([2eedc33](https://github.com/taikoxyz/taiko-mono/commit/2eedc33c213cb5d0abf9daa8bc9bd21b730ae6af))
* **protocol:** revert impl deployment V2 ([#14621](https://github.com/taikoxyz/taiko-mono/issues/14621)) ([7e59e0b](https://github.com/taikoxyz/taiko-mono/commit/7e59e0b0077e4d81bcd5333bc6f0900e0761d6ea))
* **relayer:** Eth bridge ([#14609](https://github.com/taikoxyz/taiko-mono/issues/14609)) ([f5207ae](https://github.com/taikoxyz/taiko-mono/commit/f5207ae19c48d9aaa83dab2739cd05d9c2985112))

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

* **protocol:** block reward must be minted ([#14595](https://github.com/taikoxyz/taiko-mono/issues/14595)) ([e92b1da](https://github.com/taikoxyz/taiko-mono/commit/e92b1da2ced73c2b28a825fce916acededab0a39))
* **protocol:** change transition ID from uint16 to uint32 ([#14620](https://github.com/taikoxyz/taiko-mono/issues/14620)) ([c8969b6](https://github.com/taikoxyz/taiko-mono/commit/c8969b64bbaacf9ec6d239608509424fdc02ee97))
* **protocol:** remove proof from getInstance calculation ([#14623](https://github.com/taikoxyz/taiko-mono/issues/14623)) ([2eedc33](https://github.com/taikoxyz/taiko-mono/commit/2eedc33c213cb5d0abf9daa8bc9bd21b730ae6af))
* **protocol:** remove proof from calcInstance calculation ([#14623](https://github.com/taikoxyz/taiko-mono/issues/14623)) ([2eedc33](https://github.com/taikoxyz/taiko-mono/commit/2eedc33c213cb5d0abf9daa8bc9bd21b730ae6af))
* **protocol:** revert impl deployment V2 ([#14621](https://github.com/taikoxyz/taiko-mono/issues/14621)) ([7e59e0b](https://github.com/taikoxyz/taiko-mono/commit/7e59e0b0077e4d81bcd5333bc6f0900e0761d6ea))

## [0.13.0](https://github.com/taikoxyz/taiko-mono/compare/protocol-v0.12.0...protocol-v0.13.0) (2023-08-15)
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/contracts/L1/verifiers/PseZkVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract PseZkVerifier is EssentialContract, IVerifier {
// Do not run proof verification to contest an existing proof
if (isContesting) return;

bytes32 instance = getInstance(prover, evidence);
bytes32 instance = calcInstance(prover, evidence);

// Validate the instance using bytes utilities.
bool verified = LibBytesUtils.equal(
Expand Down Expand Up @@ -75,7 +75,7 @@ contract PseZkVerifier is EssentialContract, IVerifier {
if (bytes32(ret) != keccak256("taiko")) revert L1_INVALID_PROOF();
}

function getInstance(
function calcInstance(
address prover,
TaikoData.BlockEvidence memory evidence
)
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/L1/TaikoL1TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ abstract contract TaikoL1TestBase is TestBase {
proof: new bytes(102)
});

bytes32 instance = pv.getInstance(prover, evidence);
bytes32 instance = pv.calcInstance(prover, evidence);
uint16 verifierId = 300; // 300 as see mock verifier in line 95

evidence.proof = bytes.concat(
Expand Down
2 changes: 1 addition & 1 deletion packages/website/pages/docs/concepts/proposing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The anchor transaction is required to be the first transaction in a Taiko block

When the block is proposed, the TaikoL1 contract will set some L2 block metadata such as `meta.coinbase`, which is the sender of the proposeBlock() tx. When the L2 client builds the L2 block, it will set the `block.coinbase` to this `meta.coinbase` specified for the block on L1. The validity proof (ZKP) for this block must check that the `block.coinbase` is indeed the `meta.coinbase` recorded on L1.

When the ZKP instance is returned from the `TaikoL1` contract with `getInstance()`, the `evidence.metaHash` for the proposed block is included. This is how the ZKP verifier can check that the L2's `block.coinbase` (and other block-level variables as well) are correctly set to what is specified in the metadata on L1.
When the ZKP instance is returned from the `TaikoL1` contract with `calcInstance()`, the `evidence.metaHash` for the proposed block is included. This is how the ZKP verifier can check that the L2's `block.coinbase` (and other block-level variables as well) are correctly set to what is specified in the metadata on L1.

## How does the proposer earn TKO

Expand Down

0 comments on commit 362ee57

Please sign in to comment.