-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
3303 lines (3028 loc) · 205 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ethereum Light</title>
<base href="https://eth-light.xyz/" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" crossorigin="anonymous"/>
<style>
@font-face {
font-family: 'm_1mmedium';
src: url('mplus-1m-medium-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'm_1mlight';
src: url('mplus-1m-light-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
a {
text-decoration: none;
}
table {
border-collapse: collapse;
}
#mdMaster {
width: 270px;
height: 100vh;
position: fixed;
left: 0;
top: 0;
background-color: #f9f9f9;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 10px;
overflow-y: scroll;
}
#mdDetail {
margin-left: 300px;
padding: 10px;
}
.headerMaster {
margin: 10px 0px 5px;
padding: 10px 5px 10px;
background-color: #e9e9e9;
border-radius: 5px;
}
.headerMasterBeaconRoot {
font-family: 'm_1mmedium', monospace;
font-size: 1em;
text-align: center;
}
.headerMasterInfo {
padding: 0px 3px 0px 3px;
font-family: 'm_1mlight', monospace;
font-size: 0.7em;
}
.headerMasterInfo table {
white-space: nowrap;
}
.headerMasterInfo td {
width: 60px;
padding-top: 5px;
}
.kv td {
padding-top: 10px;
vertical-align: top;
white-space: nowrap;
}
.description {
font-family: 'm_1mlight', monospace;
}
.kvKey {
font-family: 'm_1mlight', monospace;
text-align: right;
width: 270px;
padding-right: 10px;
}
.kvValue {
font-family: 'm_1mmedium', monospace;
text-align: left;
}
.fas {
width: 12px;
text-align: center;
}
#beaconApiBase, #executionApiBase, #trustedBlockRoot {
width: 230px;
font-family: 'm_1mlight', monospace;
}
</style>
</head>
<body>
<div id="mdMaster">
<div id="masterTop" class="headerMaster">
<div class="headerMasterInfo">
<table style="width: 100%">
<tr>
<td>
<input type="button" id="settingsButton" value="Settings" />
<span style="float: right;"><input type="button" id="specsButton" value="Specs" /></span>
</td>
</tr>
</table>
</div>
</div>
<div id="settings" class="headerMaster" hidden="hidden">
<div class="headerMasterInfo">
<table style="width: 100%">
<tr>
<td><span class="fas fa-satellite-dish"></span> <input id="beaconApiBase" value="https://beacon-api.eth-light.xyz" /></td>
</tr>
<tr>
<td><span class="fas fa-cogs"></span> <input id="executionApiBase" value="https://execution-api.eth-light.xyz/v1/mainnet" /></td>
</tr>
<tr>
<td><span class="fas fa-shield-alt"></span> <input id="trustedBlockRoot" value="0x269826302c4795141c5ed0b6912da0aef9951706161b51a2a5c6735180142c14" /></td>
</tr>
<tr>
<td><input type="button" id="initButton" value="Save" disabled /></td>
</tr>
</table>
</div>
</div>
<div id="headerList" hidden="hidden"></div>
<div id="selectedHeaderDetail" hidden="hidden">
<div id="selectedHeader" class="headerMaster">
<div id="selectedBeaconRoot" class="headerMasterBeaconRoot"></div>
<div class="headerMasterInfo">
<table style="width: 100%">
<tr>
<td><span class="fas fa-satellite-dish"></span> <span id="selectedBeaconSlot"></span></td>
<td><span class="fas fa-cubes"></span> <span id="selectedExecutionBlockNumber"></span></td>
<td colspan="2" style="text-align: right;"><span class="fas fa-clock"></span> <span id="selectedExecutionTimestamp"></span></td>
</tr>
<tr>
<td><span class="fas fa-user-check"></span> <span id="selectedBeaconProposerIndex"></span></td>
<td colspan="2" class="a"><span class="fas fa-tachometer-alt"></span> <span id="selectedExecutionGasUsedPercentage"></span> <span id="selectedExecutionGasUsed"></span>/<span id="selectedExecutionGasLimit"></span></td>
<td style="text-align: right;"><span class="fas fa-fire-flame-curved"></span> <span id="selectedExecutionBaseFeePerGas"></span></td>
</tr>
<tr>
<td colspan="4"><span class="fas fa-hand-holding-usd"></span> <span id="selectedExecutionFeeRecipient" style="display: inline-block; transform: scaleX(1.015); transform-origin: left;"></span></td>
</tr>
<tr>
<td colspan="4">Transactions <span id="selectedTransactionInfo" style="float: right;"></span></td>
</tr>
<tr>
<td colspan="4">Receipts <span id="selectedReceiptInfo" style="float: right;"></span></td>
</tr>
<tr>
<td colspan="4"><input type="button" id="backButton" value="Back" /> <span style="float: right;">(SSZ with Snappy)</span></td>
</tr>
</table>
</div>
</div>
<div id="selectedTransactionList"></div>
</div>
</div>
<div id="mdDetail">
<div id="specsDetail" style="text-align: center;">
<div class="headerMaster" style="width: 1000px; margin-top: 57px; margin-bottom: 57px; margin-left: auto; margin-right: auto;">
<table class="kv" style="width: 100%;">
<thead style="border-bottom: 1px solid #d9d9d9;">
<tr>
<td class="kvKey" style="padding-bottom: 10px;"> </td>
<td class="kvValue">All displayed data is validated against the trusted checkpoint beacon block root (settings)</td>
</tr>
</thead>
<tr>
<td class="kvKey">Consensus light client</td>
<td class="kvValue">
<a href="https://www.youtube.com/watch?v=ZHNrAXf3RDE" target="_blank">Overview (video)</a><br />
<a href="https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/light-client.md" target="_blank">Sync process</a><br />
<a href="https://github.com/status-im/nimbus-eth2/blob/stable/beacon_chain/libnimbus_lc/libnimbus_lc.h" target="_blank">Wasm library</a><br />
<a href="https://github.com/eth-clients/eth2-networks/tree/master/shared/mainnet" target="_blank">Mainnet network config</a><br />
<a href="https://ethereum.github.io/beacon-APIs/#/Beacon/getLightClientBootstrap" target="_blank">/eth/v1/beacon/light_client/bootstrap/{block_root}</a><br />
<a href="https://ethereum.github.io/beacon-APIs/#/Beacon/getLightClientUpdatesByRange" target="_blank">/eth/v1/beacon/light_client/updates</a><br />
<a href="https://ethereum.github.io/beacon-APIs/#/Beacon/getLightClientFinalityUpdate" target="_blank">/eth/v1/beacon/light_client/finality_update</a><br />
<a href="https://ethereum.github.io/beacon-APIs/#/Beacon/getLightClientOptimisticUpdate" target="_blank">/eth/v1/beacon/light_client/optimistic_update</a><br />
<a href="https://ethereum.github.io/beacon-APIs/#/Events/eventstream" target="_blank">/eth/v1/events</a><br />
</td>
</tr>
<tr>
<td class="kvKey">Execution APIs</td>
<td class="kvValue">
<a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash" target="_blank">eth_getBlockByHash</a><br />
<a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt" target="_blank">eth_getTransactionReceipt</a><br />
</td>
</tr>
<tr>
<td class="kvKey">Transactions</td>
<td class="kvValue">
<a href="https://ethereum.github.io/yellowpaper/paper.pdf" target="_blank">Yellow paper</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-155" target="_blank">Replay protection (EIP-155)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-2718" target="_blank">Typed transactions (EIP-2718)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-2930" target="_blank">Access lists (EIP-2930)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-1559" target="_blank">Priority fees (EIP-1559)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Blob transactions (EIP-4844)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Set code transactions (EIP-7702)</a><br />
</td>
</tr>
<tr>
<td class="kvKey">Receipts</td>
<td class="kvValue">
<a href="https://eips.ethereum.org/EIPS/eip-658" target="_blank">Status code (EIP-658)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-2718" target="_blank">Typed receipts (EIP-2718)</a><br />
</td>
</tr>
<tr>
<td class="kvKey">Withdrawals</td>
<td class="kvValue">
<a href="https://eips.ethereum.org/EIPS/eip-4895" target="_blank">Withdrawals (EIP-4895)</a><br />
</td>
</tr>
<tr>
<td class="kvKey">RLP</td>
<td class="kvValue">
<a href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/" target="_blank">Serialization</a><br />
<a href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/" target="_blank">Merkle Patricia Trie</a><br />
<a href="https://github.com/ethereum/devp2p/blob/master/caps/eth.md" target="_blank">Networking</a><br />
</td>
</tr>
<tr>
<td class="kvKey">SSZ</td>
<td class="kvValue">
<a href="https://eth2book.info/capella/part2/building_blocks/ssz/" target="_blank">Introduction</a><br />
<a href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/ssz/" target="_blank">Overview</a><br />
<a href="https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md" target="_blank">Serialization</a><br />
<a href="https://github.com/ethereum/consensus-specs/blob/dev/ssz/merkle-proofs.md" target="_blank">Merkleization</a><br />
</td>
</tr>
<tr>
<td class="kvKey">Pending EIPs</td>
<td class="kvValue">
<a href="https://eips.ethereum.org/EIPS/eip-7495" target="_blank">SSZ StableContainer (EIP-7495)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-6404" target="_blank">SSZ Transactions (EIP-6404)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-6466" target="_blank">SSZ Receipts (EIP-6466)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-6493" target="_blank">SSZ Transaction Signature Scheme (EIP-6493)</a><br />
<a href="https://eips.ethereum.org/EIPS/eip-6465" target="_blank">SSZ Withdrawals Root (EIP-6465)</a><br />
</td>
</tr>
</table>
</div>
</div>
<div id="selectedTransactionRlpDetail" hidden="hidden" style="text-align: center;">
<div class="headerMaster" style="width: 1000px; margin-top: 57px; margin-bottom: 57px; margin-left: auto; margin-right: auto;">
<table class="kv" style="width: 100%;">
<thead style="border-bottom: 1px solid #d9d9d9;">
<tr>
<td class="kvKey" style="padding-bottom: 10px;">Hash</td>
<td class="kvValue"><div id="selectedTransactionRlpHash"></div></td>
</tr>
</thead>
<tbody>
<tr id="selectedTransactionRlpHasType">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2718" target="_blank">EIP-2718</a> type</td>
<td class="kvValue"><span id="selectedTransactionRlpType"></span> <span class="description">(<span id="selectedTransactionRlpTypeDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Payload length</td>
<td class="kvValue"><span id="selectedTransactionRlpLength"></span> <span class="description">(<span id="selectedTransactionRlpLengthDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionRlpHasChainId">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-155" target="_blank">Chain ID</a></td>
<td class="kvValue"><span id="selectedTransactionRlpChainIdLength"></span> <span id="selectedTransactionRlpChainId"></span></td>
</tr>
<tr>
<td class="kvKey">Nonce</td>
<td class="kvValue"><span id="selectedTransactionRlpNonceLength"></span> <span id="selectedTransactionRlpNonce"></span> <span class="description">(<span id="selectedTransactionRlpNonceDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionRlpHasMaxPriorityFeePerGas">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-1559" target="_blank">Max prio fee per gas</a></td>
<td class="kvValue"><span id="selectedTransactionRlpMaxPriorityFeePerGasLength"></span> <span id="selectedTransactionRlpMaxPriorityFeePerGas"></span> <span class="description">(<span id="selectedTransactionRlpMaxPriorityFeePerGasDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Max fee per gas</td>
<td class="kvValue"><span id="selectedTransactionRlpMaxFeePerGasLength"></span> <span id="selectedTransactionRlpMaxFeePerGas"></span> <span class="description">(<span id="selectedTransactionRlpMaxFeePerGasDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Gas</td>
<td class="kvValue"><span id="selectedTransactionRlpGasLength"></span> <span id="selectedTransactionRlpGas"></span> <span class="description">(<span id="selectedTransactionRlpGasDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">To</td>
<td class="kvValue"><span id="selectedTransactionRlpToLength"></span> <span id="selectedTransactionRlpTo"></span> <span class="description">(<span id="selectedTransactionRlpToDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Value</td>
<td class="kvValue"><span id="selectedTransactionRlpValueLength"></span> <span id="selectedTransactionRlpValue"></span> <span class="description">(<span id="selectedTransactionRlpValueDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Input</td>
<td class="kvValue"><span id="selectedTransactionRlpInputLength"></span> <span class="description">(<span id="selectedTransactionRlpInputDescription"></span>)</span> <span id="selectedTransactionRlpInput"></span></td>
</tr>
<tr id="selectedTransactionRlpHasAccessList">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2930" target="_blank">Access list</a><span id="selectedTransactionRlpAccessListLabel"></span></td>
<td class="kvValue"><span id="selectedTransactionRlpAccessListLength"></span> <span class="description">(<span id="selectedTransactionRlpAccessListDescription"></span>)</span> <span id="selectedTransactionRlpAccessList"></span></td>
</tr>
<tr id="selectedTransactionRlpHasMaxFeePerBlobGas">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Max fee per blob gas</a></td>
<td class="kvValue"><span id="selectedTransactionRlpMaxFeePerBlobGasLength"></span> <span id="selectedTransactionRlpMaxFeePerBlobGas"></span> <span class="description">(<span id="selectedTransactionRlpMaxFeePerBlobGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionRlpHasBlobVersionedHashes">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Blob versioned hashes</a></td>
<td class="kvValue"><span id="selectedTransactionRlpBlobVersionedHashesLength"></span> <span class="description">(<span id="selectedTransactionRlpBlobVersionedHashesDescription"></span>)</span> <span id="selectedTransactionRlpBlobVersionedHashes"></span></td>
</tr>
<tr id="selectedTransactionRlpHasAuthorizationList">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Authorization list</a><span id="selectedTransactionRlpAuthorizationListLabel"></span></td>
<td class="kvValue"><span id="selectedTransactionRlpAuthorizationListLength"></span> <span class="description">(<span id="selectedTransactionRlpAuthorizationListDescription"></span>)</span> <span id="selectedTransactionRlpAuthorizationList"></span></td>
</tr>
<tr>
<td class="kvKey">V</td>
<td class="kvValue"><span id="selectedTransactionRlpVLength"></span> <span id="selectedTransactionRlpV"></span> <span class="description">(<span id="selectedTransactionRlpVDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">R</td>
<td class="kvValue"><span id="selectedTransactionRlpRLength"></span> <span id="selectedTransactionRlpR"></span></td>
</tr>
<tr>
<td class="kvKey">S</td>
<td class="kvValue"><span id="selectedTransactionRlpSLength"></span> <span id="selectedTransactionRlpS"></span></td>
</tr>
<tr>
<td class="kvKey"> </td>
<td class="kvValue"><input type="button" id="copyTransactionRlpButton" value="Copy" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="selectedReceiptRlpDetail" hidden="hidden" style="text-align: center;">
<div class="headerMaster" style="width: 1000px; margin-top: 57px; margin-bottom: 57px; margin-left: auto; margin-right: auto;">
<table class="kv" style="width: 100%;">
<thead style="border-bottom: 1px solid #d9d9d9;">
<tr>
<td class="kvKey" style="padding-bottom: 10px;">Transaction hash</td>
<td class="kvValue"><div id="selectedReceiptRlpTransactionHash"></div></td>
</tr>
</thead>
<tbody>
<tr id="selectedReceiptRlpHasType">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2718" target="_blank">EIP-2718</a> type</td>
<td class="kvValue"><span id="selectedReceiptRlpType"></span> <span class="description">(<span id="selectedReceiptRlpTypeDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Payload length</td>
<td class="kvValue"><span id="selectedReceiptRlpLength"></span> <span class="description">(<span id="selectedReceiptRlpLengthDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptRlpHasRoot">
<td class="kvKey">Root</td>
<td class="kvValue"><span id="selectedReceiptRlpRootLength"></span> <span id="selectedReceiptRlpRoot"></span></td>
</tr>
<tr id="selectedReceiptRlpHasStatus">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-658" target="_blank">Status</a></td>
<td class="kvValue"><span id="selectedReceiptRlpStatusLength"></span> <span id="selectedReceiptRlpStatus"></span> <span class="description">(<span id="selectedReceiptRlpStatusDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Cumulative gas used</td>
<td class="kvValue"><span id="selectedReceiptRlpCumulativeGasUsedLength"></span> <span id="selectedReceiptRlpCumulativeGasUsed"></span> <span class="description">(<span id="selectedReceiptRlpCumulativeGasUsedDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Logs Bloom</td>
<td class="kvValue"><span id="selectedReceiptRlpLogsBloomLength"></span> <span id="selectedReceiptRlpLogsBloom"></span></td>
</tr>
<tr>
<td class="kvKey">Logs<span id="selectedReceiptRlpLogsLabel"></span></td>
<td class="kvValue"><span id="selectedReceiptRlpLogsLength"></span> <span class="description">(<span id="selectedReceiptRlpLogsDescription"></span>)</span> <span id="selectedReceiptRlpLogs"></span></td>
</tr>
<tr>
<td class="kvKey"> </td>
<td class="kvValue"><input type="button" id="copyReceiptRlpButton" value="Copy" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="selectedTransactionEip6404Detail" hidden="hidden" style="text-align: center;">
<div class="headerMaster" style="width: 1000px; margin-top: 57px; margin-bottom: 57px; margin-left: auto; margin-right: auto;">
<table class="kv" style="width: 100%;">
<thead style="border-bottom: 1px solid #d9d9d9;">
<tr>
<td class="kvKey" style="padding-bottom: 10px;"><a href="https://eips.ethereum.org/EIPS/eip-6404" target="_blank">EIP-6404</a> root</td>
<td class="kvValue"><div id="selectedTransactionEip6404Root"></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="kvKey">Payload offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadOffset"></span> <span class="description">(start +<span id="selectedTransactionEip6404PayloadOffsetDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Signature offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404SignatureOffset"></span> <span class="description">(start +<span id="selectedTransactionEip6404SignatureOffsetDescription"></span>)</span></td>
</tr>
<tr>
<td class="kvKey">Payload active fields</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadActiveFields"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadActiveFieldsDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasType">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2718" target="_blank">EIP-2718</a> type</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadType"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadTypeDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasChainId">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-155" target="_blank">EIP-155</a> chain ID</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadChainId"></span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasNonce">
<td class="kvKey">Nonce</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadNonce"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadNonceDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxFeesPerGasOffset">
<td class="kvKey">Fees offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxFeesPerGasOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadMaxFeesPerGasOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasGas">
<td class="kvKey">Gas</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadGas"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasTo">
<td class="kvKey">To</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadTo"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadToDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasValue">
<td class="kvKey">Value</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadValue"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadValueDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasInputOffset">
<td class="kvKey">Input offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadInputOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadInputOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasAccessListOffset">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2930" target="_blank">Access list</a> offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadAccessListOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadAccessListOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxPriorityFeesPerGasOffset">
<td class="kvKey">Priority fees offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxPriorityFeesPerGasOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadMaxPriorityFeesPerGasOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasBlobVersionedHashesOffset">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Blob versioned hashes</a> offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadBlobVersionedHashesOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadBlobVersionedHashesOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasAuthorizationListOffset">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Authorization list</a> offset</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadAuthorizationListOffset"></span> <span class="description">(payload data +<span id="selectedTransactionEip6404PayloadAuthorizationListOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxFeesPerGas">
<td class="kvKey">Fees active fields</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxFeesPerGasActiveFields"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxFeesPerGasActiveFieldsDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxFeePerRegularGas">
<td class="kvKey">Max fee per regular gas</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxFeePerRegularGas"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxFeePerRegularGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxFeePerBlobGas">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Max fee per blob gas</a></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxFeePerBlobGas"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxFeePerBlobGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasInput">
<td class="kvKey">Input</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadInput"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadInputDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasAccessList">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-2930" target="_blank">Access list</a><span id="selectedTransactionEip6404PayloadAccessListLabel"></span></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadAccessListStart"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadAccessListDescription"></span>)</span> <span id="selectedTransactionEip6404PayloadAccessList"></span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxPriorityFeesPerGas">
<td class="kvKey">Priority fees active fields</td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxPriorityFeesPerGasActiveFields"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxPriorityFeesPerGasActiveFieldsDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxPriorityFeePerRegularGas">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-1559" target="_blank">Max prio fee per regular gas</a></td></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxPriorityFeePerRegularGas"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxPriorityFeePerRegularGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasMaxPriorityFeePerBlobGas">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Max prio fee per blob gas</a></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadMaxPriorityFeePerBlobGas"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadMaxPriorityFeePerBlobGasDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasBlobVersionedHashes">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-4844" target="_blank">Blob versioned hashes</a><span id="selectedTransactionEip6404PayloadBlobVersionedHashesLabel"></span></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadBlobVersionedHashes"></span></td>
</tr>
<tr id="selectedTransactionEip6404PayloadHasAuthorizationList">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Authorization list</a><span id="selectedTransactionEip6404PayloadAuthorizationListLabel"></span></td>
<td class="kvValue"><span id="selectedTransactionEip6404PayloadAuthorizationListStart"></span> <span class="description">(<span id="selectedTransactionEip6404PayloadAuthorizationListDescription"></span>)</span> <span id="selectedTransactionEip6404PayloadAuthorizationList"></span></td>
</tr>
<tr>
<td class="kvKey">Signature active fields</td>
<td class="kvValue"><span id="selectedTransactionEip6404SignatureActiveFields"></span> <span class="description">(<span id="selectedTransactionEip6404SignatureActiveFieldsDescription"></span>)</span></td>
</tr>
<tr id="selectedTransactionEip6404SignatureHasSecp256k1">
<td class="kvKey">Secp256k1</td>
<td class="kvValue"><span id="selectedTransactionEip6404SignatureSecp256k1"></span></td>
</tr>
<tr>
<td class="kvKey"> </td>
<td class="kvValue"><input type="button" id="copyTransactionEip6404Button" value="Copy" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="selectedReceiptEip6466Detail" hidden="hidden" style="text-align: center;">
<div class="headerMaster" style="width: 1000px; margin-top: 57px; margin-bottom: 57px; margin-left: auto; margin-right: auto;">
<table class="kv" style="width: 100%;">
<thead style="border-bottom: 1px solid #d9d9d9;">
<tr>
<td class="kvKey" style="padding-bottom: 10px;"><a href="https://eips.ethereum.org/EIPS/eip-6404" target="_blank">EIP-6404</a> transaction root</td>
<td class="kvValue"><div id="selectedReceiptEip6404TransactionRoot"></div></td>
</tr>
</thead>
<tbody>
<tr>
<td class="kvKey">Active fields</td>
<td class="kvValue"><span id="selectedReceiptEip6466ActiveFields"></span> <span class="description">(<span id="selectedReceiptEip6466ActiveFieldsDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasFrom">
<td class="kvKey">From</td>
<td class="kvValue"><span id="selectedReceiptEip6466From"></span> <span class="description">(<span id="selectedReceiptEip6466FromDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasGasUsed">
<td class="kvKey">Gas used</td>
<td class="kvValue"><span id="selectedReceiptEip6466GasUsed"></span> <span class="description">(<span id="selectedReceiptEip6466GasUsedDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasContractAddress">
<td class="kvKey">Contract address</td>
<td class="kvValue"><span id="selectedReceiptEip6466ContractAddress"></span> <span class="description">(<span id="selectedReceiptEip6466ContractAddressDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasLogsOffset">
<td class="kvKey">Logs offset</td>
<td class="kvValue"><span id="selectedReceiptEip6466LogsOffset"></span> <span class="description">(data +<span id="selectedReceiptEip6466LogsOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasStatus">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-658" target="_blank">Status</a></td>
<td class="kvValue"><span id="selectedReceiptEip6466Status"></span> <span class="description">(<span id="selectedReceiptEip6466StatusDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasAuthoritiesOffset">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Authorities</a> offset</td>
<td class="kvValue"><span id="selectedReceiptEip6466AuthoritiesOffset"></span> <span class="description">(data +<span id="selectedReceiptEip6466AuthoritiesOffsetDescription"></span>)</span></td>
</tr>
<tr id="selectedReceiptEip6466HasLogs">
<td class="kvKey">Logs<span id="selectedReceiptEip6466LogsLabel"></span></td>
<td class="kvValue"><span id="selectedReceiptEip6466LogsStart"></span> <span class="description">(<span id="selectedReceiptEip6466LogsDescription"></span>)</span> <span id="selectedReceiptEip6466Logs"></span></td>
</tr>
<tr id="selectedReceiptEip6466HasAuthorities">
<td class="kvKey"><a href="https://eips.ethereum.org/EIPS/eip-7702" target="_blank">Authorities</a><span id="selectedReceiptEip6466AuthoritiesLabel"></span></td>
<td class="kvValue"><span id="selectedReceiptEip6466Authorities"></span></td>
</tr>
<tr>
<td class="kvKey"> </td>
<td class="kvValue"><input type="button" id="copyReceiptEip6466Button" value="Copy" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
const networkMetadataPath = 'https://raw.githubusercontent.com/eth-clients/eth2-networks/master/shared/mainnet';
async function loadCfg() {
let response = undefined;
do {
if (response !== undefined) {
await new Promise(r => setTimeout(r, 5000));
}
response = await fetch(networkMetadataPath + '/config.yaml');
} while (!response.ok);
const data = await response.text();
const fileContent = Module.stringToNewUTF8(data);
const cfg = Module._ETHConsensusConfigCreateFromYaml(fileContent);
assert(cfg);
Module._free(fileContent);
return cfg;
}
async function loadGenesis(cfg) {
const consensusFork = Module._ETHConsensusConfigGetConsensusVersionAtEpoch(cfg, /* epoch: */ 0);
const response = await fetch(networkMetadataPath + '/genesis.ssz');
assert(response.ok);
const data = await response.arrayBuffer();
const sszBytes = new Uint8Array(data)
const sszBytesPtr = Module._malloc(sszBytes.length);
Module.HEAPU8.set(sszBytes, sszBytesPtr);
const state = Module._ETHBeaconStateCreateFromSsz(cfg, consensusFork, sszBytesPtr, sszBytes.length);
assert(state);
Module._free(sszBytesPtr);
return state;
}
var Module = {};
let beaconApiBase = undefined;
let executionApiBase = undefined;
const zeroHash = '0x0000000000000000000000000000000000000000000000000000000000000000';
function toArray(bytes, numBytes) {
return Array.from(Module.HEAPU8.subarray(bytes, bytes + numBytes));
}
function byteToHexString(byte) {
return byte.toString(16).padStart(2, '0');
}
function arrayToHexString(array) {
return array.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
}
function toHexString(bytes, numBytes) {
return '0x' + arrayToHexString(toArray(bytes, numBytes));
}
function arrayToDecString(array) {
if (array.length === 0) {
return '0';
}
return BigInt('0x' + arrayToHexString(array)).toString();
}
function toDecString(bytes, numBytes) {
return BigInt('0x' + arrayToHexString(toArray(bytes, numBytes).reverse())).toString();
}
function arrayToBinString(array) {
return array.reduce((str, byte) => str + byte.toString(2).padStart(8, '0').split('').reverse().join(''), '');
}
function toHumanReadableByteCountString(numBytes) {
if (numBytes >= 1e12) {
return (numBytes / 1e12).toFixed(1) + ' TB';
}
if (numBytes >= 1e11) {
return (numBytes / 1e9).toFixed(0) + ' GB';
}
if (numBytes >= 1e9) {
return (numBytes / 1e9).toFixed(1) + ' GB';
}
if (numBytes >= 1e8) {
return (numBytes / 1e6).toFixed(0) + ' MB';
}
if (numBytes >= 1e6) {
return (numBytes / 1e6).toFixed(1) + ' MB';
}
if (numBytes >= 1e5) {
return (numBytes / 1e3).toFixed(0) + ' KB';
}
if (numBytes >= 1e3) {
return (numBytes / 1e3).toFixed(1) + ' KB';
}
if (numBytes == 1) {
return numBytes + ' byte';
}
return numBytes + ' bytes';
}
function toHumanReadableNumberString(number) {
if (number >= 1e12) {
return (number / 1e12).toFixed(1) + 't';
}
if (number >= 1e11) {
return (number / 1e9).toFixed(0) + 'b';
}
if (number >= 1e9) {
return (number / 1e9).toFixed(1) + 'b';
}
if (number >= 1e8) {
return (number / 1e6).toFixed(0) + 'm';
}
if (number >= 1e6) {
return (number / 1e6).toFixed(1) + 'm';
}
if (number >= 1e5) {
return (number / 1e3).toFixed(0) + 'k';
}
if (number >= 1e3) {
return (number / 1e3).toFixed(1) + 'k';
}
return number.toString();
}
function toDateString(timestamp) {
const date = new Date(timestamp * 1000);
const year = date.getFullYear();
const month = ('0' + (date.getMonth() + 1)).slice(-2);
const day = ('0' + date.getDate()).slice(-2);
const hours = ('0' + date.getHours()).slice(-2);
const minutes = ('0' + date.getMinutes()).slice(-2);
const seconds = ('0' + date.getSeconds()).slice(-2);
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function arrayToGweiString(array) {
if (array.length === 0) {
return '0';
}
const wei = BigInt('0x' + array.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), ''));
const weiString = wei.toString().padStart(9, '0');
const beforeDecimal = weiString.substring(0, weiString.length - 9);
if (beforeDecimal === '') {
return '0';
}
return beforeDecimal;
}
function toGweiString(bytes, numBytes) {
return arrayToGweiString(Array.from(Module.HEAPU8.subarray(bytes, bytes + numBytes)).reverse());
}
function arrayToEthString(array) {
if (array.length === 0) {
return '0';
}
const wei = BigInt('0x' + array.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), ''));
const weiString = wei.toString().padStart(18, '0');
const beforeDecimal = weiString.substring(0, weiString.length - 18);
const afterDecimal = weiString.substring(weiString.length - 18).replace(/0+$/, '');
if (beforeDecimal === '') {
if (afterDecimal === '') {
return '0';
}
return '0.' + afterDecimal;
}
if (afterDecimal === '') {
return beforeDecimal;
}
return beforeDecimal + '.' + afterDecimal;
}
function toEthString(bytes, numBytes) {
return arrayToEthString(Array.from(Module.HEAPU8.subarray(bytes, bytes + numBytes)).reverse());
}
function getBeaconRoot(header) {
const beaconRoot = Module._ETHLightClientHeaderCopyBeaconRoot(header, cfg);
const beaconRootString = toHexString(beaconRoot, 32);
Module._ETHRootDestroy(beaconRoot);
return beaconRootString;
}
function getBeaconSlot(header) {
const beacon = Module._ETHLightClientHeaderGetBeacon(header);
return Module._ETHBeaconBlockHeaderGetSlot(beacon);
}
function initHeadersCache() {
let headers = [];
let byRoot = {};
let executionBlocks = {};
return {
'add': function (header, cfg) {
const beaconRoot = getBeaconRoot(header);
if (byRoot[beaconRoot]) {
return;
}
const beaconSlot = getBeaconSlot(header);
const i = headers.findIndex(x => (beaconSlot > getBeaconSlot(x)) ||
(beaconSlot == getBeaconSlot && beaconRoot < getBeaconRoot(x)));
const copy = Module._ETHLightClientHeaderCreateCopy(header)
headers.splice(i >= 0 ? i : headers.length, 0, copy);
byRoot[beaconRoot] = copy;
if (headers.length > 128) {
const removedHeader = headers.pop();
const removedBeaconRoot = getBeaconRoot(removedHeader);
const removedExecutionBlock = executionBlocks[removedBeaconRoot];
if (removedExecutionBlock) {
const [removedExecutionBlockHeader, removedTransactions, removedReceipts] = removedExecutionBlock;
delete executionBlocks[removedBeaconRoot];
Module._ETHReceiptsDestroy(removedReceipts);
Module._ETHTransactionsDestroy(removedTransactions);
Module._ETHExecutionBlockHeaderDestroy(removedExecutionBlockHeader);
}
delete byRoot[removedBeaconRoot];
Module._ETHLightClientHeaderDestroy(removedHeader);
}
},
'getAll': function () {
return headers;
},
'get': function (beaconRoot) {
return byRoot[beaconRoot];
},
'setExecutionBlock': function (beaconRoot, executionBlock) {
executionBlocks[beaconRoot] = executionBlock;
},
'getExecutionBlock': function (beaconRoot) {
return executionBlocks[beaconRoot];
}
};
}
let headers = initHeadersCache();
async function fetchExecutionBlock(prefix, header) {
const executionHash = Module._ETHLightClientHeaderCopyExecutionHash(header, cfg);
try {
const executionHashString = toHexString(executionHash, 32);
if (executionHashString == zeroHash) return;
const beaconRoot = getBeaconRoot(header);
let executionBlock = headers.getExecutionBlock(beaconRoot);
if (executionBlock) {
return executionBlock;
}
let data;
try {
const executionBlockResponse = await fetch(executionApiBase, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_getBlockByHash',
params: [executionHashString, /* fullTransactions: */ true]
})
});
if (!executionBlockResponse.ok) return;
const executionBlockJson = await executionBlockResponse.json();
if (!executionBlockJson.result) return;
data = executionBlockJson.result;
} catch {
return;
}
if (!headers.get(beaconRoot)) return;
const fullTransactions = JSON.stringify(data.transactions);
for (txIndex in data.transactions) {
data.transactions[txIndex] = data.transactions[txIndex].hash;
}
document.getElementById(prefix + 'TransactionInfo').innerHTML =
data.transactions.length + ' transactions';
const allReceiptResponseFuts = data.transactions.map((transactionHashString) =>
fetch(executionApiBase, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_getTransactionReceipt',
params: [transactionHashString]
})
}));
let receiptsData = [];
for (receiptResponseFut of allReceiptResponseFuts) {
for (let i = 0; i < 20; i++) {
if (i) {
receiptResponseFut = fetch(executionApiBase, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'eth_getTransactionReceipt',
params: [data.transactions[receiptsData.length]]
})
});
}
try {
const receiptResponse = await receiptResponseFut;
if (!receiptResponse.ok) continue;
const receiptResponseJson = await receiptResponse.json();
if (!receiptResponseJson.result) continue;
receiptsData.push(receiptResponseJson.result);
document.getElementById(prefix + 'ReceiptInfo').innerHTML =
receiptsData.length + ' - Loading receipts…';
break;
} catch {
continue;
}
}
if (!headers.get(beaconRoot)) return;
}
const blockHeaderJson = Module.stringToNewUTF8(JSON.stringify(data));
const executionBlockHeader = Module._ETHExecutionBlockHeaderCreateFromJson(executionHash, blockHeaderJson);
Module._free(blockHeaderJson);
if (!executionBlockHeader) return;
const executionTransactionsRoot = Module._ETHExecutionBlockHeaderGetTransactionsRoot(executionBlockHeader);
const transactionsJson = Module.stringToNewUTF8(fullTransactions);
const transactions = Module._ETHTransactionsCreateFromJson(executionTransactionsRoot, transactionsJson);
Module._free(transactionsJson);
if (!transactions) {
Module._ETHExecutionBlockHeaderDestroy(executionBlockHeader);
return;
}
const execution = Module._ETHLightClientHeaderGetExecution(header);
const executionReceiptsRoot = Module._ETHExecutionPayloadHeaderGetReceiptsRoot(execution);
const receiptsJson = Module.stringToNewUTF8(JSON.stringify(receiptsData));
const receipts = Module._ETHReceiptsCreateFromJson(executionReceiptsRoot, receiptsJson, transactions);
Module._free(receiptsJson);
if (!receipts) {
Module._ETHTransactionsDestroy(transactions);
Module._ETHExecutionBlockHeaderDestroy(executionBlockHeader);
return;
}
executionBlock = [executionBlockHeader, transactions, receipts];
headers.setExecutionBlock(beaconRoot, executionBlock);
return executionBlock;
} finally {
Module._ETHRootDestroy(executionHash);
}
}
function toRlpInteger(b) {
const length = b.length;
assert(length > 0);
if (length == 1) {
return b[0];
}
return b[length - 1] + toRlpInteger(b.slice(0, -1)) * 256
}
function decodeRlpLength(input) {
const length = input.length;
assert(length > 0);
const prefix = input[0];
if (prefix <= 0x7f) {
return {
'offset': 0,
'dataLen': 1,
'type': 'str'
};
}
if (prefix <= 0xb7 && length > prefix - 0x80) {
const strLen = prefix - 0x80;
return {
'offset': 1,
'dataLen': strLen,
'type': 'str'
};
}
if (prefix <= 0xbf && length > prefix - 0xb7 && length > prefix - 0xb7 + toRlpInteger(input.slice(1, 1 + prefix - 0xb7))) {
const lenOfStrLen = prefix - 0xb7;
const strLen = toRlpInteger(input.slice(1, 1 + lenOfStrLen));
return {
'offset': 1 + lenOfStrLen,
'dataLen': strLen,
'type': 'str'
};
}
if (prefix <= 0xf7 && length > prefix - 0xc0) {
const listLen = prefix - 0xc0;
return {
'offset': 1,
'dataLen': listLen,
'type': 'list'
};
}
if (prefix <= 0xff && length > prefix - 0xf7 && length > prefix - 0xf7 + toRlpInteger(input.slice(1, 1 + prefix - 0xf7))) {
const lenOfListLen = prefix - 0xf7;
const listLen = toRlpInteger(input.slice(1, 1 + lenOfListLen));
return {
'offset': 1 + lenOfListLen,
'dataLen': listLen,
'type': 'list'
};
}
assert(false);
}