File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export async function precompile12(opts: PrecompileInput): Promise<ExecResult> {
118
118
const stem = stateDiff . stem
119
119
await tree . put ( stem , suffixes , values )
120
120
}
121
- const executionResult = true
121
+ let executionResult = true
122
122
123
123
const stateManager = new StatefulVerkleStateManager ( { common : opts . common , trie : tree } )
124
124
const l2EVM = await createEVM ( { stateManager, common : opts . common } )
@@ -146,12 +146,12 @@ export async function precompile12(opts: PrecompileInput): Promise<ExecResult> {
146
146
147
147
if ( computedGasUsed !== executeGasUsed ) {
148
148
opts . _debug ?.( `${ pName } gas used mismatch: ${ computedGasUsed } !== ${ executeGasUsed } ` )
149
- return EvmErrorResult ( new EvmError ( ERROR . REVERT ) , opts . gasLimit )
149
+ executionResult = false
150
150
}
151
151
152
152
if ( ! equalsBytes ( postStateRoot , tree . root ( ) ) ) {
153
153
opts . _debug ?.( `${ pName } post state root mismatch` )
154
- return EvmErrorResult ( new EvmError ( ERROR . REVERT ) , opts . gasLimit )
154
+ executionResult = false
155
155
}
156
156
157
157
opts . _debug ?.( `${ pName } trace executed successfully=${ executionResult } ` )
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ describe('Precompiles: EXECUTE', () => {
50
50
const tree = await createVerkleTree ( { verkleCrypto : verkle } )
51
51
const stateManager = new StatefulVerkleStateManager ( { common, trie : tree } )
52
52
await stateManager . putAccount ( address , account )
53
+
53
54
const preStateRoot = tree . root ( )
54
55
const evm = await createEVM ( { stateManager, common } )
55
56
@@ -83,8 +84,8 @@ describe('Precompiles: EXECUTE', () => {
83
84
}
84
85
const traceBytes = traceContainer . encode ( trace )
85
86
86
- // We use the hash as a reference to the trace . This should be replaced with a proper blob commitment (or versionedHash)
87
- // and the data should be stored as a proper Ethereum blob
87
+ // We use the sha256 hash of the serialized trace as a reference . This is standing in for the versionedHash that we should use
88
+ // once we have the trace properly converted to an Ethereum blob.
88
89
const hash = bytesToHex ( sha256 ( traceBytes ) )
89
90
evm [ 'executionBlobs' ] . set ( hash , traceBytes )
90
91
You can’t perform that action at this time.
0 commit comments