GithubHelp home page GithubHelp logo

bookish-octo-barnacle's Introduction

Paper: https://arxiv.org/abs/1905.00553

"""How the plots are generated:
import os
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import concurrent.futures as conc
mpl.rc('font', size=16)

WIDTH=14
HEIGHT=10

OUTPUT_DIR="/scratch/[REDACTED]/SNB2019-PLOTS/"

datafiles = os.listdir('/scratch/[REDACTED]/muppet-ops')

fig, axes = plt.subplots(1, 1, figsize=(WIDTH,HEIGHT))
axes.set_ylabel('Density')

def plot(filename):
    fig, axes = plt.subplots(1, 1, figsize=(WIDTH,HEIGHT))
    axes.set_ylabel('Density')

    try:  
        muppetRatios = np.fromfile('/scratch/[REDACTED]/muppet-ops/{}'.format(filename),
          dtype=float, sep='\n')
        loulaRatios = np.fromfile('/scratch/[REDACTED]/loula-ops-data/{}'.format(filename),
          dtype=float, sep='\n')

        axes.set_xscale('log')
        axes.set_xlabel('{} Time-to-Gas Ratio (ns/gas)'.format(filename))
        ax = axes.twinx()
        ax.set_ylabel('Observation Count')

        muppetlogbins = np.geomspace(1, muppetRatios.max())
        loulalogbins = np.geomspace(1, loulaRatios.max())

        ax.hist(muppetRatios, bins=muppetlogbins,\
          alpha=0.3,\
          label="Machine A")
        axes.hist(muppetRatios, bins=muppetlogbins,\
          histtype='step', density=True,
               cumulative=True)
        ax.hist(loulaRatios, bins=loulalogbins,\
          alpha=0.3,\
          label="Machine B")
        axes.hist(loulaRatios, bins=loulalogbins,\
          histtype='step', density=True, cumulative=True)
        axes.axvline(1000, ls='--', color='r', label="Baseline")
        fig.legend(["Baseline", 'Machine A', 'Machine B'], loc="lower center",
        ncol=3, borderaxespad=0)
        plt.savefig(OUTPUT_DIR + "{}".format(filename[:-4] + '.png'))
    except ValueError:
        return


with conc.ProcessPoolExecutor(max_workers=32) as e:
    e.map(plot, datafiles)
"""

PLOT_DIR='/scratch/[ANON]/SNB2019-PLOTS/'

from IPython.display import Image, display
import os


plots = os.listdir(PLOT_DIR)
for i in range(0, len(plots)):
    print(plots[i])
    display(Image(filename=(PLOT_DIR+plots[i])))
DUP3.png

png

ORIGIN.png

png

MSTORE8.png

png

GT.png

png

MOD.png

png

CALLVALUE.png

png

PUSH3.png

png

AND.png

png

SWAP1.png

png

SWAP14.png

png

ISZERO.png

png

GAS.png

png

POP.png

png

LOG2.png

png

JUMPCI.png

png

BLOCKHASH.png

png

SSTORE.png

png

DUP10.png

png

BYTE.png

png

PUSH2.png

png

DUP9.png

png

SWAP13.png

png

PUSH5.png

png

SWAP2.png

png

SUICIDE.png

png

EQ.png

png

SWAP9.png

png

SUB.png

png

DUP15.png

png

BALANCE.png

png

SWAP8.png

png

GASLIMIT.png

png

PUSHC.png

png

MLOAD.png

png

JUMPDEST.png

png

JUMPI.png

png

PUSH1.png

png

DUP13.png

png

SWAP7.png

png

EXTCODESIZE.png

png

DUP7.png

png

SWAP4.png

png

CALLDATALOAD.png

png

MUL.png

png

DUP14.png

png

DUP16.png

png

CALLER.png

png

SIGNEXTEND.png

png

MSTORE.png

png

DUP1.png

png

SWAP5.png

png

DIV.png

png

SWAP11.png

png

GASPRICE.png

png

SWAP12.png

png

OR.png

png

XOR.png

png

CODECOPY.png

png

MULMOD.png

png

NUMBER.png

png

DUP4.png

png

PC.png

png

SWAP6.png

png

ADDMOD.png

png

DUP12.png

png

LT.png

png

JUMP.png

png

EXTCODECOPY.png

png

COINBASE.png

png

DUP2.png

png

LOG0.png

png

SWAP3.png

png

ADDRESS.png

png

SWAP16.png

png

RETURN.png

png

TIMESTAMP.png

png

LOG3.png

png

SMOD.png

png

DUP11.png

png

PUSH4.png

png

DUP5.png

png

CALLDATACOPY.png

png

ADD.png

png

DUP6.png

png

LOG1.png

png

DIFFICULTY.png

png

SHA3.png

png

SWAP10.png

png

SGT.png

png

SLT.png

png

SDIV.png

png

LOG4.png

png

JUMPC.png

png

EXP.png

png

NOT.png

png

SWAP15.png

png

DUP8.png

png

CALLDATASIZE.png

png

SLOAD.png

png

CODESIZE.png

png

MSIZE.png

png

print("total number of plots: " + str(len(plots)))
total number of plots: 101
# Traces are available at:

bookish-octo-barnacle's People

Contributors

renlord avatar

Watchers

 avatar  avatar  avatar

Forkers

sambacha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.