@nomicfoundation/edr 0.4.1 → 0.5.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/index.d.ts +11 -2
- package/package.json +8 -8
- package/src/provider/config.rs +3 -0
- package/src/result.rs +17 -0
package/index.d.ts
CHANGED
|
@@ -223,6 +223,8 @@ export interface ProviderConfig {
|
|
|
223
223
|
chains: Array<ChainConfig>
|
|
224
224
|
/** The address of the coinbase */
|
|
225
225
|
coinbase: Buffer
|
|
226
|
+
/** Enables RIP-7212 */
|
|
227
|
+
enableRip7212: boolean
|
|
226
228
|
/**
|
|
227
229
|
* The configuration for forking a blockchain. If not provided, a local
|
|
228
230
|
* blockchain will be created
|
|
@@ -260,7 +262,8 @@ export const enum SuccessReason {
|
|
|
260
262
|
/** The opcode `RETURN` was called */
|
|
261
263
|
Return = 1,
|
|
262
264
|
/** The opcode `SELFDESTRUCT` was called */
|
|
263
|
-
SelfDestruct = 2
|
|
265
|
+
SelfDestruct = 2,
|
|
266
|
+
EofReturnContract = 3
|
|
264
267
|
}
|
|
265
268
|
export interface CallOutput {
|
|
266
269
|
/** Return value */
|
|
@@ -313,7 +316,13 @@ export const enum ExceptionalHalt {
|
|
|
313
316
|
/** Error on created contract that begins with EF */
|
|
314
317
|
CreateContractStartingWithEF = 12,
|
|
315
318
|
/** EIP-3860: Limit and meter initcode. Initcode size limit exceeded. */
|
|
316
|
-
CreateInitCodeSizeLimit = 13
|
|
319
|
+
CreateInitCodeSizeLimit = 13,
|
|
320
|
+
/** Aux data overflow, new aux data is larger tha u16 max size. */
|
|
321
|
+
EofAuxDataOverflow = 14,
|
|
322
|
+
/** Aud data is smaller then already present data size. */
|
|
323
|
+
EofAuxDataTooSmall = 15,
|
|
324
|
+
/** EOF Subroutine stack overflow */
|
|
325
|
+
EOFFunctionStackOverflow = 16
|
|
317
326
|
}
|
|
318
327
|
/** The result when the EVM terminates due to an exceptional halt. */
|
|
319
328
|
export interface HaltResult {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/edr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"node": ">= 18"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@nomicfoundation/edr-darwin-arm64": "0.
|
|
50
|
-
"@nomicfoundation/edr-darwin-x64": "0.
|
|
51
|
-
"@nomicfoundation/edr-linux-arm64-gnu": "0.
|
|
52
|
-
"@nomicfoundation/edr-linux-arm64-musl": "0.
|
|
53
|
-
"@nomicfoundation/edr-linux-x64-gnu": "0.
|
|
54
|
-
"@nomicfoundation/edr-linux-x64-musl": "0.
|
|
55
|
-
"@nomicfoundation/edr-win32-x64-msvc": "0.
|
|
49
|
+
"@nomicfoundation/edr-darwin-arm64": "0.5.0",
|
|
50
|
+
"@nomicfoundation/edr-darwin-x64": "0.5.0",
|
|
51
|
+
"@nomicfoundation/edr-linux-arm64-gnu": "0.5.0",
|
|
52
|
+
"@nomicfoundation/edr-linux-arm64-musl": "0.5.0",
|
|
53
|
+
"@nomicfoundation/edr-linux-x64-gnu": "0.5.0",
|
|
54
|
+
"@nomicfoundation/edr-linux-x64-musl": "0.5.0",
|
|
55
|
+
"@nomicfoundation/edr-win32-x64-msvc": "0.5.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"artifacts": "napi artifacts",
|
package/src/provider/config.rs
CHANGED
|
@@ -100,6 +100,8 @@ pub struct ProviderConfig {
|
|
|
100
100
|
pub chains: Vec<ChainConfig>,
|
|
101
101
|
/// The address of the coinbase
|
|
102
102
|
pub coinbase: Buffer,
|
|
103
|
+
/// Enables RIP-7212
|
|
104
|
+
pub enable_rip_7212: bool,
|
|
103
105
|
/// The configuration for forking a blockchain. If not provided, a local
|
|
104
106
|
/// blockchain will be created
|
|
105
107
|
pub fork: Option<ForkConfig>,
|
|
@@ -261,6 +263,7 @@ impl TryFrom<ProviderConfig> for edr_provider::ProviderConfig {
|
|
|
261
263
|
chain_id: value.chain_id.try_cast()?,
|
|
262
264
|
chains,
|
|
263
265
|
coinbase: value.coinbase.try_cast()?,
|
|
266
|
+
enable_rip_7212: value.enable_rip_7212,
|
|
264
267
|
fork: value.fork.map(TryInto::try_into).transpose()?,
|
|
265
268
|
genesis_accounts: HashMap::new(),
|
|
266
269
|
hardfork: value.hardfork.into(),
|
package/src/result.rs
CHANGED
|
@@ -16,6 +16,7 @@ pub enum SuccessReason {
|
|
|
16
16
|
Return,
|
|
17
17
|
/// The opcode `SELFDESTRUCT` was called
|
|
18
18
|
SelfDestruct,
|
|
19
|
+
EofReturnContract,
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
impl From<edr_evm::SuccessReason> for SuccessReason {
|
|
@@ -24,6 +25,7 @@ impl From<edr_evm::SuccessReason> for SuccessReason {
|
|
|
24
25
|
edr_evm::SuccessReason::Stop => Self::Stop,
|
|
25
26
|
edr_evm::SuccessReason::Return => Self::Return,
|
|
26
27
|
edr_evm::SuccessReason::SelfDestruct => Self::SelfDestruct,
|
|
28
|
+
edr_evm::SuccessReason::EofReturnContract => Self::EofReturnContract,
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
}
|
|
@@ -34,6 +36,7 @@ impl From<SuccessReason> for edr_evm::SuccessReason {
|
|
|
34
36
|
SuccessReason::Stop => Self::Stop,
|
|
35
37
|
SuccessReason::Return => Self::Return,
|
|
36
38
|
SuccessReason::SelfDestruct => Self::SelfDestruct,
|
|
39
|
+
SuccessReason::EofReturnContract => Self::EofReturnContract,
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -97,6 +100,12 @@ pub enum ExceptionalHalt {
|
|
|
97
100
|
CreateContractStartingWithEF,
|
|
98
101
|
/// EIP-3860: Limit and meter initcode. Initcode size limit exceeded.
|
|
99
102
|
CreateInitCodeSizeLimit,
|
|
103
|
+
/// Aux data overflow, new aux data is larger tha u16 max size.
|
|
104
|
+
EofAuxDataOverflow,
|
|
105
|
+
/// Aud data is smaller then already present data size.
|
|
106
|
+
EofAuxDataTooSmall,
|
|
107
|
+
/// EOF Subroutine stack overflow
|
|
108
|
+
EOFFunctionStackOverflow,
|
|
100
109
|
}
|
|
101
110
|
|
|
102
111
|
impl From<edr_evm::HaltReason> for ExceptionalHalt {
|
|
@@ -122,6 +131,11 @@ impl From<edr_evm::HaltReason> for ExceptionalHalt {
|
|
|
122
131
|
edr_evm::HaltReason::CreateInitCodeSizeLimit => {
|
|
123
132
|
ExceptionalHalt::CreateInitCodeSizeLimit
|
|
124
133
|
}
|
|
134
|
+
edr_evm::HaltReason::EofAuxDataOverflow => ExceptionalHalt::EofAuxDataOverflow,
|
|
135
|
+
edr_evm::HaltReason::EofAuxDataTooSmall => ExceptionalHalt::EofAuxDataTooSmall,
|
|
136
|
+
edr_evm::HaltReason::EOFFunctionStackOverflow => {
|
|
137
|
+
ExceptionalHalt::EOFFunctionStackOverflow
|
|
138
|
+
}
|
|
125
139
|
edr_evm::HaltReason::OverflowPayment
|
|
126
140
|
| edr_evm::HaltReason::StateChangeDuringStaticCall
|
|
127
141
|
| edr_evm::HaltReason::CallNotAllowedInsideStatic
|
|
@@ -150,6 +164,9 @@ impl From<ExceptionalHalt> for edr_evm::HaltReason {
|
|
|
150
164
|
ExceptionalHalt::CreateContractSizeLimit => Self::CreateContractSizeLimit,
|
|
151
165
|
ExceptionalHalt::CreateContractStartingWithEF => Self::CreateContractStartingWithEF,
|
|
152
166
|
ExceptionalHalt::CreateInitCodeSizeLimit => Self::CreateInitCodeSizeLimit,
|
|
167
|
+
ExceptionalHalt::EofAuxDataOverflow => Self::EofAuxDataOverflow,
|
|
168
|
+
ExceptionalHalt::EofAuxDataTooSmall => Self::EofAuxDataTooSmall,
|
|
169
|
+
ExceptionalHalt::EOFFunctionStackOverflow => Self::EOFFunctionStackOverflow,
|
|
153
170
|
}
|
|
154
171
|
}
|
|
155
172
|
}
|