Commit 265352c
fix(l1,l2): fix occasional error with
**Motivation**
<!-- Why does this pull request exist? What are its goals? -->
- Sometimes when we want a witness ethrex returns an error, this aims to
fix it.
**Description**
<!-- A clear and concise general description of the changes this PR
introduces -->
1. There's a bug that assumes that we have some data in a map that we
don't necessarily have. This is usually triggered when there's a call to
the BLOCKHASH opcode during a block. The idea is to requests all the
headers of intermediate blocks so that we can generate the witness
correctly.
2. Now the Guest Program accepts blocks with hash already computed, it
just recomputes it and compares the hash with the already set one (if
any), returning an error in case they differ. This was suggested in
eth-act/zkevm-benchmark-workload#177 and we
liked the idea.
Both changes are in the same PR because the goal was just to solve `1`
but as I was hashing the blocks when generating the witness I decided to
fix `2` elegantly so we can pass the Blockchain tests.
Closes #5250
---------
Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>debug_executionWitness (#5212)1 parent 9cfd1f1 commit 265352c
File tree
3 files changed
+67
-79
lines changed- crates
- blockchain
- common/types
3 files changed
+67
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | 498 | | |
514 | 499 | | |
515 | 500 | | |
| |||
538 | 523 | | |
539 | 524 | | |
540 | 525 | | |
541 | | - | |
| 526 | + | |
542 | 527 | | |
543 | 528 | | |
544 | 529 | | |
| |||
602 | 587 | | |
603 | 588 | | |
604 | 589 | | |
605 | | - | |
| 590 | + | |
606 | 591 | | |
607 | 592 | | |
608 | 593 | | |
| |||
696 | 681 | | |
697 | 682 | | |
698 | 683 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
| 684 | + | |
707 | 685 | | |
708 | 686 | | |
709 | 687 | | |
| |||
734 | 712 | | |
735 | 713 | | |
736 | 714 | | |
737 | | - | |
738 | | - | |
739 | | - | |
| 715 | + | |
| 716 | + | |
740 | 717 | | |
741 | | - | |
742 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
743 | 729 | | |
744 | | - | |
| 730 | + | |
745 | 731 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
| 732 | + | |
751 | 733 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
757 | 739 | | |
758 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
759 | 748 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 749 | + | |
770 | 750 | | |
771 | 751 | | |
772 | 752 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
495 | 494 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
| 495 | + | |
| 496 | + | |
505 | 497 | | |
| 498 | + | |
506 | 499 | | |
507 | 500 | | |
508 | 501 | | |
| |||
581 | 574 | | |
582 | 575 | | |
583 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
0 commit comments