Commit Graph

1689 Commits

Author SHA1 Message Date
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
dependabot[bot] 6b5f130ba2
chore(deps): bump bytes from 1.2.1 to 1.3.0 (#1879)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/commits)

---
updated-dependencies:
- dependency-name: bytes
  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:15:45 -08:00
Andrea Simeoni 845aa4920f
feat: Instantiate an event builder without a contract instance (#1882)
* Build an `Event` without requiring a contract instance

* Contract unit test

* Function to set Event address

* Example

* Typo to improve readability

* CHANGELOG

* cargo +nightly fmt

* FIX conflict

* review: applied Address alias

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-22 13:15:36 -08:00
Matthias Seitz f4b6178332
chore: add missing ParseUnit impls (#1885) 2022-11-22 13:08:23 -08:00
Matthias Seitz 49dc487676
feat: add another rate limit retry check (#1881) 2022-11-22 13:08:04 -08:00
Matthias Seitz 616bd92cc4
fix: mock ethers mod layout (#1884) 2022-11-22 13:07:51 -08:00
Andrea Simeoni f3eee4cf3f
Get gas price in USD using a Chainlink oracle (#1872)
Co-authored-by: Andrea Simeoni <>
2022-11-20 12:39:14 -08:00
Dave Belvedere 95d6567adc
chore: bump trezor, fix clippy (#1871)
* chore: bump trezor, fix clippy

* update cargo lock

Co-authored-by: Dave Belvedere <dave@protonmail.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-20 12:38:41 -08:00
Georgios Konstantopoulos f829bd6876 chore: bump open-fastrlp 2022-11-18 12:01:07 -08:00
Will Smith 9d75e5f178
Fix: use cwd manifest (#1869)
* fix(abigen): make compatible with older rust versions

* Update ethers-contract/ethers-contract-abigen/src/multi.rs

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

* fix: linting

* fix(abigen): use active cargo.toml over crate cargo.toml

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 11:23:10 -08:00
dependabot[bot] f5da30d23b
chore(deps): bump ethabi from 17.2.0 to 18.0.0 (#1865)
* chore(deps): bump ethabi from 17.2.0 to 18.0.0

Bumps [ethabi](https://github.com/rust-ethereum/ethabi) from 17.2.0 to 18.0.0.
- [Release notes](https://github.com/rust-ethereum/ethabi/releases)
- [Changelog](https://github.com/rust-ethereum/ethabi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-ethereum/ethabi/compare/v17.2.0...v18.0.0)

---
updated-dependencies:
- dependency-name: ethabi
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* chore: bump open-fastrlp

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-17 11:17:22 -08:00
Will Smith a525659f5d
fix(abigen): make compatible with older rust versions (#1868)
* fix(abigen): make compatible with older rust versions

* Update ethers-contract/ethers-contract-abigen/src/multi.rs

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

* fix: linting

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 10:43:41 -08:00
dependabot[bot] 0e51835a33
chore(deps): bump reqwest from 0.11.12 to 0.11.13 (#1866)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.12 to 0.11.13.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.12...v0.11.13)

---
updated-dependencies:
- dependency-name: reqwest
  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-16 20:40:09 -08:00
Dave Belvedere 29fb49b712
Rust already exists on the platform - update it instead (#1864)
Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-16 16:03:15 -08:00