Skip to content

renlord/bookish-octo-barnacle

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

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:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published