trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.6k stars 676 forks source link

Withdrawals Simulation #4371

Open EvilJordan opened 1 year ago

EvilJordan commented 1 year ago

Now that v7.8.0 supports EIP-4895: Beacon chain push withdrawals as operations, it would be incredible if there were a way to simulate, for lack of a better word, withdrawal events in Ganache.

Specifically, a way to generate a block that has the withdrawals array and containing withdrawal objects that, in-turn, increase the balance of the target withdrawal address. I have a PR awaiting approval over at ethereum.org to describe the withdrawal object as technically described in the EIP.

The thought/use-case is when withdrawals affect the balance of an account, subsequent actions could be possible. For example: a block contains withdrawal information for a monitored address. A process is watching blocks for said address. Process kicks off a transaction now that balance has changed from withdrawal activity.

Being able to simulate such activity is, in my opinion, crucial for testing/building, as testnets rely on actual Proof of Stake and are, therefore, restricted by withdrawal index timing, ability to obtain requisite testnet Ether for staking, and reliance on technical ability and resources to set up a node. Doing it all locally with Ganache makes everyone's life easier!

davidmurdoch commented 1 year ago

Awesome! Sounds like great idea. I'll chat with the team this week and see if we can plan something to make this possible!