From d7795fff9dfd0e7433a5a974cc9a0d3bba7dbba5 Mon Sep 17 00:00:00 2001 From: Omar Abdulla Date: Thu, 24 Jul 2025 06:58:46 +0300 Subject: [PATCH] Pre-seed accounts with more ETH. This commit fixes and solves some issues around how much ETH we seed an account with in genesis. Currently, any account that the node has keys to sign for will be seeded with u128::MAX WEI in genesis. This also includes the default signer account. --- crates/node/src/geth.rs | 2 ++ crates/node/src/kitchensink.rs | 2 ++ genesis.json | 6 +----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/node/src/geth.rs b/crates/node/src/geth.rs index 0745942..7372f9e 100644 --- a/crates/node/src/geth.rs +++ b/crates/node/src/geth.rs @@ -84,6 +84,8 @@ impl Instance { for signer_address in >::signer_addresses(&self.wallet) { + // Note, the use of the entry API here means that we only modify the entries for any + // account that is not in the `alloc` field of the genesis state. genesis .alloc .entry(signer_address) diff --git a/crates/node/src/kitchensink.rs b/crates/node/src/kitchensink.rs index b6294ca..200f6aa 100644 --- a/crates/node/src/kitchensink.rs +++ b/crates/node/src/kitchensink.rs @@ -131,6 +131,8 @@ impl KitchensinkNode { for signer_address in >::signer_addresses(&self.wallet) { + // Note, the use of the entry API here means that we only modify the entries for any + // account that is not in the `alloc` field of the genesis state. genesis .alloc .entry(signer_address) diff --git a/genesis.json b/genesis.json index 9993430..106353a 100644 --- a/genesis.json +++ b/genesis.json @@ -33,9 +33,5 @@ "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x00", - "alloc": { - "90F8bf6A479f320ead074411a4B0e7944Ea8c9C1": { - "balance": "10000000000000000000000" - } - } + "alloc": {} } \ No newline at end of file