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

Commit

Permalink
dummy proof must be 32 bytes now as protocol relies on that
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Jun 30, 2023
1 parent ef2ad5d commit b8011c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
13 changes: 10 additions & 3 deletions prover/proof_producer/dummy_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ func (d *DummyProofProducer) RequestProof(
BlockID: blockID,
Meta: meta,
Header: header,
ZkProof: []byte{0xff},
Degree: CircuitsDegree10Txs,
Opts: opts,
// proof must be 32 bytes min since protocol uses bytes utils and reads 32 bytes, so even
// make proofs must be 32 bytes
ZkProof: []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff,
},
Degree: CircuitsDegree10Txs,
Opts: opts,
}
})

Expand Down
5 changes: 5 additions & 0 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ func (p *Prover) cancelProof(ctx context.Context, blockID uint64) {
}
}

// checkProofWindowsExpired iterates through the current blocks waiting for proof window to expire,
// which are blocks that have been proposed, but we were not selected as the prover. if the proof window
// has expired, we can start generating a proof for them.
func (p *Prover) checkProofWindowsExpired(ctx context.Context) error {
for i, blockId := range p.currentBlocksWaitingForProofWindow {
if err := p.checkProofWindowExpired(ctx, i, blockId); err != nil {
Expand All @@ -698,6 +701,8 @@ func (p *Prover) checkProofWindowsExpired(ctx context.Context) error {
return nil
}

// checkProofWindowExpired checks a single instance of a block to see if its proof winodw has expired
// and the proof is now able to be submitted by anyone, not just the blocks assigned prover.
func (p *Prover) checkProofWindowExpired(ctx context.Context, i int, blockId uint64) error {
p.currentBlocksWaitingForProofWindowMutex.Lock()
defer p.currentBlocksWaitingForProofWindowMutex.Unlock()
Expand Down
4 changes: 1 addition & 3 deletions testutils/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ func (s *ClientTestSuite) SetupTest() {

amtTko := new(big.Int).Mul(amt, big.NewInt(8))

log.Info("amtTko", "amt", amtTko.String())

// proposer has tKO, need to transfer to prover
_, err = s.RpcClient.TaikoTokenL1.Transfer(proposerOpts, crypto.PubkeyToAddress(l1ProverPrivKey.PublicKey), amtTko)
s.Nil(err)
Expand All @@ -114,7 +112,7 @@ func (s *ClientTestSuite) SetupTest() {
uint16(rewardPerGas),
uint16(capacity),
)
s.Nil(err, "2")
s.Nil(err)
}

s.Nil(rpcCli.L1RawRPC.CallContext(context.Background(), &s.testnetL1SnapshotID, "evm_snapshot"))
Expand Down

0 comments on commit b8011c0

Please sign in to comment.