Skip to content

Instantly share code, notes, and snippets.

View ryanschneider's full-sized avatar

Ryan Schneider ryanschneider

  • infura.io
  • San Juan Capistrano, CA
View GitHub Profile

Eth Client Team Wishlist

Well-designed versioning strategy.

  • Recognize that a single "semver" version isn't enough, the client needs to separately semantically track all the different "contracts" it adheres to, such as:
    • The internal DB format (ideally this stays 1.x!)
    • The JSONRPC interface (decide what major/minor means here)
  • The hardfork / network version
@ryanschneider
ryanschneider / zig-boostrap-failure.md
Created November 2, 2022 17:08
zig-bootstrap failure

Running ./build -j4 aarch64-linux-musl native led to:

-- Configuring zig version 0.10.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ryanschneider/src/ryanschneider/zig-bootstrap/out/build-zig-host
Consolidate compiler generated dependencies of target opt_c_util
Consolidate compiler generated dependencies of target zigcpp
[  1%] Built target opt_c_util
@ryanschneider
ryanschneider / 3692574.json
Last active August 26, 2022 20:09
Combined teku/geth logs around slot 3692542 reorg
{
"version": "bellatrix",
"execution_optimistic": false,
"data": {
"message": {
"slot": "3692574",
"proposer_index": "6578",
"parent_root": "0xea3d2691f4a4dea3532f8ed9bb3829a0e0f6e70384433368092ad5b46e30a45a",
"state_root": "0x5239aba587c56484ece545278f66d7248a1ec7a65b53efd65f1da5aec3297b98",
"body": {
@ryanschneider
ryanschneider / geth-teku.log
Created August 24, 2022 20:33
goerli reorg event
Aug 18 10:34:38 ip-10-0-65-20 geth[12614]: INFO [08-18|10:34:38.507] Chain head was updated number=7,426,364 hash=72f165..4fa022 root=b4306e..4ff8e9 elapsed=1.894951ms
Aug 18 10:34:40 ip-10-0-65-20 teku[12613]: 2022-08-18 10:34:40.272 INFO - Slot Event *** Slot: 3692573, Block: f9773ae953ecbafe05f60235fbf392721b0d1ca0b4325f93a84ea9814a281c19, Justified: 115390, Finalized: 115388, Peers: 63
Aug 18 10:34:40 ip-10-0-65-20 geth[12614]: INFO [08-18|10:34:40.353] Imported new potential chain segment blocks=1 txs=35 mgas=4.188 elapsed=57.992ms mgasps=72.225 number=7,426,340 hash=4ee2d4..7ca70f age=6m4s
dirty=1023.65MiB
Aug 18 10:34:52 ip-10-0-65-20 teku[12613]: 2022-08-18 10:34:52.280 INFO - Slot Event *** Slot: 3692574, Block: ... empty, Justified: 115390, Finalized: 115388, Peers: 62
Aug 18 10:35:00 ip-10-0-65-20 geth[12614]: INFO [08-18|10:35:00.749] Imported new potential chain segment blocks=1 txs=115 mgas=29.9
@ryanschneider
ryanschneider / invalid-block.dump
Created August 15, 2022 22:14
Goerli - invalid receipt root hash
{
block: {
baseFeePerGas: "0x8",
difficulty: "0x0",
extraData: "0x",
gasLimit: "0x1c9c380",
gasUsed: "0xfa2d7",
hash: "0x1a35db11156284068530b225d8633de98ad437b57cf9bd334fb52872e55d082b",
logsBloom: "0x00000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000880010000000004000000000000000002000000008000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000800000000000000000000010000000000000000000000000000000000000000000000000040000000000000000000000200002000000000000100000000000000000000000000000000000000001000000000000000000004000000000000000000000000000000000000000000080",
miner: "0x19a5dd4a77b59567433ae69d51979ca60c7e40cf",
{
block: {
baseFeePerGas: "0x8",
difficulty: "0x0",
extraData: "0x",
gasLimit: "0x1c9c380",
gasUsed: "0x22c9cf",
hash: "0x6fcbaade4e1ac164960449958ea2494188264bfdc84e8736e68fe812e96513b1",
logsBloom: "0x002000842000000080000004800000000019802021000880280101000804200000101000010102000000000000000000000000001102000000100214002c604a008458020432000208020609002040680000100003059000000024808880008030020000020a0440080001000000aa09400040000024026100010210004000000000000200010001004000110000121200802c8101000008000804c91000800082004000100000100008200040004080000020020004200000000000402800210020400200820000102000400004000400501080020020100001410000096140001830004012060100c010002100080000007000005120400000000000000081",
miner: "0xbabad228c66ea0066758ec6e0e76fa8205c56740",
@ryanschneider
ryanschneider / signer.log
Last active July 28, 2022 14:25
repeatedly mining block 7,305,656
INFO [07-28|14:12:44.249] Commit new sealing work number=7,305,655 sealhash=52c3f2..b01d51 uncles=2 txs=19 gas=6,704,860 fees=0.0118153699 elapsed=65.243ms
INFO [07-28|14:12:47.006] Successfully sealed new block number=7,305,655 sealhash=52c3f2..b01d51 hash=bd697f..a46224 elapsed=2.757s
INFO [07-28|14:12:47.006] 🔨 mined potential block number=7,305,655 hash=bd697f..a46224
INFO [07-28|14:12:47.007] Commit new sealing work number=7,305,656 sealhash=337cb6..3f4dca uncles=2 txs=0 gas=0 fees=0 elapsed="914.449µs"
WARN [07-28|14:12:47.007] Block sealing failed err="signed recently, must wait for others"
INFO [07-28|14:12:47.046] Commit new sealing work number=7,305,656 sealhash=0e6ea0..8197d9 uncles=2 txs=2 gas=793,776 fees=0.001201164 elapsed=39.877ms
WARN [07-28|14:12:47.046] Block sealing failed err="signed recently, must wait for others"
INFO [07-28|14:12:
@ryanschneider
ryanschneider / bad.block
Created July 21, 2022 15:32
Ropsten Bad Block
{
block: {
baseFeePerGas: "0x7",
difficulty: "0x0",
extraData: "0x",
gasLimit: "0x1c9c380",
gasUsed: "0x11fd25f",
hash: "0x71b9dbd908ecb52ae0cb183e5a7a238b08fbcfe79ca38befcd222b2ac41fd6e9",
logsBloom: "0x006400000280000001001081c10000808021001040401040808320008000202800060040180002c0004040200000000400000000010022200000108010280000450150091001082a008204880040803108011040001680000010002080000200000210000a000002410c00110a200a20220041102400020110000410800800408200008000020010004a0300121000000000020104000008000000414a010401020020801001040040000100860840124004000000400003000100002010a0800000000200000000000010500200020000140090019400100120410400202600a2320820000000050c00844004041b8440a030000a0008c000800000c1200111",
miner: "0xf97e180c050e5ab072211ad2c213eb5aee4df134",
var rawAddResult *uint256.Int
func BenchmarkRawAdd(b *testing.B) {
x := new(uint256.Int).SetBytes(common.Hex2Bytes("0802431afcbce1fc194c9eaa417b2fb67dc75a95db0bc7ec6b1c8af11df6a1da9"))
y := new(uint256.Int).SetBytes(common.Hex2Bytes("a1f5aac137876480252e5dcac62c354ec0d42b76b0642b6181ed099849ea1d57"))
b.ResetTimer()
for i := 0; i < b.N; i++ {
rawAddResult = new(uint256.Int).Add(x, y)
}
@ryanschneider
ryanschneider / design.md
Last active August 13, 2021 17:15
Limit Spawns to Visited FOBs Feature Proposal

Limit Spawns to "visited" FOBs

Objective

To limit "spawn shifting" and encourage high-level logistical considerations in every Squad.

Summary

In high level play, "spawn shifting" (intentionally dying to enemy or even friendly contact to spawn closer to the front-line) is often the correct play when out of position, as respawning at a FOB closer to the new objective is often faster than that going there on-foot.