Skip to content
Closed
7 changes: 7 additions & 0 deletions packages/ovm/src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const convertInternalLogsToOvmLogs = (
numberOfEMLogs++
prevEMLogIndex = log.logIndex
const executionManagerLog = executionManagerInterface.parseLog(log)
stringsToDebugLog.push(
`Parsed internal EM log with topic: ${executionManagerLog.name}`
)
if (!executionManagerLog) {
stringsToDebugLog.push(
`Execution manager emitted log with topics: ${log.topics}. These were unrecognized by the interface parser-but definitely not an ActiveContract event, ignoring...`
Expand Down Expand Up @@ -140,6 +143,10 @@ export const getSuccessfulOvmTransactionMetadata = (
metadata.revertMessage = revertMessagePrefix
} else {
// decode revert message from event
logger.debug(`here is the thing we fail to decode:`)
logger.debug(
ethers.utils.hexDataSlice(revertEvents[0].values['_revertMessage'], 4)
)
const msgBuf: any = abi.decode(
['bytes'],
// Remove the first 4 bytes of the revert message that is a sighash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import {
Address,
GAS_LIMIT,
DEFAULT_CHAIN_PARAMS,
DEFAULT_OPCODE_WHITELIST_MASK,
DEFAULT_ETHNODE_GAS_LIMIT,
} from '@eth-optimism/rollup-core'
Expand Down Expand Up @@ -88,7 +89,12 @@ describe('Execution Manager -- Call opcodes', () => {
executionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, true],
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
true,
],
{
gasLimit: DEFAULT_ETHNODE_GAS_LIMIT,
}
Expand Down Expand Up @@ -451,6 +457,7 @@ describe('Execution Manager -- Call opcodes', () => {
callBytes,
ZERO_ADDRESS,
ZERO_ADDRESS,
GAS_LIMIT,
true,
])

Expand Down Expand Up @@ -478,6 +485,7 @@ describe('Execution Manager -- Call opcodes', () => {
callBytes,
ZERO_ADDRESS,
ZERO_ADDRESS,
GAS_LIMIT,
true,
])
return executionManager.provider.call({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../setup'
import {
Address,
GAS_LIMIT,
DEFAULT_CHAIN_PARAMS,
DEFAULT_OPCODE_WHITELIST_MASK,
DEFAULT_ETHNODE_GAS_LIMIT,
} from '@eth-optimism/rollup-core'
Expand Down Expand Up @@ -57,7 +58,12 @@ describe('Execution Manager -- Code-related opcodes', () => {
executionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, true],
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
true,
],
{ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import {
Address,
GAS_LIMIT,
DEFAULT_CHAIN_PARAMS,
DEFAULT_OPCODE_WHITELIST_MASK,
DEFAULT_ETHNODE_GAS_LIMIT,
} from '@eth-optimism/rollup-core'
Expand Down Expand Up @@ -72,7 +73,12 @@ describe('Execution Manager -- Context opcodes', () => {
executionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, true],
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
true,
],
{ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT }
)

Expand Down Expand Up @@ -236,6 +242,7 @@ describe('Execution Manager -- Context opcodes', () => {
callBytes,
ZERO_ADDRESS,
ZERO_ADDRESS,
GAS_LIMIT,
true,
])
return executionManager.provider.call({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import {
DEFAULT_OPCODE_WHITELIST_MASK,
GAS_LIMIT,
DEFAULT_CHAIN_PARAMS,
DEFAULT_ETHNODE_GAS_LIMIT,
} from '@eth-optimism/rollup-core'

Expand Down Expand Up @@ -52,7 +53,12 @@ describe('ExecutionManager -- Create opcodes', () => {
executionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, true],
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
true,
],
{ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT }
)

Expand All @@ -64,7 +70,12 @@ describe('ExecutionManager -- Create opcodes', () => {
safetyCheckedExecutionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, false], // Note: this is false, so it's safety checked.
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
false,
], // Note: this is false, so it's safety checked.
{ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT }
)

Expand Down
17 changes: 15 additions & 2 deletions packages/ovm/test/contracts/execution-manager.executeCall.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../setup'
import {
Address,
GAS_LIMIT,
DEFAULT_CHAIN_PARAMS,
CHAIN_ID,
DEFAULT_OPCODE_WHITELIST_MASK,
DEFAULT_ETHNODE_GAS_LIMIT,
Expand Down Expand Up @@ -42,7 +43,7 @@ const unsignedCallMethodId: string = ethereumjsAbi
.methodID('executeTransaction', [])
.toString('hex')

describe('Execution Manager -- Call opcodes', () => {
describe('Execution Manager -- Call execution', () => {
const provider = createMockProvider({ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT })
const [wallet] = getWallets(provider)
// Create pointers to our execution manager & simple copier contract
Expand All @@ -58,7 +59,12 @@ describe('Execution Manager -- Call opcodes', () => {
executionManager = await deployContract(
wallet,
ExecutionManager,
[DEFAULT_OPCODE_WHITELIST_MASK, '0x' + '00'.repeat(20), GAS_LIMIT, true],
[
DEFAULT_OPCODE_WHITELIST_MASK,
'0x' + '00'.repeat(20),
DEFAULT_CHAIN_PARAMS,
true,
],
{ gasLimit: DEFAULT_ETHNODE_GAS_LIMIT }
)
// Set the state manager as well
Expand Down Expand Up @@ -120,6 +126,7 @@ describe('Execution Manager -- Call opcodes', () => {
transaction.nonce,
transaction.to,
transaction.data,
transaction.gasLimit,
padToLength(v, 4),
padToLength(r, 64),
padToLength(s, 64)
Expand Down Expand Up @@ -158,6 +165,7 @@ describe('Execution Manager -- Call opcodes', () => {
transaction.data,
wallet.address,
ZERO_ADDRESS,
GAS_LIMIT,
true
)
await provider.waitForTransaction(tx.hash)
Expand Down Expand Up @@ -195,6 +203,7 @@ describe('Execution Manager -- Call opcodes', () => {
transaction.nonce,
transaction.to,
transaction.data,
transaction.gasLimit,
padToLength(v, 4),
padToLength(r, 64),
padToLength(s, 64)
Expand Down Expand Up @@ -232,6 +241,7 @@ describe('Execution Manager -- Call opcodes', () => {
transaction.nonce,
transaction.to,
transaction.data,
transaction.gasLimit,
v,
r,
s
Expand Down Expand Up @@ -270,6 +280,7 @@ describe('Execution Manager -- Call opcodes', () => {
transaction.nonce,
transaction.to,
transaction.data,
transaction.gasLimit,
padToLength(v, 4),
padToLength(r, 64),
padToLength(s, 64)
Expand All @@ -295,6 +306,7 @@ describe('Execution Manager -- Call opcodes', () => {
internalCalldata,
wallet.address,
ZERO_ADDRESS,
GAS_LIMIT,
true,
]
)
Expand Down Expand Up @@ -337,6 +349,7 @@ describe('Execution Manager -- Call opcodes', () => {
internalCalldata,
wallet.address,
ZERO_ADDRESS,
GAS_LIMIT,
true,
]
)
Expand Down
Loading