Commit e8c763d
eth/tracers: apply block header overrides correctly (ethereum#32183)
Fixes ethereum#32175.
This fixes the scenario where the blockhash opcode would return 0x0
during RPC simulations when using BlockOverrides with a future block
number. The root cause was that BlockOverrides.Apply() only modified the
vm.BlockContext, but GetHashFn() depends on the actual
types.Header.Number to resolve valid historical block hashes. This
caused a mismatch and resulted in incorrect behavior during trace and
call simulations.
---------
Co-authored-by: shantichanal <158101918+shantichanal@users.noreply.github.com>
Co-authored-by: lightclient <lightclient@protonmail.com>1 parent c2bf2b0 commit e8c763d
2 files changed
+44
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
957 | 959 | | |
958 | 960 | | |
959 | | - | |
960 | | - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
961 | 971 | | |
962 | | - | |
963 | | - | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
964 | 976 | | |
965 | 977 | | |
966 | 978 | | |
967 | 979 | | |
968 | 980 | | |
969 | | - | |
970 | | - | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
971 | 984 | | |
972 | 985 | | |
973 | 986 | | |
974 | | - | |
| 987 | + | |
975 | 988 | | |
976 | 989 | | |
977 | 990 | | |
978 | 991 | | |
979 | 992 | | |
980 | 993 | | |
981 | | - | |
| 994 | + | |
982 | 995 | | |
983 | 996 | | |
984 | | - | |
| 997 | + | |
985 | 998 | | |
986 | 999 | | |
987 | 1000 | | |
988 | 1001 | | |
989 | | - | |
| 1002 | + | |
990 | 1003 | | |
991 | 1004 | | |
992 | 1005 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
| |||
788 | 789 | | |
789 | 790 | | |
790 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
791 | 811 | | |
792 | 812 | | |
793 | 813 | | |
| |||
0 commit comments