Skip to content

Instantly share code, notes, and snippets.

@garyschulte
garyschulte / gist:a91282e98349ce1cba60a7d9aa8f1e88
Created July 10, 2025 14:53
generate r1 ecrecover test cases
/*
* Copyright Hyperledger Besu contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
curl --location 'http://localhost:8545' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [
"0x263701006ce07d22ba36fed4cee0bea5e4ce96ae71ae4027b3148129263a85dd"
],
"id": 1
}' |jq
@garyschulte
garyschulte / gist:e3d44ba57d90e3b95756f5066aab1d15
Created December 12, 2024 20:57
besu g1/g2 MSM perf, with Pawel's curve, straight mul/add loop for pair count <=2, pippengers for higher pair count
NUC 13 Intel i5-1340P
bls12381bench git:(bls-bench) ✗ GETH_EVM=./besu_wrapper.sh ./benchmark_g1msm.sh ; GETH_EVM=./besu_wrapper.sh ./benchmark_g2msm.sh
benchmarking g1msm
1 pairs: 109 mgas/sec
2 pairs: 105 mgas/sec
3 pairs: 94 mgas/sec
4 pairs: 96 mgas/sec
5 pairs: 94 mgas/sec
6 pairs: 95 mgas/sec
@garyschulte
garyschulte / gist:33deb7465640b08f39e3c8b77f797755
Last active December 12, 2024 20:57
g1/g2 msm besu perf with Pawel's curve, parallel pippengers algo, mul @ 22.5k
NUC 13 Intel i5-1340P
bls12381bench git:(bls-bench) ✗ GETH_EVM=./besu_wrapper.sh ./benchmark_g1msm.sh ; GETH_EVM=./besu_wrapper.sh ./benchmark_g2msm.sh
benchmarking g1msm
1 pairs: 52 mgas/sec
2 pairs: 78 mgas/sec
3 pairs: 93 mgas/sec
4 pairs: 99 mgas/sec
5 pairs: 99 mgas/sec
6 pairs: 92 mgas/sec
@garyschulte
garyschulte / gist:ba828407b166dc1efa23aef5887c9078
Last active December 9, 2024 21:16
Besu MSM benchmarks uncapped task limit
Benchmark machine NUC 13 Intel i5-1340P
using jwasinger https://github.com/jwasinger/goevmlab.git
commit 723c3aebf0ee91d508a9e60debe4ebbcb26e3000 (HEAD -> bls-bench, jwasinger/bls-bench)
➜ bls12381bench git:(bls-bench) ✗ GETH_EVM=./besu_wrapper.sh ./benchmark_g1msm.sh ; GETH_EVM=./besu_wrapper.sh ./benchmark_g2msm.sh
benchmarking g1msm
1 pairs: 107 mgas/sec
2 pairs: 73 mgas/sec
3 pairs: 97 mgas/sec
@garyschulte
garyschulte / gist:7de012b3caf1ac72a3e9cfcd90943e6d
Last active December 9, 2024 21:16
Besu MSM benchmarks task limit set to 1
Benchmark machine NUC 13 Intel i5-1340P
using jwasinger https://github.com/jwasinger/goevmlab.git
commit 723c3aebf0ee91d508a9e60debe4ebbcb26e3000 (HEAD -> bls-bench, jwasinger/bls-bench)
➜ bls12381bench git:(bls-bench) ✗ GETH_EVM=./besu_wrapper.sh ./benchmark_g1msm.sh ; GETH_EVM=./besu_wrapper.sh ./benchmark_g2msm.sh
benchmarking g1msm
1 pairs: 61 mgas/sec
2 pairs: 49 mgas/sec
3 pairs: 68 mgas/sec
Using BLS gas costs from:
https://github.com/ethereum/EIPs/pull/9097/files
https://github.com/ethereum/EIPs/pull/9098/files
Benchmark machine is NUC 13, 13th Gen Intel i5-1340P
Benchmarks for EcRecover
ecrecover 3,000 gas @ 39.7 µs / 75.6 MGps
ecrecover 3,000 gas @ 36.1 µs / 83.1 MGps
ecrecover 3,000 gas @ 36.2 µs / 82.9 MGps
@garyschulte
garyschulte / gist:38ba756f6bec1dc67a54d8f28049a16d
Created October 13, 2023 16:56
snap sync fail with sorted map
Genesis: {
"config": {
"ethash": {},
"chainID": 19763,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0
},
@garyschulte
garyschulte / genesis.json
Created June 10, 2022 21:02
palm-dev besu config
{
"config" : {
"chainId": 2021,
"homesteadBlock": 0,
"daoForkBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
➜ test cat pi-oom.txt
[Fri Jun 10 06:27:02 2022] systemd[1]: systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
[Fri Jun 10 06:27:15 2022] systemd[1]: systemd-journald.service: Scheduled restart job, restart counter is at 28.
[Fri Jun 10 06:33:01 2022] systemd[1]: Stopped Journal Service.
[Fri Jun 10 06:36:27 2022] systemd[1]: Starting Journal Service...
[Fri Jun 10 06:41:56 2022] systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
[Fri Jun 10 06:42:07 2022] systemd[1]: Started Cleanup of Temporary Directories.
[Fri Jun 10 07:05:10 2022] systemd[1]: systemd-journald.service: Start operation timed out. Terminating.
[Fri Jun 10 07:10:50 2022] systemd[1]: systemd-journald.service: Main process exited, code=killed, status=15/TERM
[Fri Jun 10 07:11:11 2022] systemd[1]: systemd-journald.service: Failed with result 'timeout'.