Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): add anvil node #1037

Merged
merged 310 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 183 commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
fcefd83
feat: implement dev signer
mattsse Apr 5, 2022
bee350f
feat: prefund genesis account
mattsse Apr 5, 2022
c7c57e0
feat: make everything compile
mattsse Apr 5, 2022
ed7693d
Merge branch 'master' into matt/node
mattsse Apr 6, 2022
0930d31
feat: implement dev signer
mattsse Apr 6, 2022
87e8a59
feat: impl node handle
mattsse Apr 6, 2022
3445e3f
feat: add endpoints
mattsse Apr 6, 2022
f4e0ce6
feat: more request variants
mattsse Apr 6, 2022
6b548f3
feat: implement eth request dispatch
mattsse Apr 6, 2022
23c1761
test: add some integration tests
mattsse Apr 6, 2022
01ac037
clippy fix
mattsse Apr 6, 2022
f870aa7
test: add some e2e tests
mattsse Apr 6, 2022
d5b0bca
feat: impl transaction by hash
mattsse Apr 6, 2022
42a438f
feat: impl transaction receipt
mattsse Apr 6, 2022
ccc2157
feat: better ethrequest decoding
mattsse Apr 6, 2022
bd572e8
feat: some fee details
mattsse Apr 6, 2022
7422e1c
chore: more tracing
mattsse Apr 6, 2022
a064e49
Merge branch 'master' into matt/node
mattsse Apr 7, 2022
8dd2e34
feat: impl ethcall
mattsse Apr 7, 2022
6f183d4
feat: impl eth estimate gas
mattsse Apr 7, 2022
fea72f7
bump ethers
mattsse Apr 7, 2022
eeb4893
return gas
mattsse Apr 7, 2022
54844ab
chore(clippy): make clippy happy
mattsse Apr 7, 2022
f3752a8
remove extra finalized values
mattsse Apr 7, 2022
7b78144
test: add transfer eth test
mattsse Apr 7, 2022
d860b9e
mark unimplemented calls
mattsse Apr 7, 2022
3bc1b70
feat: some work on eth_feeHistory
mattsse Apr 7, 2022
7aceb3f
feat: get block by number
mattsse Apr 7, 2022
82fe30d
refactor: tracing decoding
mattsse Apr 7, 2022
b153bd1
fix: better call decoding
mattsse Apr 7, 2022
a734865
fix: clippy happy
mattsse Apr 7, 2022
4a0a499
Merge branch 'master' into matt/node
mattsse Apr 7, 2022
8b816f4
bump ethers
mattsse Apr 7, 2022
8fe6229
Merge branch 'master' into matt/node
mattsse Apr 8, 2022
fe7f95f
feat: add tx validation
mattsse Apr 8, 2022
8006c4e
feat: add transaction rejection code
mattsse Apr 8, 2022
5af2069
feat: implement tx pre validation
mattsse Apr 8, 2022
c981ec1
fix: clippy happy
mattsse Apr 8, 2022
f180a6b
feat: use zero gas price for estimating
mattsse Apr 8, 2022
9a47550
refactor: make spawn async
mattsse Apr 8, 2022
bba1543
feat: work on forked mode
mattsse Apr 8, 2022
6f5063a
Merge branch 'master' into matt/node
mattsse Apr 8, 2022
e7b9856
Merge branch 'master' into matt/node
mattsse Apr 9, 2022
627ea8f
feat: implement forked Database
mattsse Apr 9, 2022
b00f451
feat: add setup backend function
mattsse Apr 9, 2022
6186e26
feat: more api functions
mattsse Apr 9, 2022
55b2147
feat: implement websocket rpc handling
mattsse Apr 9, 2022
72728ff
feat: add websocket tests
mattsse Apr 9, 2022
3a1f8a9
test: add deploy ws test
mattsse Apr 9, 2022
dfedeef
chore: rustfmt
mattsse Apr 9, 2022
61938d3
feat: cursed fee history calculations
mattsse Apr 9, 2022
df6126f
feat: tweak config settings and print message
mattsse Apr 9, 2022
e53c680
Merge branch 'master' into matt/node
mattsse Apr 11, 2022
acad667
feat: add forked storage
mattsse Apr 11, 2022
da61203
feat: add support for fetching state from forked client
mattsse Apr 11, 2022
66c8ded
feat: add get tx by block hash and index
mattsse Apr 11, 2022
b49ec91
chore(clippy): make clippy happy
mattsse Apr 11, 2022
c5e0499
feat: support fork in args and print fork info
mattsse Apr 11, 2022
ec66392
Update node/src/config.rs
mattsse Apr 12, 2022
8306222
Update node/src/eth/backend/executor.rs
mattsse Apr 12, 2022
aaf8e91
Update node/src/eth/backend/db.rs
mattsse Apr 12, 2022
def4689
Update node/node-core/Cargo.toml
mattsse Apr 12, 2022
b2a9d9e
Update node/Cargo.toml
mattsse Apr 12, 2022
5bdcd82
Update evm/src/utils.rs
mattsse Apr 12, 2022
cd79216
Update evm/src/utils.rs
mattsse Apr 12, 2022
98909e5
rename to anvil
mattsse Apr 12, 2022
f77df44
refactor: move to separate rpc crate
mattsse Apr 12, 2022
6266d2d
use rlp derive
mattsse Apr 12, 2022
171cc32
misc: cleanup
mattsse Apr 12, 2022
1330940
feat: better account management
mattsse Apr 12, 2022
19ea453
feat: integrate config
mattsse Apr 12, 2022
ea0a356
fix: left overs
mattsse Apr 12, 2022
af26dc3
Merge branch 'master' into matt/node
mattsse Apr 13, 2022
fd4bfca
feat: add standalone anvil cli app
mattsse Apr 13, 2022
26b12c0
chore: add vergen
mattsse Apr 13, 2022
1a4ea9c
meta: add description
mattsse Apr 13, 2022
ca00909
feat: implement topics filter
mattsse Apr 13, 2022
62a58b5
feat: impl ethLogs rpc call
mattsse Apr 13, 2022
e590395
feat: make fork mutable
mattsse Apr 13, 2022
3f227ad
Merge branch 'master' into matt/node
mattsse Apr 14, 2022
b8ae6c9
bump ethers
mattsse Apr 14, 2022
7037d78
feat: add custom rpc bindings
mattsse Apr 14, 2022
31b1a6a
Merge branch 'master' into matt/node
mattsse Apr 14, 2022
cd131e6
refactor: remove node command
mattsse Apr 14, 2022
30eafe4
refactor: make anvil cli
mattsse Apr 14, 2022
8e3ab69
test: add rpc tests
mattsse Apr 14, 2022
2bcfced
fix: sequence encoding
mattsse Apr 14, 2022
e2cd156
feat: add more rpc bindings
mattsse Apr 14, 2022
72d06af
rustmft
mattsse Apr 14, 2022
75f5c8d
fix: make cli compile again
mattsse Apr 14, 2022
b2af4eb
Merge branch 'master' into matt/node
mattsse Apr 15, 2022
2fe997f
refactor: move stuff around
mattsse Apr 15, 2022
13c18d0
feat: make time adjustable
mattsse Apr 15, 2022
d94c8e4
feat: add cheatcode manager
mattsse Apr 15, 2022
c7a0f45
feat: add some cheatcodes
mattsse Apr 15, 2022
307b560
feat: add db override functions
mattsse Apr 15, 2022
130cb8c
feat: add block time cheat codes
mattsse Apr 15, 2022
458897a
refactor: use anvil_ identifier
mattsse Apr 15, 2022
86e2c88
feat: impl gas rpc overrides
mattsse Apr 15, 2022
4e67485
fix: clippy fix
mattsse Apr 15, 2022
2412394
feat: put mining mode in separate miner type
mattsse Apr 15, 2022
3a565d3
docs: more miner docs
mattsse Apr 15, 2022
ca6f81b
feat: add miner access to api object
mattsse Apr 15, 2022
03dad74
feat: add no mining mode
mattsse Apr 15, 2022
bd3c1b0
feat: add mining mode rpc calls
mattsse Apr 15, 2022
2cd2cdf
feat: impl send unsigned transaction
mattsse Apr 15, 2022
3afd2ec
fix: request balance from fork
mattsse Apr 15, 2022
4a73e9c
fix: request nonce from fork
mattsse Apr 15, 2022
54d344f
feat: add access list endpoint
mattsse Apr 16, 2022
c5f953d
fix: always fetch from db
mattsse Apr 16, 2022
933af46
chore: add more traces
mattsse Apr 16, 2022
90e0326
refactor: move fork to backend
mattsse Apr 16, 2022
40eebdb
refact: clean up some things
mattsse Apr 16, 2022
f8a0c05
feat: implement create accesslist
mattsse Apr 16, 2022
811de29
feat: impl tx by block number and idx
mattsse Apr 16, 2022
0cdb909
feat: add new block notifications
mattsse Apr 16, 2022
180a3a4
feat: add fee history service
mattsse Apr 16, 2022
27793b5
refactor: make fee adaptable
mattsse Apr 16, 2022
bade6b0
feat: add storage info type
mattsse Apr 16, 2022
fcfb964
feat: implement FeeHistoryService
mattsse Apr 16, 2022
9d0e4be
feat: configure initial base fee
mattsse Apr 16, 2022
182878b
feat: print base fee
mattsse Apr 16, 2022
5ec31f8
fix: set basefee in eth call
mattsse Apr 16, 2022
1b3d06d
Merge branch 'master' into matt/node
mattsse Apr 18, 2022
ba24012
feat: wake receiver by ref
mattsse Apr 18, 2022
11fbdf3
test: add fork tests
mattsse Apr 18, 2022
1256ca1
fix: eth fee history limit
mattsse Apr 18, 2022
3bedce9
feat: add subscription bindings
mattsse Apr 18, 2022
5c546e1
feat: include tx tracing
mattsse Apr 18, 2022
22cb092
style: use chain id const
mattsse Apr 18, 2022
5072346
feat: add tracing endpoint
mattsse Apr 18, 2022
18a05f1
feat: initial tracing support
mattsse Apr 18, 2022
6ae87c6
refactor: move minedtransaction to storage
mattsse Apr 18, 2022
52e3952
feat: add user faced logging support
mattsse Apr 18, 2022
aac9f71
docs: add logger docs
mattsse Apr 18, 2022
3511249
feat: add test function for config
mattsse Apr 18, 2022
3c49a55
Merge branch 'master' into matt/node
mattsse Apr 19, 2022
a8f9024
feat: abstrat RpcHandler
mattsse Apr 19, 2022
c5de2a6
refactor: extend interface
mattsse Apr 19, 2022
9a75a04
feat: abstract rpc handlers
mattsse Apr 19, 2022
147bab4
feat: refactor anvil server crate
mattsse Apr 19, 2022
58231e6
refactor: cleanup
mattsse Apr 19, 2022
3962a32
feat: impl subscriptions
mattsse Apr 19, 2022
b7bcc9a
feat: proper subscription polling
mattsse Apr 19, 2022
0e0d175
feat: add mining mode change test
mattsse Apr 19, 2022
1f9f377
test: add new blocks pubsub test
mattsse Apr 19, 2022
b7205fa
refactor: some cleanup
mattsse Apr 19, 2022
8d1023b
feat: add more logs
mattsse Apr 20, 2022
41f7c92
test: add logs
mattsse Apr 20, 2022
7c6935b
feat: add status to Calltrace node
mattsse Apr 20, 2022
78e4305
feat: add parity traces
mattsse Apr 20, 2022
a1d5496
feat: add geth trace options
mattsse Apr 20, 2022
012dad5
feat: add tracing support
mattsse Apr 20, 2022
4af0ed8
style: use type alias
mattsse Apr 20, 2022
cf028e5
bump revm
mattsse Apr 20, 2022
8fde0b0
refactor: better type aliases
mattsse Apr 20, 2022
de70110
chore: better logs
mattsse Apr 20, 2022
7990888
chore: better logs
mattsse Apr 20, 2022
9c15a5c
Merge branch 'master' into matt/node
mattsse Apr 20, 2022
d6a23d8
feat: improve gas estimation
mattsse Apr 20, 2022
0645113
feat: improve gas estimation
mattsse Apr 21, 2022
03c8387
test: add log sub test
mattsse Apr 21, 2022
b462f72
chore: rustfmt
mattsse Apr 21, 2022
4a75a49
feat: impl polling filters
mattsse Apr 21, 2022
cbdfb9b
Merge branch 'master' into matt/node
mattsse Apr 21, 2022
bac4190
chore(clippy): make clippy happy
mattsse Apr 21, 2022
18cb4a9
test: add filter tests
mattsse Apr 21, 2022
7cbd097
feat: make filter exit early on unchanged
mattsse Apr 21, 2022
12f01ac
chore: saner defaults
mattsse Apr 21, 2022
555e195
Merge branch 'master' into matt/node
mattsse Apr 22, 2022
cbc6b7d
Merge branch 'master' into matt/node
mattsse Apr 23, 2022
c4d136a
Merge branch 'master' into matt/node
mattsse Apr 23, 2022
4c24ca1
Merge branch 'master' into matt/node
mattsse Apr 25, 2022
be200aa
refactor: simplify crate names
mattsse Apr 25, 2022
5e0f843
feat: add more user output
mattsse Apr 25, 2022
02483a9
feat: add storage caching
mattsse Apr 25, 2022
a12f8fb
feat: support fork reset
mattsse Apr 25, 2022
c7e3945
fix: proper nonce checks
mattsse Apr 25, 2022
f109be6
test: add nonce test
mattsse Apr 25, 2022
dbad660
feat: detect underpriced replacement transactions
mattsse Apr 25, 2022
6f2f095
test: add underpriced transaction tests
mattsse Apr 25, 2022
79d4e3b
fix: make tests not panic
mattsse Apr 25, 2022
60cfb69
Merge branch 'master' into matt/node
mattsse Apr 26, 2022
948dd5e
ci: integrate anvil in foundryup
mattsse Apr 26, 2022
f31f5fe
ci: update release script
mattsse Apr 26, 2022
3124b56
docs: add tx pool details
mattsse Apr 26, 2022
c6b2e2d
chore: enable anvil cmd by default
mattsse Apr 26, 2022
085d3c4
feat: better transaction validation
mattsse Apr 26, 2022
d2013f9
perf: better task dispatch
mattsse Apr 26, 2022
540151e
fix: prevent deadlock during validation
mattsse Apr 26, 2022
21a3f6e
ci: cli feature no longer required
mattsse Apr 26, 2022
f317918
test: disable legacy feature in tests
mattsse Apr 26, 2022
7b00a79
style: geth style errors
mattsse Apr 26, 2022
918e8a8
feat: additional validation checks
mattsse Apr 26, 2022
39801cd
feat: check block gas limit during execution
mattsse Apr 26, 2022
8810451
chore(docs): bump axum
mattsse Apr 26, 2022
7433590
fix: deserialize empty params
mattsse Apr 26, 2022
9d40d28
test: fix failing test
mattsse Apr 26, 2022
929e968
feat: add network id
mattsse Apr 26, 2022
e895f1f
Merge branch 'master' into matt/node
mattsse Apr 26, 2022
09c63fb
feat: add web3* endpoints
mattsse Apr 26, 2022
fedbde7
fix: use different chain id
mattsse Apr 26, 2022
e4ec599
fix: use big endian
mattsse Apr 26, 2022
383565c
Merge branch 'master' into matt/node
mattsse Apr 26, 2022
b4feb9d
style: use hh mnemonic
mattsse Apr 26, 2022
81f005d
fix: update repo link
mattsse Apr 26, 2022
4ccbab9
Merge branch 'master' into matt/node
mattsse Apr 27, 2022
9d9a59b
test: add more gas price tests
mattsse Apr 27, 2022
e281231
feat: metamask support
mattsse Apr 27, 2022
d9e2c90
work on full tx
mattsse Apr 27, 2022
572a7e6
feat: proper block return endpoints
mattsse Apr 27, 2022
6b9b853
chore: more logs
mattsse Apr 27, 2022
c81ffa9
fix: use chain id also in signers doh
mattsse Apr 27, 2022
fabac7f
style: some cleanup
mattsse Apr 27, 2022
6637c03
test: add more api tests
mattsse Apr 27, 2022
b704399
chore: remove patch
mattsse Apr 27, 2022
24691ab
chore(deps): bump ethers
mattsse Apr 27, 2022
28c1c76
Merge branch 'master' into matt/node
mattsse Apr 29, 2022
78b2d9a
feat: add ctrlc handler
mattsse Apr 29, 2022
958728f
Merge branch 'master' into matt/node
mattsse Apr 29, 2022
1be724a
Merge branch 'master' into matt/node
mattsse Apr 29, 2022
969ba88
fix: revert in gas estimate
mattsse Apr 29, 2022
267cec0
chore: be explicit about return type
mattsse Apr 29, 2022
05779ec
fix: failing chain id test
mattsse Apr 29, 2022
9a3596d
feat: introduce ServerConfig
mattsse Apr 29, 2022
e59ac81
feat: add server config type
mattsse Apr 29, 2022
5d57116
Merge branch 'master' into matt/node
mattsse Apr 30, 2022
ff831bd
fix: naming conflict
mattsse Apr 30, 2022
2f5fdf2
Merge branch 'master' into matt/node
mattsse May 2, 2022
40afe99
refactor: rename config builder functions
mattsse May 2, 2022
4fe0a26
feat: add genesis config
mattsse May 2, 2022
1544260
fix: set chain id correctly
mattsse May 2, 2022
0b19909
fix: init empty accountinfo
mattsse May 2, 2022
bb47765
test: add more fork tests
mattsse May 2, 2022
b88c777
feat: add snapshot functions
mattsse May 2, 2022
3691287
feat: implement snapshot revert
mattsse May 2, 2022
e330277
feat: enable snapshotting
mattsse May 2, 2022
ba3b358
test: add revert test
mattsse May 2, 2022
a672281
perf: better default settings
mattsse May 2, 2022
bd84a40
Merge branch 'master' into matt/node
mattsse May 2, 2022
da329b7
Merge branch 'master' into matt/node
mattsse May 3, 2022
8667b17
feat: binary search gas estimation
mattsse May 3, 2022
a05487e
chore: improve trace messages
mattsse May 3, 2022
3398cf5
perf: smarter shutdown
mattsse May 3, 2022
e5d1a19
Merge branch 'master' into matt/node
mattsse May 4, 2022
ce7fad9
fix: use separate chain id function
mattsse May 4, 2022
f272906
feat: add silent option
mattsse May 4, 2022
71a54b9
perf: raise fdlimit
mattsse May 4, 2022
3cd4f47
feat: add hardfork support
mattsse May 4, 2022
34ac68d
fix: return revert in eth_call
mattsse May 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[workspace]
members = [
"anvil",
"anvil/anvil-core",
"anvil/anvil-rpc",
"cast",
"binder",
"cli",
Expand Down
71 changes: 71 additions & 0 deletions anvil/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[package]
name = "anvil"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = """
foundry's local ethereum node
"""

[[bin]]
name = "anvil"
path = "src/anvil.rs"
required-features = ["cli"]

[build-dependencies]
# used to generate constants
vergen = { version = "6.0.0", default-features = false, features = [
"build",
"rustc",
"git",
] }

[dependencies]
# foundry internal
foundry-evm = { path = "../evm" }
anvil-core = { path = "anvil-core" }
anvil-rpc = { path = "anvil-rpc" }
foundry-utils = { path = "../utils" }
foundry-common = { path = "../common", optional = true }
forge = { path = "../forge", optional = true }
foundry-config = { path = "../config", optional = true }

# evm support
bytes = "1.1.0"
ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["ws"] }

# axum related
axum = { version = "0.5", features = ["ws"] }
hyper = "0.14"
tower = "0.4"
tower-http = { version = "0.2", features = ["trace"] }

# tracing
tracing = "0.1.32"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

# async
tokio = { version = "1.10", features = ["time"] }
parking_lot = "0.12"
futures = "0.3"

# misc
serde_json = "1.0.67"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0.30"
colored = "2.0.0"

# cli
clap = { version = "3.0.10", features = [
"derive",
"env",
"wrap_help",
], optional = true }

[dev-dependencies]
ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["abigen", "legacy"] }
tokio = { version = "1.10", features = ["full"] }

[features]
cmd = ["clap", "foundry-config", "foundry-common", "forge"]
cli = ["tokio/full", "cmd"]
18 changes: 18 additions & 0 deletions anvil/anvil-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "anvil-core"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
# foundry internal
foundry-evm = { path = "../../evm" }

ethers-core = { git = "https://github.com/gakonst/ethers-rs", default-features = false }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }

# trie
hash-db = { version = "0.15", default-features = false }
hash256-std-hasher = { version = "0.15", default-features = false }
triehash = { version = "0.8", default-features = false }
Loading