Skip to content

Commit

Permalink
Fix errors from file reorg rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke committed Sep 28, 2020
1 parent c234a7b commit 1959de5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions packages/vm/lib/evm/opcodes/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
KECCAK256_NULL,
} from 'ethereumjs-util'
import {
accessAddressEIP2929,
accessStorageEIP2929,
adjustSstoreGasEIP2929,
addressToBuffer,
describeLocation,
divCeil,
Expand Down
10 changes: 5 additions & 5 deletions packages/vm/lib/evm/opcodes/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MASK_160 = new BN(1).shln(160).subn(1)
* @param {BN} address
* @return {Buffer}
*/
function addressToBuffer(address: BN | Buffer) {
export function addressToBuffer(address: BN | Buffer) {
if (Buffer.isBuffer(address)) return address
return address.and(MASK_160).toArrayLike(Buffer, 'be', 20)
}
Expand All @@ -23,7 +23,7 @@ function addressToBuffer(address: BN | Buffer) {
* @param {RunState} runState
* @param {BN} address
*/
function accessAddressEIP2929(runState: RunState, address: BN | Buffer, baseFee?: number) {
export function accessAddressEIP2929(runState: RunState, address: BN | Buffer, baseFee?: number) {
if (!runState._common.eips().includes(2929)) return

const addressStr = addressToBuffer(address).toString('hex')
Expand Down Expand Up @@ -52,7 +52,7 @@ function accessAddressEIP2929(runState: RunState, address: BN | Buffer, baseFee?
* @param {RunState} runState
* @param {Buffer} key (to storage slot)
*/
function accessStorageEIP2929(runState: RunState, key: Buffer, isSstore: boolean) {
export function accessStorageEIP2929(runState: RunState, key: Buffer, isSstore: boolean) {
if (!runState._common.eips().includes(2929)) return

const keyStr = key.toString('hex')
Expand Down Expand Up @@ -84,7 +84,7 @@ function accessStorageEIP2929(runState: RunState, key: Buffer, isSstore: boolean
* @param {string} costName parameter name ('reset' or 'noop')
* @return {number} adjusted cost
*/
function adjustSstoreGasEIP2929(
export function adjustSstoreGasEIP2929(
runState: RunState,
key: Buffer,
defaultCost: number,
Expand Down Expand Up @@ -315,7 +315,7 @@ export function subMemUsage(runState: RunState, offset: BN, length: BN) {
* @param {any} found
* @param {Buffer} value
*/
function updateSstoreGas(runState: RunState, found: any, value: Buffer, key: Buffer) {
export function updateSstoreGas(runState: RunState, found: any, value: Buffer, key: Buffer) {
if (runState._common.hardfork() === 'constantinople') {
const original = found.original
const current = found.current
Expand Down

1 comment on commit 1959de5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1959de5 Previous: 0103b50 Ratio
Block 9422905 1623 ops/sec (±3.46%) 1712 ops/sec (±2.80%) 1.05
Block 9422906 1690 ops/sec (±6.26%) 1638 ops/sec (±8.56%) 0.97
Block 9422907 1622 ops/sec (±8.40%) 1746 ops/sec (±1.71%) 1.08
Block 9422908 1687 ops/sec (±1.14%) 1717 ops/sec (±1.00%) 1.02
Block 9422909 1384 ops/sec (±12.76%) 1674 ops/sec (±1.30%) 1.21
Block 9422910 1602 ops/sec (±1.38%) 1393 ops/sec (±11.11%) 0.87
Block 9422911 1618 ops/sec (±1.27%) 1564 ops/sec (±1.91%) 0.97
Block 9422912 1575 ops/sec (±1.37%) 1567 ops/sec (±1.46%) 0.99
Block 9422913 1591 ops/sec (±1.29%) 1600 ops/sec (±1.83%) 1.01
Block 9422914 1142 ops/sec (±14.42%) 1600 ops/sec (±1.49%) 1.40

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.