@nomicfoundation/edr 0.12.0-next.15 → 0.12.0-next.16
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/index.d.ts +8 -0
- package/package.json +8 -8
- package/src/chains/op.rs +90 -64
- package/src/config.rs +11 -1
- package/src/result.rs +1 -1
- package/src/trace.rs +10 -12
package/index.d.ts
CHANGED
|
@@ -336,6 +336,14 @@ export interface ProviderConfig {
|
|
|
336
336
|
ownedAccounts: Array<string>
|
|
337
337
|
/** Overrides for precompiles */
|
|
338
338
|
precompileOverrides: Array<Precompile>
|
|
339
|
+
/**
|
|
340
|
+
* Transaction gas cap, introduced in [EIP-7825].
|
|
341
|
+
*
|
|
342
|
+
* When not set, will default to value defined by the used hardfork
|
|
343
|
+
*
|
|
344
|
+
* [EIP-7825]: https://eips.ethereum.org/EIPS/eip-7825
|
|
345
|
+
*/
|
|
346
|
+
transactionGasCap?: bigint
|
|
339
347
|
}
|
|
340
348
|
/** Tracing config for Solidity stack trace generation. */
|
|
341
349
|
export interface TracingConfigWithBuffers {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/edr",
|
|
3
|
-
"version": "0.12.0-next.
|
|
3
|
+
"version": "0.12.0-next.16",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@napi-rs/cli": "^2.18.4",
|
|
6
6
|
"@nomicfoundation/ethereumjs-util": "^9.0.4",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"repository": "NomicFoundation/edr.git",
|
|
59
59
|
"types": "index.d.ts",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@nomicfoundation/edr-darwin-arm64": "0.12.0-next.
|
|
62
|
-
"@nomicfoundation/edr-darwin-x64": "0.12.0-next.
|
|
63
|
-
"@nomicfoundation/edr-linux-arm64-gnu": "0.12.0-next.
|
|
64
|
-
"@nomicfoundation/edr-linux-arm64-musl": "0.12.0-next.
|
|
65
|
-
"@nomicfoundation/edr-linux-x64-gnu": "0.12.0-next.
|
|
66
|
-
"@nomicfoundation/edr-linux-x64-musl": "0.12.0-next.
|
|
67
|
-
"@nomicfoundation/edr-win32-x64-msvc": "0.12.0-next.
|
|
61
|
+
"@nomicfoundation/edr-darwin-arm64": "0.12.0-next.16",
|
|
62
|
+
"@nomicfoundation/edr-darwin-x64": "0.12.0-next.16",
|
|
63
|
+
"@nomicfoundation/edr-linux-arm64-gnu": "0.12.0-next.16",
|
|
64
|
+
"@nomicfoundation/edr-linux-arm64-musl": "0.12.0-next.16",
|
|
65
|
+
"@nomicfoundation/edr-linux-x64-gnu": "0.12.0-next.16",
|
|
66
|
+
"@nomicfoundation/edr-linux-x64-musl": "0.12.0-next.16",
|
|
67
|
+
"@nomicfoundation/edr-win32-x64-msvc": "0.12.0-next.16"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"artifacts": "napi artifacts",
|
package/src/chains/op.rs
CHANGED
|
@@ -8,7 +8,8 @@ use edr_napi_core::{
|
|
|
8
8
|
use edr_op::{
|
|
9
9
|
predeploys::{
|
|
10
10
|
gas_price_oracle_code_ecotone, gas_price_oracle_code_fjord, gas_price_oracle_code_isthmus,
|
|
11
|
-
|
|
11
|
+
l1_block_code_bedrock, l1_block_code_ecotone, l1_block_code_isthmus,
|
|
12
|
+
GAS_PRICE_ORACLE_ADDRESS, L1_BLOCK_PREDEPLOY_ADDRESS,
|
|
12
13
|
},
|
|
13
14
|
OpChainSpec,
|
|
14
15
|
};
|
|
@@ -143,72 +144,13 @@ pub const OP_CHAIN_TYPE: &str = edr_op::CHAIN_TYPE;
|
|
|
143
144
|
|
|
144
145
|
#[napi(catch_unwind)]
|
|
145
146
|
pub fn op_genesis_state(hardfork: OpHardfork) -> Vec<AccountOverride> {
|
|
146
|
-
let l1_block_code =
|
|
147
|
-
.expect("The bytecode for the L1Block predeploy should be a valid hex string");
|
|
147
|
+
let l1_block_code = l1_block_code(hardfork.into());
|
|
148
148
|
let l1_block = AccountOverride {
|
|
149
|
-
address:
|
|
149
|
+
address: Uint8Array::with_data_copied(L1_BLOCK_PREDEPLOY_ADDRESS),
|
|
150
150
|
balance: Some(BigInt::from(0u64)),
|
|
151
151
|
nonce: Some(BigInt::from(0u64)),
|
|
152
|
-
code: Some(l1_block_code
|
|
153
|
-
storage: Some(
|
|
154
|
-
StorageSlot {
|
|
155
|
-
index: BigInt::from(0u64),
|
|
156
|
-
// uint64 public number = 1
|
|
157
|
-
// uint64 public timestamp = 1
|
|
158
|
-
value: BigInt {
|
|
159
|
-
words: vec![
|
|
160
|
-
0x0000000000000001_u64, // least significative
|
|
161
|
-
0x0000000000000001_u64,
|
|
162
|
-
],
|
|
163
|
-
sign_bit: false,
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
StorageSlot {
|
|
167
|
-
index: BigInt::from(1u64),
|
|
168
|
-
// uint256 baseFee = 10 gwei
|
|
169
|
-
value: BigInt::from(0x00000002540be400_u64),
|
|
170
|
-
},
|
|
171
|
-
StorageSlot {
|
|
172
|
-
index: BigInt::from(2u64),
|
|
173
|
-
// bytes32 hash = 0
|
|
174
|
-
value: BigInt::from(0u64),
|
|
175
|
-
},
|
|
176
|
-
StorageSlot {
|
|
177
|
-
index: BigInt::from(3u64),
|
|
178
|
-
// uint64 sequenceNumber = 0
|
|
179
|
-
// uint32 blobBaseFeeScalar = 1014213
|
|
180
|
-
// uint32 baseFeeScalar = 5227
|
|
181
|
-
value: BigInt {
|
|
182
|
-
words: vec![
|
|
183
|
-
0x0000000000000000_u64, // least significative
|
|
184
|
-
0x0000000000000000_u64,
|
|
185
|
-
0x00000000000f79c5_u64,
|
|
186
|
-
0x000000000000146b_u64,
|
|
187
|
-
],
|
|
188
|
-
sign_bit: false,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
StorageSlot {
|
|
192
|
-
index: BigInt::from(4u64),
|
|
193
|
-
// bytes32 batcherHash = 0
|
|
194
|
-
value: BigInt::from(0u64),
|
|
195
|
-
},
|
|
196
|
-
StorageSlot {
|
|
197
|
-
index: BigInt::from(5u64),
|
|
198
|
-
// uint256 l1FeeOverhead = 0
|
|
199
|
-
value: BigInt::from(0u64),
|
|
200
|
-
},
|
|
201
|
-
StorageSlot {
|
|
202
|
-
index: BigInt::from(6u64),
|
|
203
|
-
// uint256 l1FeeScalar = 0
|
|
204
|
-
value: BigInt::from(0u64),
|
|
205
|
-
},
|
|
206
|
-
StorageSlot {
|
|
207
|
-
index: BigInt::from(7u64),
|
|
208
|
-
// uint256 blobBaseFee = 10 gwei
|
|
209
|
-
value: BigInt::from(0x00000002540be400_u64),
|
|
210
|
-
},
|
|
211
|
-
]),
|
|
152
|
+
code: Some(l1_block_code),
|
|
153
|
+
storage: Some(l1_block_storage(hardfork.into())),
|
|
212
154
|
};
|
|
213
155
|
|
|
214
156
|
/* The rest of the predeploys use a stubbed bytecode that reverts with a
|
|
@@ -315,6 +257,11 @@ pub fn op_genesis_state(hardfork: OpHardfork) -> Vec<AccountOverride> {
|
|
|
315
257
|
hex!("4200000000000000000000000000000000000021"),
|
|
316
258
|
"0x60806040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401603490607b565b60405180910390fd5b60006048601f836099565b91507f5072656465706c6f7920454153206973206e6f7420737570706f727465642e006000830152602082019050919050565b60006020820190508181036000830152609281603d565b9050919050565b60008282526020820190509291505056fea2646970667358221220afa6c1aa54a8b3f4f979e1297db5838a94353f3b77b5ecc164da19db26ea89f564736f6c63430008000033",
|
|
317
259
|
),
|
|
260
|
+
(
|
|
261
|
+
"OperatorFeeVault",
|
|
262
|
+
hex!("0x420000000000000000000000000000000000001b"),
|
|
263
|
+
"0x60806040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040160349060b9565b60405180910390fd5b5f82825260208201905092915050565b7f5072656465706c6f79204f70657261746f724665655661756c74206973206e6f5f8201527f7420737570706f727465642e0000000000000000000000000000000000000000602082015250565b5f60a5602c83603d565b915060ae82604d565b604082019050919050565b5f6020820190508181035f83015260ce81609b565b905091905056fea2646970667358221220dc3131d0ea77326c36012aee5dd9a870b6f07d76e6f55c8029da9d70a83f50c364736f6c634300081e0033",
|
|
264
|
+
),
|
|
318
265
|
];
|
|
319
266
|
|
|
320
267
|
let stubbed_predeploys = stubbed_predeploys_data
|
|
@@ -402,6 +349,85 @@ fn gas_price_oracle_isthmus() -> AccountOverride {
|
|
|
402
349
|
}]),
|
|
403
350
|
}
|
|
404
351
|
}
|
|
352
|
+
fn l1_block_storage(hardfork: edr_op::Hardfork) -> Vec<StorageSlot> {
|
|
353
|
+
let mut base_storage = vec![
|
|
354
|
+
StorageSlot {
|
|
355
|
+
index: BigInt::from(0u64),
|
|
356
|
+
// uint64 public number = 1
|
|
357
|
+
// uint64 public timestamp = 1
|
|
358
|
+
value: BigInt {
|
|
359
|
+
words: vec![
|
|
360
|
+
0x0000000000000001_u64, // least significative
|
|
361
|
+
0x0000000000000001_u64,
|
|
362
|
+
],
|
|
363
|
+
sign_bit: false,
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
StorageSlot {
|
|
367
|
+
index: BigInt::from(1u64),
|
|
368
|
+
// uint256 baseFee = 10 gwei
|
|
369
|
+
value: BigInt::from(0x00000002540be400_u64),
|
|
370
|
+
},
|
|
371
|
+
StorageSlot {
|
|
372
|
+
index: BigInt::from(2u64),
|
|
373
|
+
// bytes32 hash = 0
|
|
374
|
+
value: BigInt::from(0u64),
|
|
375
|
+
},
|
|
376
|
+
StorageSlot {
|
|
377
|
+
index: BigInt::from(3u64),
|
|
378
|
+
// uint64 sequenceNumber = 0
|
|
379
|
+
// uint32 blobBaseFeeScalar = 1014213
|
|
380
|
+
// uint32 baseFeeScalar = 5227
|
|
381
|
+
value: BigInt {
|
|
382
|
+
words: vec![
|
|
383
|
+
0x0000000000000000_u64, // least significative
|
|
384
|
+
0x0000000000000000_u64,
|
|
385
|
+
0x00000000000f79c5_u64,
|
|
386
|
+
0x000000000000146b_u64,
|
|
387
|
+
],
|
|
388
|
+
sign_bit: false,
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
StorageSlot {
|
|
392
|
+
index: BigInt::from(4u64),
|
|
393
|
+
// bytes32 batcherHash = 0
|
|
394
|
+
value: BigInt::from(0u64),
|
|
395
|
+
},
|
|
396
|
+
StorageSlot {
|
|
397
|
+
index: BigInt::from(5u64),
|
|
398
|
+
// uint256 l1FeeOverhead = 0
|
|
399
|
+
value: BigInt::from(0u64),
|
|
400
|
+
},
|
|
401
|
+
StorageSlot {
|
|
402
|
+
index: BigInt::from(6u64),
|
|
403
|
+
// uint256 l1FeeScalar = 0
|
|
404
|
+
value: BigInt::from(0u64),
|
|
405
|
+
},
|
|
406
|
+
StorageSlot {
|
|
407
|
+
index: BigInt::from(7u64),
|
|
408
|
+
// uint256 blobBaseFee = 10 gwei
|
|
409
|
+
value: BigInt::from(0x00000002540be400_u64),
|
|
410
|
+
},
|
|
411
|
+
];
|
|
412
|
+
if hardfork >= edr_op::Hardfork::ISTHMUS {
|
|
413
|
+
base_storage.push(StorageSlot {
|
|
414
|
+
// Operator fee parameters
|
|
415
|
+
index: BigInt::from(8u64),
|
|
416
|
+
value: BigInt::from(0u64),
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
base_storage
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
fn l1_block_code(hardfork: edr_op::Hardfork) -> Uint8Array {
|
|
423
|
+
if hardfork >= edr_op::Hardfork::ISTHMUS {
|
|
424
|
+
l1_block_code_isthmus().into()
|
|
425
|
+
} else if hardfork >= edr_op::Hardfork::ECOTONE {
|
|
426
|
+
l1_block_code_ecotone().into()
|
|
427
|
+
} else {
|
|
428
|
+
l1_block_code_bedrock().into()
|
|
429
|
+
}
|
|
430
|
+
}
|
|
405
431
|
|
|
406
432
|
macro_rules! export_spec_id {
|
|
407
433
|
($($variant:ident,)*) => {
|
package/src/config.rs
CHANGED
|
@@ -242,6 +242,12 @@ pub struct ProviderConfig {
|
|
|
242
242
|
pub owned_accounts: Vec<JsString>,
|
|
243
243
|
/// Overrides for precompiles
|
|
244
244
|
pub precompile_overrides: Vec<Reference<Precompile>>,
|
|
245
|
+
/// Transaction gas cap, introduced in [EIP-7825].
|
|
246
|
+
///
|
|
247
|
+
/// When not set, will default to value defined by the used hardfork
|
|
248
|
+
///
|
|
249
|
+
/// [EIP-7825]: https://eips.ethereum.org/EIPS/eip-7825
|
|
250
|
+
pub transaction_gas_cap: Option<BigInt>,
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
impl TryFrom<ForkConfig> for edr_provider::ForkConfig<String> {
|
|
@@ -339,7 +345,7 @@ impl From<MemPoolConfig> for edr_provider::MemPoolConfig {
|
|
|
339
345
|
}
|
|
340
346
|
}
|
|
341
347
|
|
|
342
|
-
impl From<MineOrdering> for
|
|
348
|
+
impl From<MineOrdering> for edr_block_miner::MineOrdering {
|
|
343
349
|
fn from(value: MineOrdering) -> Self {
|
|
344
350
|
match value {
|
|
345
351
|
MineOrdering::Fifo => Self::Fifo,
|
|
@@ -619,6 +625,10 @@ impl ProviderConfig {
|
|
|
619
625
|
observability: self.observability.resolve(env, runtime)?,
|
|
620
626
|
owned_accounts,
|
|
621
627
|
precompile_overrides,
|
|
628
|
+
transaction_gas_cap: self
|
|
629
|
+
.transaction_gas_cap
|
|
630
|
+
.map(TryCast::try_cast)
|
|
631
|
+
.transpose()?,
|
|
622
632
|
})
|
|
623
633
|
}
|
|
624
634
|
}
|
package/src/result.rs
CHANGED
package/src/trace.rs
CHANGED
|
@@ -9,7 +9,7 @@ use std::sync::Arc;
|
|
|
9
9
|
|
|
10
10
|
use edr_chain_spec::EvmHaltReason;
|
|
11
11
|
use edr_primitives::bytecode::opcode::OpCode;
|
|
12
|
-
use
|
|
12
|
+
use edr_tracing::BeforeMessage;
|
|
13
13
|
use napi::bindgen_prelude::{BigInt, Either3, Uint8Array};
|
|
14
14
|
use napi_derive::napi;
|
|
15
15
|
|
|
@@ -123,7 +123,7 @@ pub struct TracingStep {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
impl TracingStep {
|
|
126
|
-
pub fn new(step: &
|
|
126
|
+
pub fn new(step: &edr_tracing::Step) -> Self {
|
|
127
127
|
let stack = step.stack.full().map_or_else(
|
|
128
128
|
|| {
|
|
129
129
|
step.stack
|
|
@@ -162,11 +162,11 @@ pub struct TracingMessageResult {
|
|
|
162
162
|
#[napi]
|
|
163
163
|
#[derive(Clone)]
|
|
164
164
|
pub struct RawTrace {
|
|
165
|
-
inner: Arc<
|
|
165
|
+
inner: Arc<edr_tracing::Trace<EvmHaltReason>>,
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
impl From<Arc<
|
|
169
|
-
fn from(value: Arc<
|
|
168
|
+
impl From<Arc<edr_tracing::Trace<EvmHaltReason>>> for RawTrace {
|
|
169
|
+
fn from(value: Arc<edr_tracing::Trace<EvmHaltReason>>) -> Self {
|
|
170
170
|
Self { inner: value }
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -179,15 +179,13 @@ impl RawTrace {
|
|
|
179
179
|
.messages
|
|
180
180
|
.iter()
|
|
181
181
|
.map(|message| match message {
|
|
182
|
-
|
|
182
|
+
edr_tracing::TraceMessage::Before(message) => {
|
|
183
183
|
Either3::A(TracingMessage::from(message))
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
190
|
-
}
|
|
185
|
+
edr_tracing::TraceMessage::Step(step) => Either3::B(TracingStep::new(step)),
|
|
186
|
+
edr_tracing::TraceMessage::After(message) => Either3::C(TracingMessageResult {
|
|
187
|
+
execution_result: ExecutionResult::from(message),
|
|
188
|
+
}),
|
|
191
189
|
})
|
|
192
190
|
.collect()
|
|
193
191
|
}
|