Commit Graph

537 Commits

Author SHA1 Message Date
dependabot[bot] 5a4646f292
chore(deps): bump num_enum from 0.5.7 to 0.5.8 (#2035)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/illicitonion/num_enum/releases)
- [Commits](https://github.com/illicitonion/num_enum/commits/0.5.8)

---
updated-dependencies:
- dependency-name: num_enum
  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>
2023-01-11 19:32:49 -08:00
DaniPopes b4b153a364
perf(utils): avoid unnecessary allocations (#2046)
* perf(utils): avoid unnecessary allocations

* docs: add more to_checksum information

* docs

* use address
2023-01-11 19:20:35 -08:00
joshieDo 3c65997eae
feat(core): add `strum::EnumIter` and `strum::EnumCount` to `Chain` (#2043)
* add strum EnumIter and EnumCount to Chain

* clippy
2023-01-11 19:17:46 -08:00
Matthias Seitz 01d3e4310f
feat: support parsing bytecode from evm object (#2024) 2023-01-07 16:22:07 +02:00
DaniPopes 2aa7bc3b99
chore(core): alias&export error as ParseChainError (#2022)
* chore(core): alias&export error as ParseChainError

`pub use TryFromPrimitiveError as ParseChainError`
for backwards compatibility

* fix: comment

* fully alias
2023-01-07 11:14:25 +02:00
Chris Cordle c684220144
feat: Add arbitrum nova api and chain id 42170 (#2020)
* Add arbitrum nova api and chain id

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-06 11:32:54 +02:00
WillQ 4a8a6ad259
abigen adopt hardhat generated bytecode (#2012)
* abigen adopt hardhat generated bytecode

* update changelog
2023-01-05 11:46:32 +02:00
Dan Cline c0e607da1e
feat(providers): support personal account apis (#2009)
* feat(providers): add personal key mgmt rpcs

 * add personal_importRawKey and personal_unlockAccount

* expose geth personal api

* do not prefix with 0x

* serialize privkey as string

* add allow-insecure-unlock option to Geth
2023-01-04 23:35:44 +02:00
Dan Cline 9147ee8e63
feat(core): add ability to take geth stderr (#2010)
* makes the geth logs accessible by using take() on the GethInstance
   stderr
2023-01-04 23:31:48 +02:00
Dan Cline 5f2476510b
feat(providers): add mining related apis (#2008)
* feat(providers): add miner_start endpoint

* add other mining related apis

 * add eth_mining
 * add miner_stop

* expose Geth miner rpc api
2023-01-04 23:30:03 +02:00
DaniPopes 97582cc346
feat(core, contract): improve `determine_ethers_crates` (#1988)
* refactor: determine_ethers_crates

* feat: improve crate resolution

* export new types and functions

* export

* fix: file name check

* fix: invert condition and check CARGO_MANIFEST_DIR

* use abigen macro to generate multicall

* chore: rm debug

* rm unnecessary .replace

* chore: clippy

* chore: clippy

* Revert "chore: clippy"

This reverts commit bd220f308d.

* Revert "chore: clippy"

This reverts commit 5550f4e856.

* add tests

* better tests, docs

* add another test

* fix docs

* refactor: add an environment struct for determining ethers crates

* fix: use fmt::Debug to escape paths

* docs: rename and rm old docs

* feat: use global path for crates

* fix: docs

* chore: move rand impl to tests mod
2023-01-03 15:11:57 +02:00
Dan Cline 228f9607fe
feat(core): expose all genesis related structs (#1975) 2022-12-30 14:48:47 +02:00
DaniPopes d272318483
chore: update all rust editions to 2021 (#1979) 2022-12-30 14:48:29 +02:00
dependabot[bot] a42cc9f63f
chore(deps): bump once_cell from 1.16.0 to 1.17.0 (#1987)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: once_cell
  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-12-30 14:43:05 +02:00
Georgios Konstantopoulos 48dbbbd829 chore: clippy 2022-12-30 14:18:58 +02:00
dependabot[bot] ea6d058bbc
chore(deps): bump proc-macro2 from 1.0.47 to 1.0.49 (#1951)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.47 to 1.0.49.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.47...1.0.49)

---
updated-dependencies:
- dependency-name: proc-macro2
  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-25 13:53:32 +02:00
Vid Kersic b27c7b0773
feat: debug_traceCall (#1949)
* feat: debug_traceCall

* chore: update changelog

* fix: rebase to master and change tracer from string to enum
2022-12-25 13:33:05 +02:00
dependabot[bot] 6bb5abb2fd
chore(deps): bump syn from 1.0.105 to 1.0.107 (#1953) 2022-12-22 21:00:10 +02:00
DaniPopes e007ea01b1
feat(core): chain macros and impls (#1958) 2022-12-22 14:44:51 +02:00
Dan Cline 6efa7ca85f
fix(core): decode to correctly in Transaction (#1946)
* would not correctly decode a create transaction because 0x80 was not
   properly decoded
2022-12-18 13:40:43 +02:00
Matthias Seitz e86183e935
feat: make geth executable configurable (#1947)
* feat: make geth executable configurable

* Update ethers-core/src/utils/geth.rs

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>

* Update ethers-core/src/utils/geth.rs

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
2022-12-18 13:33:40 +02:00
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
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
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
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
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
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 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
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
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
Georgios Konstantopoulos c627765871 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -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
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] 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
Matthias Seitz f4b6178332
chore: add missing ParseUnit impls (#1885) 2022-11-22 13:08:23 -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
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
Dave Belvedere a0fb1bf196
I256 parse support (#1863)
* Added support for I256 in format_units. Added two complement support for I256.

* Add I256 support into parse_units

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-16 16:03:07 -08:00
MouseLess.eth 936cecc3ad
Add `op` field to `VMOperation` to determine executed opcode (#1858)
* created opcode enum and added to VMOperation. Fixes #1857

* rebuild trace logs to include missing fields

* opcode descriptions for docs + changelog

* restore traces and indent trace

* opcode 0x20 should be SHA3
2022-11-15 11:36:52 -08:00
Dave Belvedere 5ae0a848c7
I256 asr doc (#1860)
* Update I256 documentation to call out diversions from standard numeric types on the right shift operator

* Update changelog

* Address review comment. Link changelog notes to PR

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-15 11:33:54 -08:00
Matthias Seitz cba6f071ae
chore(clippy): make clippy happy (#1856) 2022-11-13 07:49:27 -05:00
Dan Cline 17050afd04
fix(core): stop decoding gas twice for 2930 txs (#1850)
* fix(core): stop decoding gas twice for 2930 txs

 * adds two tests from #1848

* remove debugging printlns

* replace call to dbg! with txhash assert
2022-11-10 12:21:32 -08:00
DaniPopes 64a70cfd57
fix: failing CI (#1847)
* fix gasprice

* fmt

* docs

* fix examples typo

* fix examples

* clippy
2022-11-09 08:09:03 -08:00
Dave Belvedere 5c9a048f73
Add Arithmetic Shift Left operation for I256. Minor update to the ASR tests to include coverage for a shift of 0, and move to 'I256::minus_one' over 'I256::from(-1i8)' syntax (#1452)
Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-08 16:10:53 -08:00