Commit Graph

387 Commits

Author SHA1 Message Date
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
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
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
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
jannikluhn 9969b12252
fix: transaction type in TxpoolContent (#1844)
TxpoolContent used a custom type for the transactions inside of it.
This type was missing some fields that the current JSON RPC API
provides. Now it uses the standard transaction type which is able to
hold all provided fields.

Fixes: #1843

Co-authored-by: Jannik Luhn <jannik.luhn@posteo.de>
2022-11-08 15:06:58 -08:00
Matthias Seitz 2418098d8c
feat: add TraceError enum (#1814) 2022-11-07 15:47:32 -08:00
DaniPopes fb88215a87
fix: rustdoc errors (#1808)
* fix: rustdoc warnings

* fix: partially re-run abigen for multicall_contract

* fix

* fix test

* fix: rustdoc nightly warnings
2022-11-07 15:43:23 -08:00
DaniPopes debd6fec3d
chore: clippy (#1812)
* chore: clippy

* fmt
2022-11-07 15:43:11 -08:00
Matthias Seitz 1119976dc7
chore: rename xdai gnosis (#1809)
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-07 15:24:10 -08:00
halo3mic ba9aa7838b
Fixes: #1822 (#1823)
* Fixes: #1822

* Fixes: gakonst#1822 :: update1

* Fixes: #1822 :: Add ParseOverflow err & rm rust_decimals from ethers-core

* update changelog
2022-11-07 12:28:43 -08:00
halo3mic 9797e9a83b
Fixes: #1836 (#1837) 2022-11-07 12:25:57 -08:00
Alejandro Banzas 50c7ff1d8e
adding chiado support (#1811) 2022-10-31 09:01:34 -07:00
Georgios Konstantopoulos 3d9c3290d4
release: switch to apache fastrlp (#1803)
* release: switch to apache fastrlp

https://github.com/gakonst/open-fastrlp

* s/fastrlp/open_fastrlp
2022-10-23 11:44:48 -07:00
Matthias Seitz a9dd53da81
fix(solc): emit empty node vec (#1793) 2022-10-17 10:27:42 -07:00
Salman Pathan 98cea53c38
add safe and finalized tag to BlockNumber (#1792)
* add safe and finalized  tag to BlockNumber

* update test
2022-10-17 06:59:41 -07:00
Matthias Seitz 1b8d1e3d99
chore: reexport BigEndianHash (#1789) 2022-10-17 06:50:56 -07:00
Dan Cline a07581489a
feat(core): re-export H128 (#1786)
* feat(core): re-export H128

* chore: cargo fmt
2022-10-14 19:53:38 -07:00
Matthias Seitz 676f039230
chore(clippy): make clippy happy (#1778) 2022-10-11 10:49:05 -07:00
Dan Cline 123e2def9d
Fix Transaction decoding (#1773)
* fix(core): accept both typed transaction formats

* fix equality sign for rlp type check

* remove printlns

* remove redundant transaction_type assignment
2022-10-08 22:39:05 -07:00
Saurabh 0c2abf9d7f
feat: added more ethereum units (#1760) 2022-10-03 11:22:55 -07:00
jaeaster f3a5a7aef0
Fix: Drop anvil stdout (#1759) 2022-10-01 08:51:51 -07:00
DaniPopes d2c9db5ae9
fix(core, etherscan): RawAbi and Abi (#1757) 2022-09-29 11:15:04 -07:00
Matthias Seitz fac31f631c
fix: support eip712 domain chain ids as string (#1756)
* fix: support eip712 domain chain ids as string

* chore: add rustfmt.toml
2022-09-29 08:05:36 -07:00
Matthias Seitz 5929f9825f
chore: rm unwrap (#1744) 2022-09-27 11:35:11 -07:00
Matthias Seitz 354fb956a7
fix: transaction object rlp decoding (#1740) 2022-09-26 10:33:41 -07:00
Matthias Seitz 7e8a5a2e94
fix: use correct tx field const (#1735) 2022-09-25 11:11:16 -07:00
Matthias Seitz 924705a2da
chore: format polygon-mumbai as mumbai (#1737) 2022-09-25 11:10:13 -07:00
Matthias Seitz 75d7f45231
fix: legacy signed rlp decoding (#1733) 2022-09-24 12:45:50 -07:00
Matthias Seitz d655d22125
feat: add arbitrum-goerli (#1734) 2022-09-24 12:39:35 -07:00
DaniPopes 733c5d3dfd
fix(contract): relax Middleware trait bound for getters (#1728)
* wip

* fix(contract): relax Middleware trait bound for getters

* chore: clippy

* move

* fix: multicall
2022-09-23 17:32:24 -07:00
Matthias Seitz afdab2a555
chore: support fuji alias (#1723) 2022-09-20 10:07:31 -07:00
DaniPopes db75e3628e
feat(core): add utility methods to NameOrAddress (#1720)
* feat: NameOrAddress impls

* feat: add to_addr to TypedTransaction

* fix: use NameOrAddress for ens

* chore: clippy

* dont clone
2022-09-19 10:51:04 -07:00
Wias Liaw 1e83b86233
feat(ethers-core): double anvil startup time (#1702)
* feat(ethers-core): double anvil startup time

* feat(ethers-core): add timeout utils

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-09-18 08:50:12 -07:00
Luke Tchang e034a8f979
docs: add comment about safety of u8 -> u64 cast in signature (#1704)
* docs: add comment about u8 -> u64 cast in signature

* fix: format

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-09-18 08:45:33 -07:00
Alexey Shekhirin 78e406b261
fix(core): GethTrace shouldn't have 0x prefix for return_value (#1705) 2022-09-15 17:18:08 -07:00
Matthias Seitz 5a18059b14
fix: geth structlog memory (#1690) 2022-09-12 14:32:01 -07:00
Matthias Seitz 162e0de27a
chore: inherit stderr (#1689) 2022-09-11 14:42:57 -07:00
Georgios Konstantopoulos fe72eb5f49 chore(core): remove unused import 2022-09-10 11:17:02 -07:00
Robin Molen-Grigull c9c22f4dfa
fix: geth trace types (#1682)
* fix: geth trace types

* update: changelog entry added
2022-09-09 16:20:25 -07:00
DaniPopes 26e74dd9cc
fix(core): add derives, impls for Units (#1683)
* fix(core): add derives, impls for Units

* feat: add some more unit aliases

* remove separators

* feat: add more impl

* chore: run clippy
2022-09-09 16:19:12 -07:00
Matthias Seitz 0e7f46b03d
feat(abigen): subsitute structs in event bindings (#1674)
* fix(abigen): handle event defaults

* feat(abigen): subsitute structs in event bindings

* update changelog

* chore: rustfmt

* fix broken tests

* chore(clippy): make clippy happy
2022-09-07 09:14:13 -07:00
Noah Citron a052ff8bd4
fix: legacy transaction rlp decoding (#1672)
* fix legacy tx rlp decoding

* add test for type 0 tx in 2718 envelopes

* update changelog

* refactor

* fmt
2022-09-06 09:08:05 -07:00
Noah Citron 744d5c055e
fix: incorrect encoding on TransactionReceipt (#1661)
* fix TransactionReceipt rlp encoding

* add tests

* update changelog
2022-09-04 10:59:53 -07:00
Clifton King de90662725
feat(core): improved debug format for Bytes (#1658)
* feat(core): improved debug format for Bytes

* update changelog
2022-09-04 10:58:06 -07:00
Matthias Seitz 6a86d4ff22
chore(clippy): make clippy happy (#1659) 2022-09-04 10:57:52 -07:00
Matthias Seitz 9bcbc6c1c8
chore: match standalone mumbai for chain (#1656) 2022-09-04 10:56:24 -07:00
Matthias Seitz 5aac82a3d7
fix: emit null transaction fields (#1654) 2022-09-04 10:55:29 -07:00
Danilo Tuler ea8bcd11be
feat: add support for Optimism Goerli (#1641) 2022-08-30 09:45:43 -07:00
Matthias Seitz 792d415845
fix: set chain id explicitly (#1647) 2022-08-30 09:45:36 -07:00
Matthias Seitz 0b04ffe787
feat: add uint8 type (#1639)
* feat: add uint8 type

* update changelog

* derive default

* fix: failing test
2022-08-28 12:17:48 -07:00
Marcelo Fornet 6c017990a1
nit: Explicitly handle all chains on match (#1635) 2022-08-25 09:09:45 -07:00
Alexey Shekhirin f3da435081
feat(core): more derives for geth trace structs (#1637)
* feat(core): more derives for geth trace structs

* derive Eq as well
2022-08-25 09:08:48 -07:00
Jacob ff66008cbe
Fix 'get_transactions' response. (#1632)
* Fix 'get_transactions' response.

* Add some explanation to GenesisOption.

* One-line-ifying

* Update changelog
2022-08-23 09:17:00 -07:00
Matthias Seitz b302ac05be
fix: dont skip null to field (#1631) 2022-08-23 09:15:29 -07:00
Alexey Shekhirin 7c26550064
fix(core): clarify Geth trace structs (#1626)
* fix(core): clarify Geth trace structs

* add geth references

* add fields matching to geth
2022-08-22 09:48:02 -07:00
Matthias Seitz 8abb9d86e2
fix: extend eth_syncing response type and serde (#1624) 2022-08-20 15:30:53 -07:00
Matthias Seitz 4f6ccf70b3
feat: add events function to set multiple event filter (#1607) 2022-08-19 08:20:44 -07:00
Matthias Seitz 3681099af3
fix: support formatting large units (#1608) 2022-08-19 08:19:16 -07:00
Matthias Seitz 2083841200
chore: make proof response fields pub (#1612) 2022-08-19 08:18:48 -07:00
Nicolas Gotchac 1bb8fae4c1
fix(ethers-core): Deserialize a Filter request with `topics == null` (#1604)
* fix(ethers-core): Deserialize a Filter request with `topics == null`

* Update ethers-core/src/types/filter.rs

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

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-08-17 14:14:42 -07:00
wren 9e48cbcb55
feat(TraceType+PartialEq): added PartialEq to TraceType (#1586)
* feat(TraceType+PartialEq): added PartialEq to TraceType

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

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

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-08-11 10:28:11 -07:00
wren 9d80d69503
feat(TraceType+Deserialize): added Deserialize to TraceType (#1585) 2022-08-10 13:08:35 -07:00
Matthias Seitz 922b23fad6
feat: add etherscan urls function (#1582) 2022-08-09 14:50:18 -07:00
Matthias Seitz 79e59eaffd
chore: skip none trace error (#1577) 2022-08-08 13:02:11 -07:00
Matthias Seitz 3040edf2ad
feat: add ProviderExt trait (#1559) 2022-08-03 09:21:55 -07:00
Matthias Seitz 71933f0d33
feat(abi): add missing str abi trait impls (#1554) 2022-08-03 09:19:33 -07:00
Matthias Seitz 550d2d86ef
chore: seal extension traits (#1553)
* chore: seal extension traits

* chore: fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-08-02 15:28:02 -07:00
Matthias Seitz eb8cee0d2f
fix: use correct moonbeam (#1552) 2022-08-02 14:32:20 -07:00
Matthias Seitz 27a184db45
feat: add EthError trait and derive (#1549)
* feat: add EthError trait and derive

* update changelog
2022-08-02 11:03:52 -07:00
Matthias Seitz c75608eda1
ci: rm pinned nightly (#1541)
* ci: rm pinned nightly

* chore(clippy): make clippy happy
2022-07-31 19:00:31 -07:00
Matthias Seitz bad81a90d6
fix: add missing moonbase fromstr (#1531) 2022-07-30 12:42:16 -07:00
Marcelo Fornet c7563a5f64
Add support to Aurora network (#1535)
* Add support to Aurora network

Documentation about aurora chain:
https://doc.aurora.dev/getting-started/network-endpoints

* Update changelog

* Format code using rustfmt.toml
2022-07-30 12:42:04 -07:00
Matthias Seitz 81a2a5ed68
fix(etherscan): support stringified numbers in response (#1524)
* fix(etherscan): support stringified numbers in response

* feat: add helper function

* improve string parsing

* chore(clippy): make clippy happy
2022-07-28 11:06:56 -07:00
Matthias Seitz 2a14e5510d
chore(clippy): make clippy happy (#1525) 2022-07-28 11:06:15 -07:00
Matthias Seitz 61821cc665
fix: make compatible with edition2018 (#1522) 2022-07-27 14:36:21 -07:00
Matthias Seitz 3d76ce816a
feat: add support for EIP-712 typed data (#1510)
* feat: add support for typeddata

* change eip712 trait

* feat: impl eip712 trait

* chore(clippy): make clippy  happy

* better numeric parsing

* fix: fix a bunch of encoding bugs

* Update ethers-core/Cargo.toml

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-27 13:56:02 -07:00
Matthias Seitz 77033a9acd
fix: deserialize sealfields with default (#1520)
* test: add block deserialize test null sealfields

* fix: use default or non helper
2022-07-27 13:38:42 -07:00
Matthias Seitz 6b713958d1
feat: bump abi/token tuple limit (#1506) 2022-07-26 08:27:19 -07:00
wren cb7e586645
feat(debug_traceTransaction): initial commit (#1469)
* feat(debug_traceTransaction): initial commit

* chore(changelog): updated changelog

* feat(debug_traceTransaction): type adjusments

* feat(debug_traceTransaction): type adjusments

* Update ethers-providers/src/provider.rs

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

* Update ethers-providers/src/provider.rs

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

* chore(format): cargo +nightly fmt

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-24 14:46:38 -07:00
Matthias Seitz a5c326162a
fix: use correct model for txpool_content endpoint (#1501)
* fix: use correct model for txpool_content endpoint

* chore: update CHANGELOG

* update failing tests

* Update ethers-providers/tests/txpool.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-24 03:21:09 +02:00
Matthias Seitz a958b4fd28
fix(eip712): improve argument parsing (#1485)
* fix(eip712): improve argument parsing

* use reexported serde_json

* chore: rustfmt

* fix: add missing salt
2022-07-20 00:09:11 -07:00
Matthias Seitz 1d4f3efe8a
chore: add Anvil::at and anvil example (#1486) 2022-07-20 00:08:25 -07:00
Matthias Seitz ba00f549dd
fix: parse constructor as function (#1479)
* fix: parse constructor as function

* parse constructor separatly
2022-07-14 12:15:15 -07:00
sea-edge 7566c3d71e
For fix test code, Added morden to chainid as a Mock-like value. (#1472) 2022-07-10 14:28:39 -07:00
Matthias Seitz 1ff4be74f9
feat: add --fork-block-number setter for anvil bindings (#1468) 2022-07-09 15:19:57 -07:00
Matthias Seitz 0b88e4246d
deps: bump crypto deps (#1465) 2022-07-06 14:11:23 -07:00
Dan Cline bc9d4b48b6
impl fastrlp traits for AccessList (#1456)
* impl fastrlp traits for AccessListItem
 * impl Hash for AccessListItem
 * impl Hash for AccessList
2022-07-06 11:44:07 -07:00
Dan Cline b232afaabc
Implement fastrlp traits for Bytes (#1443)
* implement fastrlp traits for Bytes

* cargo fmt

* bump fastrlp to 0.1.2
2022-07-04 11:47:00 -07:00
Dan Cline c077a633c1
impl fastrlp traits for Signature (#1444) 2022-07-04 11:13:30 -07:00
Matthias Seitz 1992c9176a
feat(core): impl Ord for receipt (#1434) 2022-06-30 09:20:33 -07:00