Giter Club home page Giter Club logo

Comments (5)

albertov19 avatar albertov19 commented on August 18, 2024 1

Hey @AsceticBear I think this PR fixed the issue: polkadot-evm/frontier#630 - so I'll close this one

from moonbeam-docs.

albertov19 avatar albertov19 commented on August 18, 2024

Hey @AsceticBear, so according to: https://web3js.readthedocs.io/en/v1.5.2/web3-eth-subscribe.html#subscribe-syncing

...
"data" returns Object: Fires on each incoming sync object as argument.
"changed" returns Object: Fires when the synchronisation is started with true 
...
Object|Boolean - The syncing object, when started it will return true once or when finished it will return false once.

So if it returns empty is because that node is already synced, or there is no state change let's say.

When doing the same against a syncing Geth node the main difference is that the Geth node opens the port for connection, looks for peers and then starts syncing. This provides the necessary state change for it to return the following object:

true
{
  syncing: true,
  status: {
    StartingBlock: 0,
    CurrentBlock: 907507,
    HighestBlock: 0,
    PulledStates: 4503379,
    KnownStates: 4503379
  },
  startingBlock: undefined,
  currentBlock: undefined,
  highestBlock: undefined
}

Once the Geth node is done syncing, it will return a false object like the one shown above for Moonbeam.

from moonbeam-docs.

boundless-forest avatar boundless-forest commented on August 18, 2024

So if it returns empty is because that node is already synced, or there is no state change let's say.
Once the Geth node is done syncing, it will return a false object like the one shown above for Moonbeam.

If I understand correctly when we query sync status to a node that already synced, the expected output should be:

{
  syncing: true,
  status: false,
  startingBlock: undefined,
  currentBlock: undefined,
  highestBlock: undefined
}

However, when I tried to query sync status, the output is hanging after print 0x44546f334c704d6d6e356e4c41727a76. Can you get the output like the doc's show? or my test script is wrong?

from moonbeam-docs.

boundless-forest avatar boundless-forest commented on August 18, 2024

I have tested to set up fresh node to sync already running chain node, then query sync status, the result is empty as well. Perhaps you can try it out if you have are interested.

from moonbeam-docs.

albertov19 avatar albertov19 commented on August 18, 2024

I don't think Substrate nodes to have a initiation phase where the WS endpoint is open so eth_syncing returns a response, and when the actual synchronization starts happening (like on Geth).

When your node is in a syncing state and it is synced it should return false. I've opened an internal ticket as I found that we don't fully follow the behavior I got while reproducing in Geth.

I'll let you know once we have more info

from moonbeam-docs.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.