Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am jwasinger on github.
* I am jwasingeralt (https://keybase.io/jwasingeralt) on keybase.
* I have a public key ASCuN_81BhrkVZYeAKmnBtFSPUyg15GigM4v5USQ62zC7go
To claim this, I am signing this object:
{
"config": {
"chainId": 1337,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
@jwasinger
jwasinger / benchmark-output.txt
Last active December 9, 2024 14:47
EIP-2537 Geth Repricing Performance
goos: darwin
goarch: arm64
pkg: github.com/ethereum/go-ethereum/core/vm
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_0-Gas=375 399669 3024 ns/op 375.0 gas/op 124.0 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_1-Gas=375 391653 3003 ns/op 375.0 gas/op 124.8 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_2-Gas=375 400021 3063 ns/op 375.0 gas/op 122.4 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Add/matter_g1_add_3-Gas=375 392281 3046 ns/op 375.0 gas/op 123.1 mgas/s 320 B/op 3 allocs/op
BenchmarkPrecompiledBLS12381G1Mul/matter_g1_mul_0-Gas=12000 9206 125033 ns/op 12000 gas/op 95.97 mgas/s 1088 B/op 14 allocs/op
BenchmarkPrecompiledBLS12381G1Mul/matter_g1_mul_1-Gas=12000 9118 125131 ns/op 12000 gas/op 95.8
@jwasinger
jwasinger / explainer.md
Last active December 2, 2024 08:42
V2 Leaner API

We had some methods to call/transact:

// Transact creates and submits a transaction to the bound contract instance
// using the provided abi-encoded input (or nil).
func Transact(instance *ContractInstance, opts *bind.TransactOpts, input []byte) (*types.Transaction, error) {
	var (
		addr    = instance.Address
		backend = instance.Backend
	)
goroutine 5495 [chan send, 1471 minutes]:
github.com/ethereum/go-ethereum/core/state.(*subfetcher).schedule(0xc045913b00, {0xc0113d7ab0, 0x1, 0x40?})
github.com/ethereum/go-ethereum/core/state/trie_prefetcher.go:243 +0x17d
github.com/ethereum/go-ethereum/core/state.(*triePrefetcher).prefetch(0xc00f26edd0, {0xab, 0x14, 0xd6, 0x88, 0x2, 0xa7, 0x63, 0xf7, 0xdb, ...}, ...)
github.com/ethereum/go-ethereum/core/state/trie_prefetcher.go:148 +0x29c
github.com/ethereum/go-ethereum/core/state.(*stateObject).GetCommittedState(0xc0158a3420, {0x9, 0xe8, 0xfb, 0x6, 0x58, 0x45, 0x2e, 0xee, 0xdd, ...})
github.com/ethereum/go-ethereum/core/state/state_object.go:209 +0x49c
github.com/ethereum/go-ethereum/core/state.(*stateObject).GetState(...)
github.com/ethereum/go-ethereum/core/state/state_object.go:166
github.com/ethereum/go-ethereum/core/state.(*StateDB).GetState(0xc0113d7cb8?, {0xda, 0xc1, 0x7f, 0x95, 0x8d, 0x2e, 0xe5, 0x23, 0xa2, ...}, ...)
@jwasinger
jwasinger / witness-07.rlp.txt
Created December 12, 2023 15:15
snap vs trie-backed witnesses
This file has been truncated, but you can view the full file.
[
[
[
329eb696d374c66b242b4be32fc88c7e280731110676f4a430e615ed2cc3493e,
1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347,
690b9a9e9aa1c9db991c7721a92d351db4fac990,
3b76ba91ce7f8f1d630e8abce31d8c14b5877e9596c20747ef6aaff002a468ce,
2cc82d5ba2a24ff743e6043988bb17d460c52d71e96ddb665a51a659b1de69a8,
7ad582c225fe97437a4c5a71415956f399bfa9b038d4a86fd86f0fd0c7e9eb06,
1db7d1a163b873501e12b0758836fa4a30fb4750dc7884552a41012cd4a3c555c82be1b202c2d736f0d07928f601c9ad9e2524448b16b890cc10c79e14aa3d60faf6e99855508c7bf94f526b14012fe4969060c9145e9853adc6bc559fe6c0420970a102a6a7010f940cdab430bd6ee5a72b1c7d28c28f8bde0563d162681c909855b7d84f0c9b542ddb857b005517728db6602dc3d5b0cd6db629ce083264a03bdf3f73074566ee2eb348ce1a5fed34a6e3c2a25af3d6e6d56375f640f9ef55dc780c52174c047489526a30a51d5c9749f36c8f94042fb64bea2402d03dadc1a8bdb75872b976c302e4d685c67284f1ca25f928d754114f140b1c19b0ef5c2b,
#! /usr/bin/env sh
enr=$(docker logs lodestar1 | python3 -c 'import sys, re; s = sys.stdin.read(); s=re.search(r".*initialENR=(.*), .*", s); print(s.group(1));')
docker run -v $(pwd)/lodestardata:/lodestardata \
-p 9597:9597/tcp \
-it chainsafe/lodestar:latest dev \
--genesisValidators 8 \
--genesisTime 1669713528 \
--startValidators 0..7 \
@jwasinger
jwasinger / eip6780_create_selfdestruct_same_tx.json
Last active June 28, 2023 14:03
eip6780 tests (tentative)
{
"000/6780-create-inside-tx/shanghai": {
"_info": {
"filling-transition-tool": "evm version 1.11.7-unstable-c85c953f-20230428",
"filling-block-build-tool": "evm version 1.11.7-unstable-c85c953f-20230428",
"reference-spec": "https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6780.md",
"reference-spec-version": "cd7d6a465c03d86d852a1d6b5179bc78d760e658"
},
"blocks": [
{
@jwasinger
jwasinger / summary.md
Last active January 10, 2023 05:14
Native Call Tracer Opethereum Discrepancy
block tx tx_hash failure spot
14992579 70 0x3200d54e96fdfd41bce2fd5cd88bb144ebad4ea8267d6703a27afe0d19a3285c parent context
14993975 100 0x5a4c232153d1f53fabf3f37ba62fab956cf581108b4ccb0b653518a233120347 parent context
14993997 90 0x584d699abd63458c3c6c250202a7e41c41350b9fd35e4640b358faf943a6b10f parent context
14997259 62 0x43c0751da994be0e1dd9110faf51541680913e8ed4968d27a264d0e25fafbd52 parent context
14997534 128 0xa39e2abe9069f615928b3561f6a6a40fe84421c0d0bf8e65eb7fd39a737f40f7 parent context
14999176 209 0xb2eaa48e39a21d5a34a4474c9722d4796b701b1f84af9b0f5f816ff7db4e447d create2 initcode execution
14999613 271 0x666bab2c4b14cd7bd2131d29064b30343a65865e646fb57b306b0f8884c82104 create2 initcode execution
@jwasinger
jwasinger / main.js
Created November 23, 2021 05:25
verkle block rlp
const verkleBlockRlp = "f90cc9a019819c343b9a28c84d2cc17450936f426f1471cee8903eca9e42105ff06722d3a000000000000000000000000000000000000000000000000000000000000000009412d96589b343e25ccc305a761395cc1ea67b0e84a01c96c0ef65b0124b1c83cd9172ef952c0a414491ff8d7ad0fef7fca9c9d236a0a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832ffbd282520884619c79738d64616f2d686172642d666f726ba00000000000000000000000000000000000000000