Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Update public input circuit for new protocol release #78

Closed
Brechtpd opened this issue Apr 24, 2023 · 6 comments · May be fixed by #91
Closed

Update public input circuit for new protocol release #78

Brechtpd opened this issue Apr 24, 2023 · 6 comments · May be fixed by #91

Comments

@Brechtpd
Copy link

No description provided.

@Brechtpd Brechtpd changed the title Updata public input circuit for new protocol release Update public input circuit for new protocol release Apr 24, 2023
@johntaiko
Copy link

johntaiko commented Apr 27, 2023

reference: taikoxyz/taiko-mono#13640

The new public input

staticRefs

index filed type remark
0 signal_service address l1 signal service
1 signal_service address l2 signal service
2 taiko address l2 taiko address

metaHash(get it from l1 contract, DONOTNEED calculate it by yourself

index filed type remark
0 id[192:256]+timestamp[128:192]+l1Height[64:128] uint256 l2 block number+timestamp+l1 parent block height
1 l1Hash uint256 l1 parent block hash
2 mixHash uint256 block difficulty * l2 block number
3 depositsRoot uint256 the root hash of deposits for miner
4 txListHash uint256 l2 tx list hash
5 txListByteStart[232:256]+txListByteEnd[208:232]+gasLimit[176:208]+beneficiary[16:176]+cacheTxListInfo[8:16] uint256
6 treasure[96:256] uint256

public input format

index filed type remark
0 staticRefs uint256 hash(staticRefs)
1 metaHash uint256 hash(metadata)
2 parentHash uint256 l2 parent block hash
3 blockHash uint256 l2 block hash
4 signalRoot uint256 l1 signal root
5 graffiti uint256 zero bytes
6 prover[96:256]+parentGasUsed[64:96]+gasUsed[32:64] uint256 prover address+l2 parent block.GasUsed+l2 block.GasUsed

How to get these inputs in circuits?

  • l1_signal_service constant value
  • l2_signal_service constant value
  • l2 taiko address constant value
  • metaHash get by l1 contract rpc contracts/L1/libs/LibProposing.sol/getBlock
    • get from prover program flags
  • parentHash parentGasUsed get from taiko-node
  • blockHash gasUsed get from taiko-node
  • signalRoot get from Anchor transaction (the second param)
  • graffiti just zero bytes get from prover program flags
  • prover get from prover program flags

What do I need to test?

TBD

What do I need to keep in mind?

  • do not split hash into high and low parts anymore

@Brechtpd
Copy link
Author

l1_signal_service constant value
l2_signal_service constant value
l2 taiko address constant value

Yeah you can hard-code staticRefs in the rust code, but I guess best to still put these values in advice cells just in case we need to change them. :)

graffiti: just zero bytes

Graffiti can be non-zero bytes right? So should put in the actual bytes.

@johntaiko
Copy link

Graffiti can be non-zero bytes right? So should put in the actual bytes.

Let me check

@Brechtpd
Copy link
Author

Brechtpd commented May 2, 2023

2 more changes to take into account:

  • Only transaction within txListByteStart and txListByteEnd actually need to be decoded
  • The transactions within txListByteStart and txListByteEnd may contain garbage data

@johntaiko
Copy link

Graffiti can be non-zero bytes right? So should put in the actual bytes.

Let me check

graffiti is used as extra data, so we can get it from taiko-client as passed by prover flags

@Brechtpd
Copy link
Author

Brechtpd commented May 5, 2023

The use of staticRefs was removed: taikoxyz/taiko-mono#13709

@johntaiko johntaiko linked a pull request May 11, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants