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

feat(prover): generate an oracle proof if incoming proof is incorrect #311

Merged
merged 5 commits into from
Jul 12, 2023

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented Jul 11, 2023

if parentGasUsed and parentHash are correct, but blockHash is incorrect, generate an oracle proof and skip the current proofWindowExpired check.

also include 3 general fixes:

  • we were not checking blockHash before when checking isValidProof before cancelling proof generation even for regular provers, so fixed that.

  • we should remove the block from p.currentBlocksWaitingForProofWindow in prover regardless of what happens after the proof window expires, right now it was only in one conditional block, which would lead to the map growing very large unnecessarily and checking too many blocks. we should also compare block hash here.

  • was passing in l2BlockId instead of l1Height to p.proveNotify when checking expired windows

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #311 (d8665af) into main (1f667fc) will decrease coverage by 1.03%.
The diff coverage is 20.65%.

❗ Current head d8665af differs from pull request most recent head dc84204. Consider uploading reports for the commit dc84204 to get more accurate results

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
- Coverage   51.90%   50.88%   -1.03%     
==========================================
  Files          36       36              
  Lines        3859     3911      +52     
==========================================
- Hits         2003     1990      -13     
- Misses       1604     1668      +64     
- Partials      252      253       +1     
Impacted Files Coverage Δ
prover/prover.go 42.17% <20.65%> (-6.52%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

prover/prover.go Outdated Show resolved Hide resolved
@davidtaikocha davidtaikocha enabled auto-merge (squash) July 12, 2023 09:11
@davidtaikocha davidtaikocha enabled auto-merge (squash) July 12, 2023 09:11
@davidtaikocha davidtaikocha merged commit 003a86b into main Jul 12, 2023
@davidtaikocha davidtaikocha deleted the oracle_proof_on_incorrect_proof branch July 12, 2023 09:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(prover): only submit an oracle proof when there is a new invalid normal proof
2 participants