Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

add eth_syncing RPC #848

Merged
merged 4 commits into from
Feb 1, 2022
Merged

add eth_syncing RPC #848

merged 4 commits into from
Feb 1, 2022

Conversation

rakita
Copy link
Contributor

@rakita rakita commented Jan 31, 2022

Add eth_syncing endpoint: https://eth.wiki/json-rpc/API#eth_syncing

Tested it with infure and return false successfully, don't have any syncing node to check return when it is syncing.

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum SyncingStatus {
IsFalse(bool),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a note on how this works? not clear to me what IsFalse(false) vs IsFalse(true) means?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added comments, but IsFalse(true) is not possible to happen by eth spec. wdyt about adding an additional struct, first for deserialization and second for returning to library call?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh as in the commit you pushed does not work? yeah I'm OK with adding an intermediate non-public datatype that helps with the desert and then having the "simple" enum.

Copy link
Contributor Author

@rakita rakita Feb 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea i made mistake with that commit, now it should work as expected (tested it with infure when return is false). Can you check it again if it is okay, I embedded intermediate type inside function.

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gg

@gakonst gakonst merged commit 24e7c47 into gakonst:master Feb 1, 2022
@rakita rakita deleted the eth_syncing branch February 1, 2022 11:38
mattsse pushed a commit to mattsse/ethers-rs that referenced this pull request Feb 2, 2022
* add eth_syncing RPC

* Changelo updated

* small comments

* Intermediate SyncingStatus
gakonst added a commit that referenced this pull request Feb 4, 2022
)

* chore: clippy

* refactor: rewrite compiler passes and cache

* feat: more work on compile pipeline

* feat: add cache constructor

* add artifact filtering

* fine tune api

* feat: prepare version integration

* docs: more docs

* feat: add cacheentry2

* replace cacheentry types

* integrate new api

* docs: more docs

* feat: implement new output handler

* feat: integrate cached files in new compile pipeline

* refactor: more cache refactor

* docs: more docs

* feat: add source name mapping

* feat: implement new parallel solc

* refactor: do a little cleanup

* refactor: even more cleanup

* even more cleanup

* chore: make it compile

* chore: make it compile with all features

* chore: clippy fix

* feat: integrate new compiler pipeline

* docs: more docs

* refactor: move stuff around

* refactor: start deprecating output type

* chore: make it compile again

* chore(deps): bump solc version 0.2.0

* feat: unify output types

* cargo fix

* refactor: add contracts wrapper

* chore: replace ProjectCompileOutput

* docs: add more docs

* feat: add offline mode

* feat: more artifact helpers

* chore: cleanup cache

* chore: streamline types

* fix: better artifacts mapping

* chore: some cleanup

* chore: change artifact

* chore: add configure solc fn

* feat: add artifact reading

* feat: implement retain and extend

* feat: add cache extending

* feat: write to disk

* chore: make clippy happy

* feat: implement path mapping

* chore: nits

* feat: introduce states

* feat: add compiler state machine

* chore: move cache types to cache mod

* chore: make clippy happy

* feat: add debug derives

* fix: use resolved import source unit names

* fix: failing tests

* test: test multiple libs properly

* chore: make clippy happy

* chore: update CHANGELOG

* fix: doc tests

* fix: set offline mode correctly

* chore: make it compile again

* Update ethers-solc/src/artifacts.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: find remappings by default

* typos

* add eth_syncing RPC (#848)

* add eth_syncing RPC

* Changelo updated

* small comments

* Intermediate SyncingStatus

* fix(core): adjust Ganache for new cli output (#851)

* fix: review comments

* fix: cache relative path bug

* chore: add cache example

* chore: use absolute paths

* fix: remove overwritten files from cache

* fix: rustfmt

* chore: more helper functions

* chore: export AggregatedOutput

* feat: implement helper functions

* feat: even more helpers

* fix: failing doc tests

* refactor: remove source name map tracking

* fix: determine artifacts in ephemeral mode

* refactor: allowed paths should not fail

Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: rakita <[email protected]>
Co-authored-by: wolflo <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants