Commit Graph

1702 Commits

Author SHA1 Message Date
Dan Cline ea10f4b4df
fix(core): set `GethInstance` p2p_port in spawn (#1933)
* fix(core): set GethInstance p2p_port in spawn

 * previously, spawning Geth with disabled discovery would not actually
   set the p2p port in the returned GethInstance. This is because it
   would only pass the port to the geth command. If the value started as
   None, it would remain to be None in the GethInstance even though a
   port was passed to the command.
 * adds tests for the existence of ports in GethInstance

* remove rpc port test

* rpc port test doesn't make sense because it will always be set, it is
  not an Option

* use sigterm instead of sigkill

* use sigint instead of sigterm

* run tests in different directories

 * prevents flaky behavior because cargo runs tests in parallel, if the
   default directory were used, each GethInstance would fight for geth's
   file system lock.

* remove nix as a dep

 * sigkill works for now
2022-12-09 09:42:23 -08:00
dependabot[bot] c044dc8287
chore(deps): bump futures-locks from 0.7.0 to 0.7.1 (#1930)
Bumps [futures-locks](https://github.com/asomers/futures-locks) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/asomers/futures-locks/releases)
- [Changelog](https://github.com/asomers/futures-locks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/asomers/futures-locks/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: futures-locks
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 12:31:05 -08:00
joshieDo 92e726921a
chore: add celo chain (#1932)
* add celo chain

* add missing chain case

* clippy & fmt
2022-12-07 21:37:11 -08:00
Matthias Seitz 3dfc04f9fe
chore(clippy): make clippy happy (#1923) 2022-12-05 22:05:33 -08:00
Matthias Seitz 556821f077
chore: generate selector as hex in docs (#1924) 2022-12-05 22:05:24 -08:00
Andrea Simeoni 59dd541f2a
added new line were missing (#1928)
Co-authored-by: Andrea Simeoni <>
2022-12-05 22:05:02 -08:00
Dan Cline 80d887b67e
docs: update MRSV to 1.64 (#1926)
* IntoFuture was implemented in #1826, which means the MSRV should now
   be 1.64
2022-12-05 22:04:48 -08:00
christn c35e6e2fd3
Fix Dead Link to abigen test in README (#1929) 2022-12-05 20:46:00 -08:00
Jared Tokuz a88d2d03e3
refac: change awsSigner to own kmsclient (#1922) 2022-12-02 19:06:06 -08:00
Matthias Seitz f886d379a4
feat: add infura error code to retry detection (#1921) 2022-12-02 13:30:56 -08:00
Andrea Simeoni e5aa4518d7
Docs: Middleware library (#1912)
* Updated the middleware README heading

* fix docs CI

* Added heading description for the main middlewares

* Restructure README examples

* Fix docs CI

* Fix MiddlewareBuilder function docs

* Typos inside the middleware README

Co-authored-by: Andrea Simeoni <>
2022-12-02 12:57:59 -08:00
MouseLess.eth 913f15dc84
fix: remove `OpCode` enum and update `VMOperation`'s `op` field type (#1904)
* remove OpCode enum and update VMOperation's op field

* restore opcodes + update 0x20 to keccak256

* enum to deserialize opcodes into known or unknown

* Update ethers-core/src/types/trace/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* fix typo: ExecutedInstruction

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-12-02 12:51:16 -08:00
dependabot[bot] 4e98c4a5f0
chore(deps): bump syn from 1.0.104 to 1.0.105 (#1918)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.104 to 1.0.105.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.104...1.0.105)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 12:12:50 -08:00
odysseas.eth 3bf9025d2f
feat: impl Serialize for Chain (#1917)
* feat: impl Serialize for Chain

* fix: add deps
2022-12-02 12:12:34 -08:00
James Prestwich d6fea13d23
feature: providererror conversion to middleware error (#1920)
* feature: providererror conversion to middleware error

* chore: update changelog
2022-12-02 12:12:14 -08:00
Dan Cline 5af2800f15
fix(core): always set p2p port in non-dev mode (#1919)
* if geth is in non-dev mode, it has been explicitly set by either
   disabling discovery or setting a p2p port. To prevent geth from
   crashing if another process is using the default p2p port, always set
   the p2p port if geth is in non-dev mode.
2022-12-02 12:11:31 -08:00
Andrea Simeoni c4e09f261e
Fix: handle panic on Ws error (#1915)
* On Ws error close all active subscriptions and force clients to reconnect. the Websocket.

* Comment typos

* Unit tests
Lint
cargo +nightly fmt

* - Added CHANGELOG entry
- Added `#` prefix to issue IDs where missing

* ownership typo

Co-authored-by: Andrea Simeoni <>
2022-12-01 11:00:10 -08:00
Matthias Seitz 0ce6b107d6
fix: make version detection infallible (#1916) 2022-12-01 06:14:51 -08:00
Dan Cline 4b685621ed
feat(providers): add a subset of admin namespace (#1880)
* tell Geth to expose the admin namespace

* wip: add admin namespace support

 * add networking and peer related structs

* add rest of chain config fields

* add datadir to geth

* fix data dir ref

* add dev flag to geth

* set dev only if block_time is not set

* put mutually exclusive options in an enum

* make block_time use the devmode enum

* add p2p port to geth

* add basic impls for admin endpoints

* move from_int_or_hex to ethers-core utils

* fix nodeinfo protocol field

 * the type is better represented by a struct which can have either eth
   or snap

* add chain id and discovery toggle for Geth

* remove PeerEvent

 * should re-add when peer event endpoints are implemented

* simplify serde options for admin responses

* change signature for peer modification apis

 * these admin apis accept an enode, which _may_ be an enr, but could
   also be a legacy enode "v4" url.

* add note on where `ChainConfig` fields come from

* add note on PeerInfo about the source of fields

* add admin namespace support to CHANGELOG

* update pr number in changelog

* cargo fmt

* move chainconfig to genesis in utils

* accept genesis file in geth

* add genesis writing to geth spawn

* finally get geth nodes to connect

* import io::Read in provider tests

* fix PeerInfo and use enode id for provider test

* make clippy happy

* improve documentation for genesis module

* remove not(wasm) attributes on genesis module

* remove debugging printlns

* remove io::Read from provider tests

* add failing post merge test case

* add full mainnet nodeinfo for testing

* support deserializing json bignums to U256

 * the serde_json arbitrary_precision feature is necessary so the
   serde_json::Number variant of `IntOrHexOrBigNum` can be converted
   into a string and fed into U256::from_dec_string

* fix from_int_or_hex_opt doc string

* remove third variant from IntOrHex

 * unnecessary since serde_json::Number handles smaller ints as well

* add comments for ids

* fix enode id type in admin_peers provider test

* fix admin typo in Cargo.toml

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* add method to wait on a gethinstance adding a peer

* fix dial loop and wait_to_add_peer doc comments

* update geth

 * the build can be updated by changing the GETH_BUILD env var

* wait for geth to exit on drop

* remove unnecessary wait

* fix mid-handshake PeerInfo deserialization

* remove println

* make tests less flaky

* handle discovery with the rest of the non dev opts

* dump geth stderr to debug failing ci test

 * add method which dumps the unread stderr of the geth instance into a
   string

* remove call_raw debug println

 * bug is due to authrpc endpoint being in use

* use unused port when authrpc port is not specified

* remove dump_stderr from GethInstance

 * did not work properly anyways

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-30 13:22:44 -08:00
DaniPopes 2d793edc94
fix(contract): multicall decode error (#1907)
* wip

* use empty bytes for reverts

* minor improvements

* fix test

* use is_empty

* docs

* clippy

* fix: rust-analyzer bug

* revert rename
2022-11-30 13:20:22 -08:00
dependabot[bot] bbe53bfa2a
chore(deps): bump tokio-tungstenite from 0.17.2 to 0.18.0 (#1908)
Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) from 0.17.2 to 0.18.0.
- [Release notes](https://github.com/snapview/tokio-tungstenite/releases)
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.17.2...v0.18.0)

---
updated-dependencies:
- dependency-name: tokio-tungstenite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 13:20:04 -08:00
DaniPopes 866d30593a
feat(core): Chain impls and refactoring (#1909)
* sort

* derive Default

* use u64 for conversions and add impl

* one impl block and comments
2022-11-30 13:19:05 -08:00
Matthias Seitz 17addcfd91
fix(abigen): rm wrong brackets (#1914) 2022-11-30 13:14:40 -08:00
MouseLess.eth 82f19e0789
fix: txpool_inspect unable to parse contract creations (#1905)
* Fixes #1899

* replace match with if let some() else

* fix error: number too large to fit in target type

* Apply suggestions from code review

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2022-11-29 13:18:18 -08:00
Matthias Seitz d48187ac0d
feat(provider): check for serde error with missing req id (#1910) 2022-11-29 07:48:58 -08:00
dependabot[bot] 79e64a8378
chore(deps): bump chrono from 0.4.20 to 0.4.23 (#1900)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.20 to 0.4.23.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.20...v0.4.23)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:20:56 -08:00
dependabot[bot] 4d5e032129
chore(deps): bump syn from 1.0.103 to 1.0.104 (#1901)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.103...1.0.104)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:20:47 -08:00
Andrea Simeoni 16ab3d5820
Feat middleware stack builder (#1890)
* ProviderBuilder struct + docs

* README

* Docs typos

* Removed useless Arc
Rename module

* Unit tests

* cargo +nightly fmt

* CHANGELOG

* CHANGELOG typo

* ci: fix docs job

* review: Removed Option<M>. Builder functions directly consume self.

* feat: `with_signer` builder function

* feat: `nonce_manager` builder function

* feat: `gas_oracle` builder function

* Unit tests

* Docs

* fix: cargo +nightly fmt

* Update ethers-middleware/src/builder.rs

Typo

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* Builder functions provided as a trait
Update docs
Update tests

* cargo +nightly fmt

* CHANGELOG

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-28 12:16:21 -08:00
Georgios Konstantopoulos ed47eaadad chore: pin env-logger 2022-11-27 12:32:57 -08:00
Georgios Konstantopoulos f2ebb16372 (cargo-release) version 1.0.2 2022-11-27 12:27:58 -08:00
Georgios Konstantopoulos 93b2723d74 (cargo-release) version 1.0.2 2022-11-27 12:27:58 -08:00
Georgios Konstantopoulos 3e29aaa82d (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 71e2727ae3 (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos f6f150ca28 (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 78e89f8efa (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 8034fd0e91 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos c627765871 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos 4a70dc5614 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos 758a0e5b6e (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos e993d4c953 (cargo-release) version 1.0.2 2022-11-27 12:27:55 -08:00
Georgios Konstantopoulos 1b495dd143 (cargo-release) version 1.0.2 2022-11-27 12:27:55 -08:00
DaniPopes 97eecaf03b
fix(core): format_units overflow (#1894)
* fix(core): format_units overflow

* fix: formatting

* remove dbg

* add comment and rerun ci

* tests

* fix test

* refactor: move magic nums to consts

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-27 12:27:27 -08:00
Andrea Simeoni b0ef1343dd
fix: close example subscriptions after 2 emitted items (#1892)
cargo +nightly fmt

Co-authored-by: Andrea Simeoni <>
2022-11-26 08:42:41 -08:00
dependabot[bot] 585280f29c
chore(deps): bump env_logger from 0.9.3 to 0.10.0 (#1891)
Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.9.3 to 0.10.0.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.9.3...v0.10.0)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-25 13:10:09 -08:00
Matthias Seitz c542844424
fix: handle non existing Cargo.toml edge case (#1886) 2022-11-23 07:35:55 -08:00
Matthias Seitz 84f896f47b
chore(clippy): make clippy happy (#1888) 2022-11-23 07:35:38 -08:00
dependabot[bot] c17c0c3c95
chore(deps): bump cargo_metadata from 0.15.1 to 0.15.2 (#1878)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.15.1 to 0.15.2.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/v0.15.1...v0.15.2)

---
updated-dependencies:
- dependency-name: cargo_metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-22 13:16:56 -08:00
dependabot[bot] fa96f4ef10
chore(deps): bump serde-aux from 4.1.0 to 4.1.2 (#1874)
Bumps [serde-aux](https://github.com/vityafx/serde-aux) from 4.1.0 to 4.1.2.
- [Release notes](https://github.com/vityafx/serde-aux/releases)
- [Commits](https://github.com/vityafx/serde-aux/commits)

---
updated-dependencies:
- dependency-name: serde-aux
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-22 13:16:48 -08:00
dependabot[bot] 3e7f307cd2
chore(deps): bump rayon from 1.5.3 to 1.6.0 (#1875)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.3...rayon-core-v1.6.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-22 13:16:37 -08:00
Noah Citron fa0ce0c750
feat: retry client wasm support (#1877)
* wasm support for retry client

* fix conection err check

* fix lockfile

* remove unused comment
2022-11-22 13:16:23 -08:00