@feelyourprotocol/util 8141.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +297 -0
- package/dist/cjs/account.d.ts +165 -0
- package/dist/cjs/account.d.ts.map +1 -0
- package/dist/cjs/account.js +530 -0
- package/dist/cjs/account.js.map +1 -0
- package/dist/cjs/address.d.ts +67 -0
- package/dist/cjs/address.d.ts.map +1 -0
- package/dist/cjs/address.js +136 -0
- package/dist/cjs/address.js.map +1 -0
- package/dist/cjs/authorization.d.ts +41 -0
- package/dist/cjs/authorization.d.ts.map +1 -0
- package/dist/cjs/authorization.js +135 -0
- package/dist/cjs/authorization.js.map +1 -0
- package/dist/cjs/bal.d.ts +129 -0
- package/dist/cjs/bal.d.ts.map +1 -0
- package/dist/cjs/bal.js +529 -0
- package/dist/cjs/bal.js.map +1 -0
- package/dist/cjs/binaryTree.d.ts +148 -0
- package/dist/cjs/binaryTree.d.ts.map +1 -0
- package/dist/cjs/binaryTree.js +240 -0
- package/dist/cjs/binaryTree.js.map +1 -0
- package/dist/cjs/blobs.d.ts +76 -0
- package/dist/cjs/blobs.d.ts.map +1 -0
- package/dist/cjs/blobs.js +175 -0
- package/dist/cjs/blobs.js.map +1 -0
- package/dist/cjs/bytes.d.ts +291 -0
- package/dist/cjs/bytes.d.ts.map +1 -0
- package/dist/cjs/bytes.js +606 -0
- package/dist/cjs/bytes.js.map +1 -0
- package/dist/cjs/constants.d.ts +91 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +97 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/db.d.ts +65 -0
- package/dist/cjs/db.d.ts.map +1 -0
- package/dist/cjs/db.js +14 -0
- package/dist/cjs/db.js.map +1 -0
- package/dist/cjs/env.d.ts +9 -0
- package/dist/cjs/env.d.ts.map +1 -0
- package/dist/cjs/env.js +13 -0
- package/dist/cjs/env.js.map +1 -0
- package/dist/cjs/errors.d.ts +3 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +19 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/helpers.d.ts +21 -0
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +50 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.d.ts +67 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internal.d.ts +72 -0
- package/dist/cjs/internal.d.ts.map +1 -0
- package/dist/cjs/internal.js +182 -0
- package/dist/cjs/internal.js.map +1 -0
- package/dist/cjs/kzg.d.ts +14 -0
- package/dist/cjs/kzg.d.ts.map +1 -0
- package/dist/cjs/kzg.js +3 -0
- package/dist/cjs/kzg.js.map +1 -0
- package/dist/cjs/lock.d.ts +15 -0
- package/dist/cjs/lock.d.ts.map +1 -0
- package/dist/cjs/lock.js +45 -0
- package/dist/cjs/lock.js.map +1 -0
- package/dist/cjs/mapDB.d.ts +17 -0
- package/dist/cjs/mapDB.d.ts.map +1 -0
- package/dist/cjs/mapDB.js +46 -0
- package/dist/cjs/mapDB.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/provider.d.ts +46 -0
- package/dist/cjs/provider.d.ts.map +1 -0
- package/dist/cjs/provider.js +84 -0
- package/dist/cjs/provider.js.map +1 -0
- package/dist/cjs/request.d.ts +20 -0
- package/dist/cjs/request.d.ts.map +1 -0
- package/dist/cjs/request.js +35 -0
- package/dist/cjs/request.js.map +1 -0
- package/dist/cjs/signature.d.ts +47 -0
- package/dist/cjs/signature.d.ts.map +1 -0
- package/dist/cjs/signature.js +147 -0
- package/dist/cjs/signature.js.map +1 -0
- package/dist/cjs/tasks.d.ts +32 -0
- package/dist/cjs/tasks.d.ts.map +1 -0
- package/dist/cjs/tasks.js +51 -0
- package/dist/cjs/tasks.js.map +1 -0
- package/dist/cjs/types.d.ts +64 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +78 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/units.d.ts +22 -0
- package/dist/cjs/units.d.ts.map +1 -0
- package/dist/cjs/units.js +51 -0
- package/dist/cjs/units.js.map +1 -0
- package/dist/cjs/withdrawal.d.ts +72 -0
- package/dist/cjs/withdrawal.d.ts.map +1 -0
- package/dist/cjs/withdrawal.js +93 -0
- package/dist/cjs/withdrawal.js.map +1 -0
- package/dist/esm/account.d.ts +165 -0
- package/dist/esm/account.d.ts.map +1 -0
- package/dist/esm/account.js +505 -0
- package/dist/esm/account.js.map +1 -0
- package/dist/esm/address.d.ts +67 -0
- package/dist/esm/address.d.ts.map +1 -0
- package/dist/esm/address.js +125 -0
- package/dist/esm/address.js.map +1 -0
- package/dist/esm/authorization.d.ts +41 -0
- package/dist/esm/authorization.d.ts.map +1 -0
- package/dist/esm/authorization.js +126 -0
- package/dist/esm/authorization.js.map +1 -0
- package/dist/esm/bal.d.ts +129 -0
- package/dist/esm/bal.d.ts.map +1 -0
- package/dist/esm/bal.js +522 -0
- package/dist/esm/bal.js.map +1 -0
- package/dist/esm/binaryTree.d.ts +148 -0
- package/dist/esm/binaryTree.d.ts.map +1 -0
- package/dist/esm/binaryTree.js +226 -0
- package/dist/esm/binaryTree.js.map +1 -0
- package/dist/esm/blobs.d.ts +76 -0
- package/dist/esm/blobs.d.ts.map +1 -0
- package/dist/esm/blobs.js +163 -0
- package/dist/esm/blobs.js.map +1 -0
- package/dist/esm/bytes.d.ts +291 -0
- package/dist/esm/bytes.d.ts.map +1 -0
- package/dist/esm/bytes.js +562 -0
- package/dist/esm/bytes.js.map +1 -0
- package/dist/esm/constants.d.ts +91 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +94 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/db.d.ts +65 -0
- package/dist/esm/db.d.ts.map +1 -0
- package/dist/esm/db.js +11 -0
- package/dist/esm/db.js.map +1 -0
- package/dist/esm/env.d.ts +9 -0
- package/dist/esm/env.d.ts.map +1 -0
- package/dist/esm/env.js +9 -0
- package/dist/esm/env.js.map +1 -0
- package/dist/esm/errors.d.ts +3 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +14 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/helpers.d.ts +21 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +43 -0
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.d.ts +67 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +67 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal.d.ts +72 -0
- package/dist/esm/internal.d.ts.map +1 -0
- package/dist/esm/internal.js +170 -0
- package/dist/esm/internal.js.map +1 -0
- package/dist/esm/kzg.d.ts +14 -0
- package/dist/esm/kzg.d.ts.map +1 -0
- package/dist/esm/kzg.js +2 -0
- package/dist/esm/kzg.js.map +1 -0
- package/dist/esm/lock.d.ts +15 -0
- package/dist/esm/lock.d.ts.map +1 -0
- package/dist/esm/lock.js +41 -0
- package/dist/esm/lock.js.map +1 -0
- package/dist/esm/mapDB.d.ts +17 -0
- package/dist/esm/mapDB.d.ts.map +1 -0
- package/dist/esm/mapDB.js +42 -0
- package/dist/esm/mapDB.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/provider.d.ts +46 -0
- package/dist/esm/provider.d.ts.map +1 -0
- package/dist/esm/provider.js +79 -0
- package/dist/esm/provider.js.map +1 -0
- package/dist/esm/request.d.ts +20 -0
- package/dist/esm/request.d.ts.map +1 -0
- package/dist/esm/request.js +30 -0
- package/dist/esm/request.js.map +1 -0
- package/dist/esm/signature.d.ts +47 -0
- package/dist/esm/signature.d.ts.map +1 -0
- package/dist/esm/signature.js +137 -0
- package/dist/esm/signature.js.map +1 -0
- package/dist/esm/tasks.d.ts +32 -0
- package/dist/esm/tasks.d.ts.map +1 -0
- package/dist/esm/tasks.js +47 -0
- package/dist/esm/tasks.js.map +1 -0
- package/dist/esm/types.d.ts +64 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +71 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/units.d.ts +22 -0
- package/dist/esm/units.d.ts.map +1 -0
- package/dist/esm/units.js +46 -0
- package/dist/esm/units.js.map +1 -0
- package/dist/esm/withdrawal.d.ts +72 -0
- package/dist/esm/withdrawal.d.ts.map +1 -0
- package/dist/esm/withdrawal.js +86 -0
- package/dist/esm/withdrawal.js.map +1 -0
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/package.json +116 -0
- package/src/account.ts +630 -0
- package/src/address.ts +158 -0
- package/src/authorization.ts +180 -0
- package/src/bal.ts +761 -0
- package/src/binaryTree.ts +353 -0
- package/src/blobs.ts +209 -0
- package/src/bytes.ts +659 -0
- package/src/constants.ts +125 -0
- package/src/db.ts +86 -0
- package/src/env.ts +9 -0
- package/src/errors.ts +28 -0
- package/src/helpers.ts +46 -0
- package/src/index.ts +88 -0
- package/src/internal.ts +212 -0
- package/src/kzg.ts +24 -0
- package/src/lock.ts +42 -0
- package/src/mapDB.ts +57 -0
- package/src/provider.ts +109 -0
- package/src/request.ts +48 -0
- package/src/signature.ts +202 -0
- package/src/tasks.ts +59 -0
- package/src/types.ts +177 -0
- package/src/units.ts +56 -0
- package/src/withdrawal.ts +133 -0
package/dist/esm/bal.js
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import { RLP } from '@feelyourprotocol/rlp';
|
|
2
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
3
|
+
import { bigIntToBytes, bigIntToHex, bytesToHex, bytesToInt, hexToBigInt, hexToBytes, } from "./bytes.js";
|
|
4
|
+
import { SYSTEM_ADDRESS } from "./constants.js";
|
|
5
|
+
import { padToEven } from "./internal.js";
|
|
6
|
+
/**
|
|
7
|
+
* Structural helper class for block level access lists
|
|
8
|
+
*
|
|
9
|
+
* EXPERIMENTAL: DO NOT USE IN PRODUCTION!
|
|
10
|
+
*/
|
|
11
|
+
export class BlockLevelAccessList {
|
|
12
|
+
constructor(accesses = {}) {
|
|
13
|
+
this.checkpoints = [];
|
|
14
|
+
// Track original (pre-transaction) balances for net-zero detection
|
|
15
|
+
this.originalBalances = new Map();
|
|
16
|
+
// Track original code at the start of each blockAccessIndex for each address
|
|
17
|
+
// Key format: `${address}-${blockAccessIndex}`
|
|
18
|
+
this.originalCodesAtIndex = new Map();
|
|
19
|
+
this.accesses = accesses;
|
|
20
|
+
this.blockAccessIndex = 0;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Serializes the block level access list to RLP.
|
|
24
|
+
*
|
|
25
|
+
* @returns the RLP encoded block level access list
|
|
26
|
+
*/
|
|
27
|
+
serialize() {
|
|
28
|
+
return RLP.encode(this.raw());
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This hash is used in the block header
|
|
32
|
+
*
|
|
33
|
+
* @returns the hash of the serialized block level access list
|
|
34
|
+
*/
|
|
35
|
+
hash() {
|
|
36
|
+
return keccak_256(this.serialize());
|
|
37
|
+
}
|
|
38
|
+
checkpoint() {
|
|
39
|
+
this.checkpoints.push({
|
|
40
|
+
accesses: this.cloneAccesses(this.accesses),
|
|
41
|
+
blockAccessIndex: this.blockAccessIndex,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
commit() {
|
|
45
|
+
if (this.checkpoints.length > 0) {
|
|
46
|
+
this.checkpoints.pop();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
revert() {
|
|
50
|
+
const snapshot = this.checkpoints.pop();
|
|
51
|
+
if (!snapshot) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const current = this.accesses;
|
|
55
|
+
this.accesses = snapshot.accesses;
|
|
56
|
+
this.blockAccessIndex = snapshot.blockAccessIndex;
|
|
57
|
+
// Preserve address touches and storage reads across reverts.
|
|
58
|
+
// EIP-7928: When storage writes are reverted, the slot keys MUST still
|
|
59
|
+
// appear in storageReads since the slots were accessed (SSTORE reads
|
|
60
|
+
// the current value for gas calculation).
|
|
61
|
+
for (const [address, access] of Object.entries(current)) {
|
|
62
|
+
if (this.accesses[address] === undefined) {
|
|
63
|
+
// Collect both explicit reads and slots that were written (but will be reverted)
|
|
64
|
+
const allReads = new Set(access.storageReads);
|
|
65
|
+
for (const slot of Object.keys(access.storageChanges)) {
|
|
66
|
+
allReads.add(slot);
|
|
67
|
+
}
|
|
68
|
+
this.accesses[address] = {
|
|
69
|
+
nonceChanges: new Map(),
|
|
70
|
+
balanceChanges: new Map(),
|
|
71
|
+
codeChanges: [],
|
|
72
|
+
storageChanges: {},
|
|
73
|
+
storageReads: allReads,
|
|
74
|
+
};
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const target = this.accesses[address];
|
|
78
|
+
// Preserve explicit storageReads
|
|
79
|
+
for (const slot of access.storageReads) {
|
|
80
|
+
target.storageReads.add(slot);
|
|
81
|
+
}
|
|
82
|
+
// EIP-7928: Convert reverted storageChanges to storageReads
|
|
83
|
+
for (const slot of Object.keys(access.storageChanges)) {
|
|
84
|
+
// Only add to reads if not already in the target's storageChanges
|
|
85
|
+
// (a successful write subsumes a read)
|
|
86
|
+
if (target.storageChanges[slot] === undefined) {
|
|
87
|
+
target.storageReads.add(slot);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
cloneAccesses(accesses) {
|
|
93
|
+
const cloned = {};
|
|
94
|
+
for (const [address, access] of Object.entries(accesses)) {
|
|
95
|
+
const storageChanges = {};
|
|
96
|
+
for (const [slot, changes] of Object.entries(access.storageChanges)) {
|
|
97
|
+
storageChanges[slot] = changes.map(([index, value]) => [index, value]);
|
|
98
|
+
}
|
|
99
|
+
cloned[address] = {
|
|
100
|
+
nonceChanges: new Map(access.nonceChanges),
|
|
101
|
+
balanceChanges: new Map(access.balanceChanges),
|
|
102
|
+
codeChanges: access.codeChanges.map(([index, code]) => [index, code]),
|
|
103
|
+
storageChanges,
|
|
104
|
+
storageReads: new Set(access.storageReads),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return cloned;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns the raw block level access list with values
|
|
111
|
+
* correctly sorted.
|
|
112
|
+
*
|
|
113
|
+
* @returns the raw block level access list
|
|
114
|
+
*/
|
|
115
|
+
raw() {
|
|
116
|
+
const bal = [];
|
|
117
|
+
for (const address of Object.keys(this.accesses)
|
|
118
|
+
.sort()
|
|
119
|
+
.filter((address) => shouldIncludeAddress(address, this.accesses[address]))) {
|
|
120
|
+
const data = this.accesses[address];
|
|
121
|
+
// Format storage changes: [slot, [[index, value], ...]]
|
|
122
|
+
// Normalize slot keys for canonical RLP encoding (0 -> empty bytes)
|
|
123
|
+
const storageChanges = Object.entries(data.storageChanges)
|
|
124
|
+
.sort((a, b) => compareLexicographicHexOrBytes(a[0], b[0]))
|
|
125
|
+
.map(([slot, changes]) => [
|
|
126
|
+
normalizeHexForRLP(slot),
|
|
127
|
+
changes
|
|
128
|
+
.sort((a, b) => a[0] - b[0])
|
|
129
|
+
.map(([index, value]) => [index, normalizeBytesForRLPQuantity(value)]),
|
|
130
|
+
]);
|
|
131
|
+
// Normalize storage reads for canonical RLP encoding (0 -> empty bytes)
|
|
132
|
+
const storageReads = Array.from(data.storageReads)
|
|
133
|
+
.map(normalizeHexForRLP)
|
|
134
|
+
.sort((a, b) => compareLexicographicHexOrBytes(a, b));
|
|
135
|
+
const balanceChanges = Array.from(data.balanceChanges.entries())
|
|
136
|
+
.sort(([a], [b]) => a - b)
|
|
137
|
+
.map(([index, balance]) => [index, normalizeQuantityHexForRLP(balance)]);
|
|
138
|
+
const nonceChanges = Array.from(data.nonceChanges.entries())
|
|
139
|
+
.sort(([a], [b]) => a - b)
|
|
140
|
+
.map(([index, nonce]) => [index, normalizeQuantityHexForRLP(nonce)]);
|
|
141
|
+
const codeChanges = [...data.codeChanges].sort(([a], [b]) => a - b);
|
|
142
|
+
bal.push([
|
|
143
|
+
address,
|
|
144
|
+
storageChanges,
|
|
145
|
+
storageReads,
|
|
146
|
+
balanceChanges,
|
|
147
|
+
nonceChanges,
|
|
148
|
+
codeChanges,
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
151
|
+
return bal;
|
|
152
|
+
}
|
|
153
|
+
addAddress(address) {
|
|
154
|
+
if (this.accesses[address] !== undefined) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.accesses[address] = {
|
|
158
|
+
storageChanges: {},
|
|
159
|
+
storageReads: new Set(),
|
|
160
|
+
balanceChanges: new Map(),
|
|
161
|
+
nonceChanges: new Map(),
|
|
162
|
+
codeChanges: [],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
addStorageWrite(address, storageKey, value, blockAccessIndex, originalValue) {
|
|
166
|
+
const strippedKey = normalizeStorageKeyHex(bytesToHex(stripLeadingZeros(storageKey)));
|
|
167
|
+
const strippedValue = stripLeadingZeros(value);
|
|
168
|
+
const strippedOriginal = originalValue ? stripLeadingZeros(originalValue) : undefined;
|
|
169
|
+
const isZeroWrite = strippedValue.length === 0;
|
|
170
|
+
// EIP-7928: Check if this is a no-op write (value equals pre-transaction value)
|
|
171
|
+
// No-op writes should be recorded as reads, not changes.
|
|
172
|
+
// Note: Both empty arrays (zero values) compare equal via bytesToHex
|
|
173
|
+
let isNoOp = false;
|
|
174
|
+
if (strippedOriginal !== undefined) {
|
|
175
|
+
// We have original value - compare properly
|
|
176
|
+
isNoOp = bytesToHex(strippedValue) === bytesToHex(strippedOriginal);
|
|
177
|
+
}
|
|
178
|
+
else if (isZeroWrite) {
|
|
179
|
+
// No original value provided and writing zero - likely a no-op for system contracts
|
|
180
|
+
// reading empty slots. Treat as read for safety.
|
|
181
|
+
isNoOp = true;
|
|
182
|
+
}
|
|
183
|
+
// Only no-op writes (writing same value as original) are treated as reads
|
|
184
|
+
// EIP-7928: Zeroing a slot (pre-value exists, post-value is zero) IS a write
|
|
185
|
+
if (isNoOp) {
|
|
186
|
+
// EIP-7928: If a slot is written back to its original value (net-zero change),
|
|
187
|
+
// it should appear in storageReads, not storageChanges.
|
|
188
|
+
// This handles nested calls where intermediate frames write different values
|
|
189
|
+
// but the final value equals the original.
|
|
190
|
+
if (this.accesses[address] !== undefined) {
|
|
191
|
+
// Remove any existing storageChanges for this slot since final == original
|
|
192
|
+
delete this.accesses[address].storageChanges[strippedKey];
|
|
193
|
+
}
|
|
194
|
+
this.addStorageRead(address, storageKey);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (this.accesses[address] === undefined) {
|
|
198
|
+
this.addAddress(address);
|
|
199
|
+
}
|
|
200
|
+
if (this.accesses[address].storageChanges[strippedKey] === undefined) {
|
|
201
|
+
this.accesses[address].storageChanges[strippedKey] = [];
|
|
202
|
+
}
|
|
203
|
+
// For zero values, strippedValue is empty - this is correct for RLP encoding
|
|
204
|
+
this.accesses[address].storageChanges[strippedKey].push([blockAccessIndex, strippedValue]);
|
|
205
|
+
// Per EIP-7928: A successful storage write subsumes any prior read of the same slot.
|
|
206
|
+
// Remove the slot from storageReads since it's now in storageChanges.
|
|
207
|
+
this.accesses[address].storageReads.delete(strippedKey);
|
|
208
|
+
}
|
|
209
|
+
addStorageRead(address, storageKey) {
|
|
210
|
+
if (this.accesses[address] === undefined) {
|
|
211
|
+
this.addAddress(address);
|
|
212
|
+
}
|
|
213
|
+
const strippedKey = normalizeStorageKeyHex(bytesToHex(stripLeadingZeros(storageKey)));
|
|
214
|
+
// Per EIP-7928: Don't add to storageReads if the slot was already written.
|
|
215
|
+
// A write subsumes any reads of the same slot.
|
|
216
|
+
if (this.accesses[address].storageChanges[strippedKey] === undefined) {
|
|
217
|
+
this.accesses[address].storageReads.add(strippedKey);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
addBalanceChange(address, balance, blockAccessIndex, originalBalance) {
|
|
221
|
+
if (this.accesses[address] === undefined) {
|
|
222
|
+
this.addAddress(address);
|
|
223
|
+
}
|
|
224
|
+
// EIP-7928: Track the original (pre-transaction) balance for net-zero detection
|
|
225
|
+
// Only set if not already tracked (first call wins)
|
|
226
|
+
if (originalBalance !== undefined && !this.originalBalances.has(address)) {
|
|
227
|
+
this.originalBalances.set(address, originalBalance);
|
|
228
|
+
}
|
|
229
|
+
this.accesses[address].balanceChanges.set(blockAccessIndex, padToEvenHex(bytesToHex(stripLeadingZeros(bigIntToBytes(balance)))));
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* EIP-7928: Remove balance changes for addresses where final balance equals first balance.
|
|
233
|
+
* Call this at the end of each transaction to clean up net-zero balance changes.
|
|
234
|
+
*/
|
|
235
|
+
cleanupNetZeroBalanceChanges() {
|
|
236
|
+
for (const [address, originalBalance] of this.originalBalances.entries()) {
|
|
237
|
+
const access = this.accesses[address];
|
|
238
|
+
if (access === undefined || access.balanceChanges.size === 0) {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
// Get the final balance (last entry in the balanceChanges map)
|
|
242
|
+
const entries = Array.from(access.balanceChanges.values());
|
|
243
|
+
const finalBalanceHex = entries[entries.length - 1];
|
|
244
|
+
const finalBalance = finalBalanceHex === '0x' ? BigInt(0) : BigInt(`0x${finalBalanceHex.replace(/^0x/, '')}`);
|
|
245
|
+
// EIP-7928: If final balance == original balance, remove all balanceChanges
|
|
246
|
+
// for the current blockAccessIndex only, but keep prior tx entries.
|
|
247
|
+
if (finalBalance === originalBalance) {
|
|
248
|
+
access.balanceChanges.delete(this.blockAccessIndex);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Clear the tracking map for the next transaction
|
|
252
|
+
this.originalBalances.clear();
|
|
253
|
+
}
|
|
254
|
+
addNonceChange(address, nonce, blockAccessIndex) {
|
|
255
|
+
if (this.accesses[address] === undefined) {
|
|
256
|
+
this.addAddress(address);
|
|
257
|
+
}
|
|
258
|
+
this.accesses[address].nonceChanges.set(blockAccessIndex, padToEvenHex(bigIntToHex(nonce)));
|
|
259
|
+
}
|
|
260
|
+
addCodeChange(address, code, blockAccessIndex, originalCode) {
|
|
261
|
+
if (this.accesses[address] === undefined) {
|
|
262
|
+
this.addAddress(address);
|
|
263
|
+
}
|
|
264
|
+
const codeChanges = this.accesses[address].codeChanges;
|
|
265
|
+
// Track the original code at the start of this blockAccessIndex
|
|
266
|
+
const trackingKey = `${address}-${blockAccessIndex}`;
|
|
267
|
+
if (!this.originalCodesAtIndex.has(trackingKey) && originalCode !== undefined) {
|
|
268
|
+
this.originalCodesAtIndex.set(trackingKey, originalCode);
|
|
269
|
+
}
|
|
270
|
+
// Get the original code at the start of this blockAccessIndex
|
|
271
|
+
const originalCodeAtIndex = this.originalCodesAtIndex.get(trackingKey);
|
|
272
|
+
// Check if there's already a code change at this blockAccessIndex
|
|
273
|
+
const existingIndex = codeChanges.findIndex(([idx]) => idx === blockAccessIndex);
|
|
274
|
+
if (existingIndex !== -1) {
|
|
275
|
+
// Check if the new code equals the original code at start of this blockAccessIndex
|
|
276
|
+
// If so, remove the entry (net-zero change within this blockAccessIndex)
|
|
277
|
+
if (originalCodeAtIndex !== undefined &&
|
|
278
|
+
bytesToHex(code) === bytesToHex(originalCodeAtIndex)) {
|
|
279
|
+
codeChanges.splice(existingIndex, 1);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
// Update the existing entry with the new code
|
|
283
|
+
codeChanges[existingIndex] = [blockAccessIndex, code];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
// Add new entry, but only if code is actually different from originalCode
|
|
288
|
+
if (originalCode !== undefined && bytesToHex(code) === bytesToHex(originalCode)) {
|
|
289
|
+
// No actual change, don't record
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
codeChanges.push([blockAccessIndex, code]);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* EIP-7928: For selfdestructed accounts, drop all state changes while
|
|
297
|
+
* preserving read footprints. Any storageChanges are converted to storageReads.
|
|
298
|
+
*
|
|
299
|
+
* Per EIP-7928: "if the account had a positive balance pre-transaction,
|
|
300
|
+
* the balance change to zero MUST be recorded."
|
|
301
|
+
*/
|
|
302
|
+
/**
|
|
303
|
+
* Converts the internal representation to the JSON format (BALJSONBlockAccessList).
|
|
304
|
+
* Inverse of createBlockLevelAccessListFromJSON().
|
|
305
|
+
*/
|
|
306
|
+
toJSON() {
|
|
307
|
+
const result = [];
|
|
308
|
+
for (const [address, access] of Object.entries(this.accesses)
|
|
309
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
310
|
+
.filter(([address, access]) => shouldIncludeAddress(address, access))) {
|
|
311
|
+
const storageChanges = Object.entries(access.storageChanges)
|
|
312
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
313
|
+
.map(([slot, changes]) => ({
|
|
314
|
+
slot,
|
|
315
|
+
slotChanges: changes
|
|
316
|
+
.sort((a, b) => a[0] - b[0])
|
|
317
|
+
.map(([index, value]) => ({
|
|
318
|
+
blockAccessIndex: indexToHex(index),
|
|
319
|
+
postValue: padToEvenHex(bytesToHex(value)),
|
|
320
|
+
})),
|
|
321
|
+
}));
|
|
322
|
+
const storageReads = Array.from(access.storageReads).sort((a, b) => Number((a === '0x' ? 0n : hexToBigInt(a)) -
|
|
323
|
+
(b === '0x' ? 0n : hexToBigInt(b))));
|
|
324
|
+
const balanceChanges = Array.from(access.balanceChanges.entries())
|
|
325
|
+
.sort(([a], [b]) => a - b)
|
|
326
|
+
.map(([index, balance]) => ({
|
|
327
|
+
blockAccessIndex: indexToHex(index),
|
|
328
|
+
postBalance: balance,
|
|
329
|
+
}));
|
|
330
|
+
const nonceChanges = Array.from(access.nonceChanges.entries())
|
|
331
|
+
.sort(([a], [b]) => a - b)
|
|
332
|
+
.map(([index, nonce]) => ({
|
|
333
|
+
blockAccessIndex: indexToHex(index),
|
|
334
|
+
postNonce: nonce,
|
|
335
|
+
}));
|
|
336
|
+
const codeChanges = access.codeChanges.map(([index, code]) => ({
|
|
337
|
+
blockAccessIndex: indexToHex(index),
|
|
338
|
+
newCode: bytesToHex(code),
|
|
339
|
+
}));
|
|
340
|
+
result.push({
|
|
341
|
+
address: address,
|
|
342
|
+
nonceChanges,
|
|
343
|
+
balanceChanges,
|
|
344
|
+
codeChanges,
|
|
345
|
+
storageChanges,
|
|
346
|
+
storageReads,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
return result;
|
|
350
|
+
}
|
|
351
|
+
cleanupSelfdestructed(addresses) {
|
|
352
|
+
for (const address of addresses) {
|
|
353
|
+
const access = this.accesses[address];
|
|
354
|
+
if (access === undefined) {
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
// Convert any storageChanges into storageReads
|
|
358
|
+
for (const slot of Object.keys(access.storageChanges)) {
|
|
359
|
+
access.storageReads.add(slot);
|
|
360
|
+
}
|
|
361
|
+
access.storageChanges = {};
|
|
362
|
+
access.nonceChanges.clear();
|
|
363
|
+
access.codeChanges = [];
|
|
364
|
+
// EIP-7928: If the account had a positive pre-transaction balance,
|
|
365
|
+
// the balance change to zero MUST be recorded.
|
|
366
|
+
// The balance change to 0 is already added during SELFDESTRUCT execution.
|
|
367
|
+
// We only clear balance changes if pre-transaction balance was 0 (no actual change).
|
|
368
|
+
const originalBalance = this.originalBalances.get(address);
|
|
369
|
+
if (originalBalance === undefined || originalBalance === BigInt(0)) {
|
|
370
|
+
// Pre-transaction balance was 0 or unknown - clear balance changes
|
|
371
|
+
// (0 -> 0 is no change, so nothing to record)
|
|
372
|
+
access.balanceChanges.clear();
|
|
373
|
+
}
|
|
374
|
+
// If originalBalance > 0, keep the balance changes (which should show balance = 0)
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function compareLexicographicHexOrBytes(a, b) {
|
|
379
|
+
const aBytes = a instanceof Uint8Array ? a : hexToBytes(a);
|
|
380
|
+
const bBytes = b instanceof Uint8Array ? b : hexToBytes(b);
|
|
381
|
+
const minLength = Math.min(aBytes.length, bBytes.length);
|
|
382
|
+
for (let i = 0; i < minLength; i++) {
|
|
383
|
+
if (aBytes[i] < bBytes[i])
|
|
384
|
+
return -1;
|
|
385
|
+
if (aBytes[i] > bBytes[i])
|
|
386
|
+
return 1;
|
|
387
|
+
}
|
|
388
|
+
if (aBytes.length < bBytes.length)
|
|
389
|
+
return -1;
|
|
390
|
+
if (aBytes.length > bBytes.length)
|
|
391
|
+
return 1;
|
|
392
|
+
return 0;
|
|
393
|
+
}
|
|
394
|
+
export function createBlockLevelAccessList() {
|
|
395
|
+
return new BlockLevelAccessList();
|
|
396
|
+
}
|
|
397
|
+
export function createBlockLevelAccessListFromJSON(json) {
|
|
398
|
+
const bal = new BlockLevelAccessList();
|
|
399
|
+
for (const account of json) {
|
|
400
|
+
bal.addAddress(account.address);
|
|
401
|
+
const access = bal.accesses[account.address];
|
|
402
|
+
for (const slotChange of account.storageChanges) {
|
|
403
|
+
const normalizedSlot = normalizeStorageKeyHex(slotChange.slot);
|
|
404
|
+
if (access.storageChanges[normalizedSlot] === undefined) {
|
|
405
|
+
access.storageChanges[normalizedSlot] = [];
|
|
406
|
+
}
|
|
407
|
+
for (const change of slotChange.slotChanges) {
|
|
408
|
+
access.storageChanges[normalizedSlot].push([
|
|
409
|
+
parseInt(change.blockAccessIndex, 16),
|
|
410
|
+
hexToBytes(change.postValue),
|
|
411
|
+
]);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
for (const slot of account.storageReads) {
|
|
415
|
+
access.storageReads.add(normalizeStorageKeyHex(slot));
|
|
416
|
+
}
|
|
417
|
+
for (const change of account.balanceChanges) {
|
|
418
|
+
access.balanceChanges.set(parseInt(change.blockAccessIndex, 16), padToEvenHex(change.postBalance));
|
|
419
|
+
}
|
|
420
|
+
for (const change of account.nonceChanges) {
|
|
421
|
+
access.nonceChanges.set(parseInt(change.blockAccessIndex, 16), padToEvenHex(change.postNonce));
|
|
422
|
+
}
|
|
423
|
+
for (const change of account.codeChanges) {
|
|
424
|
+
access.codeChanges.push([parseInt(change.blockAccessIndex, 16), hexToBytes(change.newCode)]);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return bal;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Normalizes a quantity-like hex string for canonical RLP encoding.
|
|
431
|
+
* Integer fields in the BAL use minimal big-endian encoding, so leading zero bytes
|
|
432
|
+
* are stripped and zero is encoded as empty bytes.
|
|
433
|
+
*/
|
|
434
|
+
function normalizeHexForRLP(hex) {
|
|
435
|
+
const stripped = hex.slice(2).replace(/^0+/, '');
|
|
436
|
+
if (stripped === '') {
|
|
437
|
+
return Uint8Array.from([]);
|
|
438
|
+
}
|
|
439
|
+
return `0x${padToEven(stripped)}`;
|
|
440
|
+
}
|
|
441
|
+
function normalizeBytesForRLPQuantity(bytes) {
|
|
442
|
+
return stripLeadingZeros(bytes);
|
|
443
|
+
}
|
|
444
|
+
function normalizeQuantityHexForRLP(hex) {
|
|
445
|
+
const stripped = hex.slice(2).replace(/^0+/, '');
|
|
446
|
+
if (stripped === '') {
|
|
447
|
+
return '0x';
|
|
448
|
+
}
|
|
449
|
+
return `0x${padToEven(stripped)}`;
|
|
450
|
+
}
|
|
451
|
+
export function createBlockLevelAccessListFromRLP(rlp) {
|
|
452
|
+
const decoded = RLP.decode(rlp);
|
|
453
|
+
const bal = new BlockLevelAccessList();
|
|
454
|
+
for (const account of decoded) {
|
|
455
|
+
const [addressBytes, storageChangesRaw, storageReadsRaw, balanceChangesRaw, nonceChangesRaw, codeChangesRaw,] = account;
|
|
456
|
+
const address = bytesToHex(addressBytes);
|
|
457
|
+
bal.addAddress(address);
|
|
458
|
+
const access = bal.accesses[address];
|
|
459
|
+
for (const [slotBytes, slotChangesRaw] of storageChangesRaw) {
|
|
460
|
+
const slot = normalizeStorageKeyHex(bytesToHex(slotBytes));
|
|
461
|
+
if (access.storageChanges[slot] === undefined) {
|
|
462
|
+
access.storageChanges[slot] = [];
|
|
463
|
+
}
|
|
464
|
+
for (const [indexBytes, valueBytes] of slotChangesRaw) {
|
|
465
|
+
access.storageChanges[slot].push([bytesToInt(indexBytes), valueBytes]);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
for (const slotBytes of storageReadsRaw) {
|
|
469
|
+
access.storageReads.add(normalizeStorageKeyHex(bytesToHex(slotBytes)));
|
|
470
|
+
}
|
|
471
|
+
for (const [indexBytes, balanceBytes] of balanceChangesRaw) {
|
|
472
|
+
access.balanceChanges.set(bytesToInt(indexBytes), padToEvenHex(bytesToHex(balanceBytes)));
|
|
473
|
+
}
|
|
474
|
+
for (const [indexBytes, nonceBytes] of nonceChangesRaw) {
|
|
475
|
+
access.nonceChanges.set(bytesToInt(indexBytes), padToEvenHex(bytesToHex(nonceBytes)));
|
|
476
|
+
}
|
|
477
|
+
for (const [indexBytes, codeBytes] of codeChangesRaw) {
|
|
478
|
+
access.codeChanges.push([bytesToInt(indexBytes), codeBytes]);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return bal;
|
|
482
|
+
}
|
|
483
|
+
function stripLeadingZeros(bytes) {
|
|
484
|
+
let first = bytes[0];
|
|
485
|
+
while (bytes.length > 0 && first.toString() === '0') {
|
|
486
|
+
bytes = bytes.slice(1);
|
|
487
|
+
first = bytes[0];
|
|
488
|
+
}
|
|
489
|
+
return bytes;
|
|
490
|
+
}
|
|
491
|
+
function padToEvenHex(hex) {
|
|
492
|
+
return `0x${padToEven(hex.slice(2))}`;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Normalizes a storage key hex string to ensure consistent even-length representation.
|
|
496
|
+
* - "0x" (empty bytes) is kept as is
|
|
497
|
+
* - "0x0" becomes "0x00"
|
|
498
|
+
* - Any odd-length hex is padded to even (e.g., "0x1" → "0x01")
|
|
499
|
+
*/
|
|
500
|
+
function normalizeStorageKeyHex(hex) {
|
|
501
|
+
const stripped = hex.slice(2);
|
|
502
|
+
// Empty string "0x" stays as is
|
|
503
|
+
if (stripped === '') {
|
|
504
|
+
return '0x';
|
|
505
|
+
}
|
|
506
|
+
// Pad to even length (handles "0x0" → "0x00", "0x1" → "0x01", etc.)
|
|
507
|
+
return `0x${padToEven(stripped)}`;
|
|
508
|
+
}
|
|
509
|
+
function shouldIncludeAddress(address, access) {
|
|
510
|
+
if (address !== SYSTEM_ADDRESS) {
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
return (access.storageReads.size > 0 ||
|
|
514
|
+
Object.keys(access.storageChanges).length > 0 ||
|
|
515
|
+
access.balanceChanges.size > 0 ||
|
|
516
|
+
access.nonceChanges.size > 0 ||
|
|
517
|
+
access.codeChanges.length > 0);
|
|
518
|
+
}
|
|
519
|
+
function indexToHex(index) {
|
|
520
|
+
return padToEvenHex(`0x${index.toString(16)}`);
|
|
521
|
+
}
|
|
522
|
+
//# sourceMappingURL=bal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bal.js","sourceRoot":"","sources":["../../src/bal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAkGzC;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAS/B,YAAY,WAAqB,EAAE;QAN3B,gBAAW,GAAuD,EAAE,CAAA;QAC5E,mEAAmE;QAC3D,qBAAgB,GAA+B,IA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