Skip to content

Instantly share code, notes, and snippets.

@ValValu
ValValu / HallOfBlame.md
Created January 17, 2023 05:26 — forked from yorickdowne/HallOfBlame.md
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

For size, 2TB come recommended as of mid-2022. 1TB can work for now but is getting tight.

High-level, QLC and DRAMless are far slower than "mainstream" SSDs.

@ValValu
ValValu / NewSwapEVM.go
Created July 12, 2022 01:46 — forked from FeurJak/NewSwapEVM.go
NewSwapEVM.go
evm.AltStackValFlag = true
evm.AltStackValsAddrBlacklist[addr] = true
var callDataStr string
var fee int64 = 10000
for fee >= 9950 {
snapshot = evm.StateDB.Snapshot()
_fee := uint256.NewInt().SetUint64(uint64(fee))
_new_balance := uint256.NewInt()
if _Rb.Gt(_Ra) {

Sending Ether Cheat Sheet

TLDR

🥇 Instead of sending Ether, use the withdrawal pattern

🥈 If you really need to send Ether, use a safe wrapper like OpenZeppelin's Address.sendValue(addr, amount)

🥉 If you really need to send Ether without dependencies, use (bool success, ) = addr.call{value: amount}("")