From b8e1a411f75d2f49f31e9f6f7ad851cd6a0c0254 Mon Sep 17 00:00:00 2001 From: Haofan Zheng Date: Sat, 22 Apr 2023 23:43:21 -0700 Subject: [PATCH] removed geth throughput eval code --- code/go/throughput-eval/go.mod | 25 --- code/go/throughput-eval/go.sum | 144 ------------- code/go/throughput-eval/main.go | 354 -------------------------------- 3 files changed, 523 deletions(-) delete mode 100644 code/go/throughput-eval/go.mod delete mode 100644 code/go/throughput-eval/go.sum delete mode 100644 code/go/throughput-eval/main.go diff --git a/code/go/throughput-eval/go.mod b/code/go/throughput-eval/go.mod deleted file mode 100644 index 5409f8d..0000000 --- a/code/go/throughput-eval/go.mod +++ /dev/null @@ -1,25 +0,0 @@ -module throughput-test - -go 1.19 - -require ( - github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect - github.com/deckarep/golang-set/v2 v2.1.0 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/ethereum/go-ethereum v1.11.3 // indirect - github.com/go-ole/go-ole v1.2.1 // indirect - github.com/go-stack/stack v1.8.1 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/gorilla/websocket v1.4.2 // indirect - github.com/huin/goupnp v1.0.3 // indirect - github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tklauser/go-sysconf v0.3.5 // indirect - github.com/tklauser/numcpus v0.2.2 // indirect - golang.org/x/crypto v0.1.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.5.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect -) diff --git a/code/go/throughput-eval/go.sum b/code/go/throughput-eval/go.sum deleted file mode 100644 index ab2d574..0000000 --- a/code/go/throughput-eval/go.sum +++ /dev/null @@ -1,144 +0,0 @@ -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= -github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 h1:ytcWPaNPhNoGMWEhDvS3zToKcDpRsLuRolQJBVGdozk= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= -github.com/ethereum/go-ethereum v1.11.3 h1:uuBkYUJW9aY5JYi3+sqLHz+XWyo5fmn/ab9XcbtVDTU= -github.com/ethereum/go-ethereum v1.11.3/go.mod h1:rBUvAl5cdVrAei9q5lgOU7RSEuPJk1nlBDnS/YSoKQE= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= -github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/code/go/throughput-eval/main.go b/code/go/throughput-eval/main.go deleted file mode 100644 index fec4572..0000000 --- a/code/go/throughput-eval/main.go +++ /dev/null @@ -1,354 +0,0 @@ -package main - -import ( - "bytes" - "context" - "encoding/binary" - "encoding/json" - "fmt" - "math/big" - "net/http" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/rlp" -) - -const ( - STARTBLOCK = 8627000 - ENDBLOCK = 8629000 - LOCAL_ENDPOINT = "http://127.0.0.1:8545/" -) - -var ( - BlockNums []string - RlpResp map[string]interface{} - - EthBlock *types.Block - EthHeader *types.Header - - HeaderRlpResp string -) - -type PayloadBlock struct { - Method string `json:"method"` - Params []any `json:"params"` - ID int `json:"id"` - Jsonrpc string `json:"jsonrpc"` -} - -func PanicIfError(err error) { - if err != nil { - panic(err) - } -} - -func GenerateBlockNums() { - for i := STARTBLOCK; i < ENDBLOCK; i++ { - BlockNums = append(BlockNums, fmt.Sprintf("0x%x", i)) - } -} - -// bloomValues is a private function in geth I've copied it and added in some print statements to show you how it works -// See here for function in geth codebase https://github.com/ethereum/go-ethereum/blob/d8ff53dfb8a516f47db37dbc7fd7ad18a1e8a125/core/types/bloom9.go#L139 -func bloomValues(data []byte, hashbuf []byte) (uint, byte, uint, byte, uint, byte) { - var hashed = crypto.Keccak256(data) - hashbuf = hashed[:6] - - // The actual bits to flip - v1 := byte(1 << (hashbuf[1] & 0x7)) - v2 := byte(1 << (hashbuf[3] & 0x7)) - v3 := byte(1 << (hashbuf[5] & 0x7)) - - // The indices for the bytes to OR in - i1 := types.BloomByteLength - uint((binary.BigEndian.Uint16(hashbuf)&0x7ff)>>3) - 1 - i2 := types.BloomByteLength - uint((binary.BigEndian.Uint16(hashbuf[2:])&0x7ff)>>3) - 1 - i3 := types.BloomByteLength - uint((binary.BigEndian.Uint16(hashbuf[4:])&0x7ff)>>3) - 1 - - return i1, v1, i2, v2, i3, v3 -} - -func CheckBloomBits(bloom []byte, data ...[]byte) bool { - buf := make([]byte, 6) - var i1, i2, i3 uint - var v1, v2, v3 byte - - for _, d := range data { - i1, v1, i2, v2, i3, v3 = bloomValues(d, buf) - inBloom := (bloom[i1]&v1 != 0 && bloom[i2]&v2 != 0 && bloom[i3]&v3 != 0) - if !inBloom { - return false - } - } - return true -} - -func StringToBytes(str string) []byte { - str = str[2:] - strBytes := common.FromHex(str) - - return strBytes -} - -func ExecuteRequest(requestBody *bytes.Reader) map[string]interface{} { - req, _ := http.NewRequest("POST", LOCAL_ENDPOINT, requestBody) - req.Header.Set("Content-Type", "application/json") - resp, _ := http.DefaultClient.Do(req) - - defer resp.Body.Close() - - // decode response into a map to extract result - err := json.NewDecoder(resp.Body).Decode(&RlpResp) - PanicIfError(err) - - return RlpResp -} - -func GetPayload(method string, blockNumHash string) *bytes.Reader { - data := PayloadBlock{ - Method: method, - Params: []any{blockNumHash}, - ID: 1, - Jsonrpc: "2.0", - } - payloadBytes, _ := json.Marshal(data) - payload := bytes.NewReader(payloadBytes) - return payload -} - -func HexStrToBytes(hexStr string) []byte { - hexStr = hexStr[2:] - resBytes := common.FromHex(hexStr) - - return resBytes -} - -/* -Iterate over a sequence of block numbers and retrieve the RLP-encoded header for each block. -*/ -func HeaderThroughput() { - numBlocks := len(BlockNums) - startTime := time.Now() - - for i := 0; i < numBlocks; i++ { - payload := GetPayload("debug_getRawHeader", BlockNums[i]) - headerRlp := ExecuteRequest(payload) - headerBytes := StringToBytes(headerRlp["result"].(string)) - - if len(headerBytes) == 0 { - fmt.Println("header bytes is empty") - } - } - - endTime := time.Now() - throughput := float64(numBlocks) / float64(endTime.Sub(startTime).Milliseconds()) * 1000 - fmt.Println("header throughput: ", throughput) -} - -/* -Iterate over a sequence of block numbers and retrieve the RLP-encoded blocks -*/ -func BlockThroughput() { - numBlocks := len(BlockNums) - startTime := time.Now() - - for i := 0; i < numBlocks; i++ { - payload := GetPayload("debug_getRawBlock", BlockNums[i]) - blockRlp := ExecuteRequest(payload) - blockBytes := StringToBytes(blockRlp["result"].(string)) - - EthBlock = new(types.Block) - if err := rlp.Decode(bytes.NewReader(blockBytes), &EthBlock); err != nil { - PanicIfError(err) - } - - // check if block hash matches - if EthBlock.Hash() != EthBlock.Header().Hash() { - fmt.Errorf("block hash does not match header hash") - } - } - - endTime := time.Now() - throughput := float64(numBlocks) / float64(endTime.Sub(startTime).Milliseconds()) * 1000 - fmt.Println("block throughput: ", throughput) -} - -func HeaderBloomThroughput() { - eventSigHash := crypto.Keccak256([]byte("SyncMsg(bytes16,bytes32)")) - sessionId := common.Hex2Bytes("52fdfc072182654f163f5f0f9a621d7200000000000000000000000000000000") - nonce := common.Hex2Bytes("9566c74d10037c4d7bbb0407d1e2c64981855ad8681d0d86d1e91e00167939cb") - - numBlocks := len(BlockNums) - startTime := time.Now() - - for i := 0; i < numBlocks; i++ { - payload := GetPayload("debug_getRawHeader", BlockNums[i]) - headerRlp := ExecuteRequest(payload) - headerBytes := StringToBytes(headerRlp["result"].(string)) - - EthHeader = new(types.Header) - if err := rlp.Decode(bytes.NewReader(headerBytes), &EthHeader); err != nil { - PanicIfError(err) - } - - // check if event signature, sessionId, and nonce are in the header bloom - headerBloom := EthHeader.Bloom.Bytes() - if CheckBloomBits(headerBloom, eventSigHash, sessionId, nonce) { - fmt.Println("event found in header bloom") - } - } - - endTime := time.Now() - throughput := float64(numBlocks) / float64(endTime.Sub(startTime).Milliseconds()) * 1000 - fmt.Println("header bloom throughput: ", throughput) -} - -func CheckReceipt(receipt *types.Receipt, eventDetails [3][]byte) bool { - if len(receipt.Logs) > 0 { - topics := receipt.Logs[0].Topics - if len(topics) == len(eventDetails) { - match := true - for j := 0; j < len(eventDetails); j++ { - if !bytes.Equal(eventDetails[j], topics[j].Bytes()) { - return false - } - } - if match { - fmt.Println("event sig: ", topics[0].Hex()) - return true - } - } - } - return false -} - -func EventInReceipts(receiptsRlp []interface{}, eventDetails [3][]byte) bool { - eventFound := false - numReceipts := len(receiptsRlp) - for i := 0; i < numReceipts; i++ { - receipt := new(types.Receipt) - receiptStr := receiptsRlp[i].(string) - receiptsBytes := HexStrToBytes(receiptStr) - - if err := receipt.UnmarshalBinary(receiptsBytes); err != nil { - PanicIfError(err) - } - - if CheckReceipt(receipt, eventDetails) { - eventFound = true - break - } - } - return eventFound -} - -func BloomAndReceiptThroughput() { - eventSigHash := crypto.Keccak256([]byte("SyncMsg(bytes16,bytes32)")) - sessionId := common.Hex2Bytes("52fdfc072182654f163f5f0f9a621d7200000000000000000000000000000000") - nonce := common.Hex2Bytes("9566c74d10037c4d7bbb0407d1e2c64981855ad8681d0d86d1e91e00167939cb") - eventDetails := [3][]byte{eventSigHash, sessionId, nonce} - - numBlocks := len(BlockNums) - startTime := time.Now() - - for i := 0; i < numBlocks; i++ { - requestPayload := GetPayload("debug_getRawHeader", BlockNums[i]) - headerRlp := ExecuteRequest(requestPayload) - headerBytes := StringToBytes(headerRlp["result"].(string)) - - if err := rlp.Decode(bytes.NewReader(headerBytes), &EthHeader); err != nil { - PanicIfError(err) - } - // check if event signature, sessionId, and nonce are in the header bloom - headerBloom := EthHeader.Bloom.Bytes() - if CheckBloomBits(headerBloom, eventSigHash, sessionId, nonce) { - requestPayload := GetPayload("debug_getRawReceipts", BlockNums[i]) - resultsRlp := ExecuteRequest(requestPayload) - receiptsRlp := resultsRlp["result"].([]interface{}) - - eventFound := EventInReceipts(receiptsRlp, eventDetails) - if eventFound { - fmt.Println("found event in receipt bloom") - } else { - fmt.Println("false positive") - } - } - } - - endTime := time.Now() - throughput := float64(numBlocks) / float64(endTime.Sub(startTime).Milliseconds()) * 1000 - fmt.Println("bloom and receipt throughput: ", throughput) -} - -func main() { - GenerateBlockNums() - - //// Throughput tests - HeaderThroughput() - BlockThroughput() - HeaderBloomThroughput() - BloomAndReceiptThroughput() - - //// Test functions - // ethClient := GetEthClient(LOCAL_ENDPOINT) - // CheckBlockForEvent(big.NewInt(8628615), ethClient) -} - -/** -****************************************************** - Test Functions -****************************************************** -*/ - -func GetEthClient(endpoint string) *ethclient.Client { - client, err := ethclient.Dial(endpoint) - PanicIfError(err) - - return client -} - -func CheckBlockForEvent(blocknum *big.Int, client *ethclient.Client) { - eventSig := []byte("SyncMsg(bytes16,bytes32)") - hash := crypto.Keccak256(eventSig) - eventSigHash := common.BytesToHash(hash) - fmt.Println("eventSigHash: ", hash) - - block, err := client.BlockByNumber(context.Background(), blocknum) - PanicIfError(err) - - contractAddr := "0x74Be867FBD89bC3507F145b36ba76cd0B1bF4f1A" - SyncContractAddr := common.HexToAddress(contractAddr) - - txns := block.Transactions() - numTxns := len(txns) - var txnHash common.Hash - found := false - for i := 0; i < numTxns; i++ { - to := txns[i].To() - if to != nil && *to == SyncContractAddr { - txnHash = txns[i].Hash() - found = true - fmt.Println("sync contract address found") - } - } - - if found { - receipt, err := client.TransactionReceipt(context.Background(), txnHash) - PanicIfError(err) - - logs := receipt.Logs - topics := logs[0].Topics - - if topics[0] == eventSigHash { - fmt.Println("sync event found") - fmt.Println("event parameters: ") - - for i := 1; i < len(topics); i++ { - fmt.Println(topics[i].Bytes()) - } - } - } -}