diff --git a/package.json b/package.json index db54eac..5ffb6e3 100644 --- a/package.json +++ b/package.json @@ -54,9 +54,10 @@ "axios": "^0.19.0", "bn.js": "^5.0.0", "ethereumjs-account": "^3.0.0", + "ethereumjs-common": "^1.5.0", "ethereumjs-testing": "git+https://github.com/ethereumjs/ethereumjs-testing.git#v1.2.7", "ethereumjs-util": "^6.1.0", - "ethereumjs-vm": "^4.1.0", + "ethereumjs-vm": "^4.1.3", "ethereumjs-wallet": "^0.6.3", "merkle-patricia-tree": "^3.0.0", "rlp": "^2.2.3" diff --git a/src/relayer/lib.ts b/src/relayer/lib.ts index 5e9eae5..6f9ddfd 100644 --- a/src/relayer/lib.ts +++ b/src/relayer/lib.ts @@ -6,6 +6,7 @@ import { Multiproof, verifyMultiproof, makeMultiproof, flatEncodeInstructions } import VM from 'ethereumjs-vm' import { Transaction } from 'ethereumjs-tx' import { getOpcodesForHF } from 'ethereumjs-vm/dist/evm/opcodes' +import Common from 'ethereumjs-common' const assert = require('assert') const { promisify } = require('util') @@ -401,8 +402,9 @@ export function rawMultiproof(proof: Multiproof, flatInstructions: boolean = fal } export function getBasicBlockIndices(code: Buffer): number[][] { + const hfIstanbul = new Common('mainnet', 'istanbul') const TERMINATING_OPS = ['JUMP', 'JUMPI', 'STOP', 'RETURN', 'REVERT', 'SELFDESTRUCT'] - const opcodes = getOpcodesForHF('istanbul') + const opcodes = getOpcodesForHF(hfIstanbul) const getOp = (i: number) => (opcodes[code[i]] ? opcodes[code[i]].name : 'INVALID') // [start, end) indices