Skip to content

Instantly share code, notes, and snippets.

This gist shares an experiment on an alternative implementation for JUMPDEST analysis.

Some quick notes:

  • The linked branch passes all go test ./... tests.
  • I'm not opening a PR since I'm not sure yet this might be convincing (explaining why below).

The main idea is to minimize the amount of bitwise operations by switching from a vector of byte to uint64. Using byte means that PUSHN where N is greater than 8 will have to span multiple bytes, thus requiring "internal loops".

Using uint64 means having more space to resolve any PUSHN in a single write attempt with at most one overflow without today's 2^16+2^8 decomposition.

@jsign
jsign / msg.md
Created October 5, 2023 16:34
msg

So, for the verifying part of the proof, parallelization makes a difference.

Verifying proof of 16k openings:

Total duration: 56ms
Duration per step:
      Generate challenge r and powers                       : 32.02ms
      Calculating helper_scalars r^i/(t-z_i)                : 0.72ms
 g_2(t) = SUM y_i*(r^i/(t-z_i))=SUM y_i*helper_scalars : 0.03ms
@jsign
jsign / f.md
Last active October 5, 2023 15:19
2023-10-05 VKT bench

CPU: AMD Ryzen 7 3800XT 8-Core Processor

Client: geth

Random key-values proving in a VKT

##### VKT proof benchmark #####
Setup: **in-memory** tree with 1000000 random key-values...
Link: https://github.com/gballet/go-ethereum/commit/8622bdcfb7238a94bedb68c4e18dd63e7e7e373b
Result:
```
$ go test ./trie/utils -run=TestPedersenHashDistribution -count=1 -v
=== RUN TestPedersenHashDistribution
Generating...
Aggregating...
Bit 0: 8000196 (deviation from expected 0.00%)
##### Raw polynomials multiproof benchmark #####
For 1 polynomials:
Proving:
Proof serialization duration: 0.10ms
Proof creation duration: 51ms
Duration per step:
Generate challenge r and powers : 0.02ms
Calculate t, g(x) and D : 3.50ms
Calculate h(x) and E : 3.37ms
Calculate (h-g)(x) and E-D : 0.00ms
mkdir kaustinen
cd kaustinen
git clone https://github.com/ethpandaops/verkle-testnet.git
git clone https://github.com/gballet/go-ethereum.git
cd go-ethereum
git checkout electra-proof-format
make
cd ..
git clone https://github.com/macladson/lighthouse.git
cd lighthouse
INFO [04-06|12:56:58.348] Maximum peer count ETH=50 LES=0 total=50
INFO [04-06|12:56:58.357] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [04-06|12:56:58.358] Set global gas cap cap=50,000,000
INFO [04-06|12:56:58.359] Allocated cache and file handles database=/data/ef2/.ethereum/geth/chaindata cache=512.00MiB handles=524,288
INFO [04-06|12:56:58.492] Opened ancient database database=/data/ef2/.ethereum/geth/chaindata/ancient/chain readonly=false
INFO [04-06|12:56:58.494] Reading file name=00.bin
INFO [04-06|12:56:58.494] Building tree name=00.bin
INFO [04-06|12:56:58.494] Serializing tree
INFO [04-06|12:56:58.817] Processing file name=00.bin
INFO [04-06|12:56:58.856] Sorting file name=00.bin
#!/bin/bash
### Configs
LOTUS_TAG=v1.2.1
EXTERNAL_DISK_SIZE=1T
GOLANG_TAR=go1.15.5.linux-amd64.tar.gz
IPFS_DOWNLOAD=https://dist.ipfs.io/go-ipfs/v0.7.0/go-ipfs_v0.7.0_linux-amd64.tar.gz
SWAP_SIZE=100G
####
#!/bin/bash
### Configs
LOTUS_TAG=v1.2.1
EXTERNAL_DISK_SIZE=1T
GOLANG_TAR=go1.15.5.linux-amd64.tar.gz
IPFS_DOWNLOAD=https://dist.ipfs.io/go-ipfs/v0.7.0/go-ipfs_v0.7.0_linux-amd64.tar.gz
SWAP_SIZE=100G
####
@jsign
jsign / miners.json
Last active November 5, 2020 21:10
{
"buckets": [
{
"name": "PL",
"amount": 1,
"minerAddresses": [
"f02665"
]
}
]