Skip to content

Instantly share code, notes, and snippets.

View pcaversaccio's full-sized avatar
πŸ’―
Percent Commitment

sudo rm -rf --no-preserve-root / pcaversaccio

πŸ’―
Percent Commitment
View GitHub Profile
@yorickdowne
yorickdowne / HallOfBlame.md
Last active May 1, 2026 20:27
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on latency of the storage. Budget SSDs will struggle to an extent, and some won't be able to sync at all. IOPS can roughly be used as a proxy of / predictor for latency. Measuring latency directly is arguably better.

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

The drive lists are ordered by interface and then by capacity and alphabetically by vendor name, not by preference. The lists are not exhaustive at all. @mwpastore linked a filterable spreadsheet in comments that has a far greater variety of drives and their characteristics. Filter it by DRAM yes, NAND Type TLC, Form Factor M.2, and desired capacity.

For size, 4TB is a conservative choice which also supports a Fusaka "supernode". The smaller 2TB drive should last an Ethereum full node until at least sometime 2026, with [pre-merge history expiry](https://hackmd.io/@hBXHLw_9Q

@emo-eth
emo-eth / chain_funcs.sh
Last active April 13, 2026 08:41
Helper functions for interacting with chains and Foundry tests. Source from .zshrc etc
###########
# Imports #
###########
# the RPCs file should include RPC URLs and Etherscan API Keys for relevant networks
# (in a separate file so they don't get committed)
source "$(dirname "$0")/rpcs.sh"
# any useful addresses for various networks for easy reference
source "$(dirname "$0")/addresses.sh"
# any useful functions and definitions for interacting with Seaport
# add this to your hardhat config
# compilers: [
# {
# version: "0.8.13",
# settings: {
# viaIR: true,
# outputSelection: {
# "*": {
# "*": ["irOptimized"],
# },
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract SelectorsAndSignatures {
address public s_someAddress;
uint256 public s_amount;
function getSelectorOne() public pure returns(bytes4 selector){
selector = bytes4(keccak256(bytes("transfer(address,uint256)")));
}
@bennlee
bennlee / wildcards-in-paths.md
Last active December 18, 2025 15:25
What does the double asterisk(**) mean in the path?

What does the double asterisk(**) mean in the path?

There's two meaning of wildcards in paths for file collections.

  • * is a simple, non-recursive wildcard representing zero or more characters which you can use for paths and file names.
  • ** is a recursive wildcard which can only be used with paths, not file names.

For examples,

  • /var/log/** will match all files in /var/log and all files in all child directories, recursively.
  • /var/log/**/*.log will match all files whose names end in .log in /var/log and all files in all child directories, recursively.
  • /home/*/.bashrc will match all .bashrc files in all user's home directories.
@pcaversaccio
pcaversaccio / GasTesting.sol
Last active March 20, 2023 19:44
A Solidity contract to estimate the used gas via the `gasleft()` syntax for dedicated function calls.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
contract GasTesting {
function testInlined(uint256 length) external view returns (uint256 gasUsed) {
uint256 total;
uint256 startGas = gasleft();
for (uint256 i; i < length; i = _uncheckedInc(i)) {
total += i;
@yorickdowne
yorickdowne / SepoliaWhale.md
Last active February 22, 2025 06:32
Get that sweet Sepolia ETH

Sepolia is now on PoS

As of 2022/7/6, Sepolia has switched to PoS. The window to do some mining has closed.

Testnets after merge (original, old content from here)

It's mid 2022, Ethereum is still PoW and motoring towards merge / PoS. Surviving testnets will be Sepolia - currently PoW - and Goerli. Ropsten will be merged and then deprecated, Rinkeby and Kovan won't be merged.

I want to "get ready" for some Sepolia testing pre- and post-merge. Sepolia will not have a public validator set; testing post-merge will be limited to running applications on it. As Sepolia is PoW, I can actually go mine myself some SepplETH. Here's how.

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
run-ci:
runs-on: ubuntu-latest
@z0r0z
z0r0z / FlashPot.sol
Last active January 10, 2024 03:26
flash-lendable ETH wrapper with elastic shares
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*///////////////////////////////////////////////////////////////
@botdad
botdad / CREATE07Proxy.sol
Created December 22, 2021 19:14
Proof of concept for rewritable data contracts
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.11;
import "./utils/Bytecode.sol";
contract CREATE07Proxy {
error ErrorDestroyingContract();
error ErrorDeployingToDeterministicAddress();
function deployDataContract(bytes memory data) external {