You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally this issue was created for "supporting saving Anvil dump state file as a checksum/hash & RPC Method for checking state change"
Upon a state change occurring from a configured account (meaning state mutation resulting from an account we defined to use for anvil rather than a built-in address such as the CREATE2 deployer addresses) or alt accepting some account access dict, anvil will write to disk a state-diff file using a hash as the filename (filename as hash or incremented sortable naming convention).
Anvil
Watching for state change using hash of state dump
When setting up Anvil we typically use this setup
MNEMONIC='test test test test test test test test test test test junk'
CHAIN_ID=31337
anvil --port 8545 --chain-id "${CHAIN_ID}" --state-interval 1 --dump-state anvil-state.json --config-out accounts --mnemonic "${MNEMONIC}"& \
while! nc -z 127.0.0.1 8545;doecho"Waiting for Anvil Fork $CHAIN_ID to be available"; sleep 1;done&& \
echo"Anvil state setup..."&& \
# Create a hash of the anvil dump state to check
ANVIL_STATE_HASH=$(sha256sum anvil-state.json | cut -d '' -f 1)&& \
echo"$ANVIL_STATE_HASH"> errata_logs.txt && \
forge script ./script/Setup.s.sol --account env_setup \
--password '' --sender 0x23CCa589Db0956cb6350d0Bd17A65f96A86eC3e6 \
--rpc-url local-8545 --sig "run_anvil()" --broadcast && \
echo"Pending Enviornment Setup and Deployments..."&& \
# Check for state changewhile [ "$(sha256sum anvil-state.json | cut -d '' -f 1)"="$ANVIL_STATE_HASH" ];do sleep 1;done
Having an anvil_checkState RPC method to query that would return ANVIL_STATE_HASH=$(sha256sum anvil-state.json | cut -d ' ' -f 1) would make orchestrating CI Matrix testing easier.
Additional context
No response
The text was updated successfully, but these errors were encountered:
sambacha
changed the title
feat: support saving Anvil dump state file as a checksum/hash & RPC Method for checking state change
feat: support saving Anvil state diffs based from account access dict
Jul 12, 2024
Feature: Support saving State Diff File
Note
Originally this issue was created for "supporting saving Anvil dump state file as a checksum/hash & RPC Method for checking state change"
Upon a state change occurring from a configured account (meaning state mutation resulting from an account we defined to use for anvil rather than a built-in address such as the CREATE2 deployer addresses) or alt accepting some account access dict, anvil will write to disk a state-diff file using a hash as the filename (filename as hash or incremented sortable naming convention).
Anvil
Watching for state change using hash of state dump
When setting up Anvil we typically use this setup
Having an
anvil_checkState
RPC method to query that would returnANVIL_STATE_HASH=$(sha256sum anvil-state.json | cut -d ' ' -f 1)
would make orchestrating CI Matrix testing easier.Additional context
No response
The text was updated successfully, but these errors were encountered: