-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove possibility of conflict between --web3provider and --http-web3provider #5826
Comments
Hello @handelaar2 ! Thanks for the report, asking for clarity here, but what is the issue you'd like to see solved? The flag dependency on eachother matching? Or better UX in terms of setting the flags to ensure they match eachother? |
@0xKiwi See the relevant convo here: |
I see! So solving this would be making a |
@0xKiwi That was indeed what Nishant called a good suggestion. We would have two port parameters but only one web3provider IP address. This way the prysm "eth1-code" would not be confused having "input" from two sources. It would however not solve my problem which is: using Nethermind as my local eth1-node. (Hopefully they prioritize development of web socket subscriptions). In their discord however people write: @nisdas Anything from your side to add? @tkstanczak Tomasz, care to comment about websocket subscriptions for Nethermind? |
A subscription based api makes code cleaner and easier to write for. The alternative would be polling based apis, which would require a rewrite of portions of our eth1 code. Do you have the reasons stated out for why subscription methods are bad here? |
For context, my recommendation to not use The short version of the problem is that if you assume the backend node can disappear at any moment (and then come back later, or you get load balanced to a different node), you cannot rely on witnessing every block/log addition and removal necessary to correctly maintain whatever client-side chain state you are maintaining. The library linked above solves this by maintaining a some number of blocks in-memory client-side, and making sure that it always has a clear chain forward and backwards (during a reorg) before notifying the client of an addition/removal. If you just use I don't know anything about this project, but I do recommend against anyone using FWIW: This came up because Augur used Infura as its backend early on and when you talk to Infura you aren't talking to a single Ethereum node, you are talking to a load balancer that is backed by many nodes. These nodes may be out of sync with each other, which makes the "missed notification" problem actually pretty common. However, even if you are using a single backing Ethereum node, the missed notifications can occur if that node has an outage (even a very brief one). |
So if you ask me what would solve all issues: switch to HTTP RPC endpoint only. #2299 was a good start ;-)) but we also need HTTP RPC for fetching future logs.
Just my 2 cents. |
It's not as easy as setting a different port. Providers like infura have an entirely different connection URL between websockets and json-rpc. |
Looking at our code and what we have in our What we have now is a bit handwavy, where we basically look at the current head block , and request all logs from @prysmaticlabs/core-team what do you guys think ? |
I am in favor of removing websockets requirement in Prysm. We don't need on real time events in ETH1 given that we are only supposed to be looking at blocks that are at least 1024 older than the head of ETH1. Removing websockets eases infrastructure requirements, code complexity, and potential failure vectors. @nisdas is this something you are interested in working on? If not, I can delegate or work on it myself. |
I don't have the immediate bandwidth right now to work on it, so its fine if you want to take this on right now or delegate it @prestonvanloon |
@prestonvanloon I might be able to help. |
@alonmuroch yes exactly. There is some functionality that needs to be rewritten. I wouldn't call this a trivial issue, but seems like something you could do. Let me know if I can assign to you |
@prestonvanloon I'll give it a go. |
@rauljordan @prestonvanloon this issue is still open? should I take a look at it or the PR attached takes care of it? |
@alonmuroch I believe Raul is working on this in #6055. |
馃悶 Bug Report
Description
There are 2 parameters for pointing to an Eth1-node: --web3provider and --http-web3provider
However these parameters cannot be used "independently".
Only populating one parameter (say --http-web3provider ) and omit the other defaults that one to goerli.prylabs.net.
Having two eth1 sources seems to lead to conflicting data and the beacon log start showing errors:
[2020-05-12 08:16:29] ERROR powchain: Unable to process past logs Could not process deposit log: could not get correct merkle index: latest index observed is not accurate, wanted 30928, but received 3090
The local (Nethermind) Eth1-node is also suffering from this conflict and is bombarded with RPC/http eth_logs-calls, as the conflicting data is causing a loop.
In other words, -web3provider and --http-web3provider have to point to the same eth1-node so there is only one source of eth1 data.
@nisdas confirmed that any mixing here would be the cause of the error message and the looping.
If this is indeed a restriction of the current eth1-code, the web3-parameters should be defined accordingly:
--web3provider =>ip address only
--web3_ws-port
--web3_http-port
Has this worked before in a previous version?
n/a
Yes, the previous version in which this bug was not present was: ....馃敩 Minimal Reproduction
Use Nethermind as local eth1 node. Run the beacon node with "only" the http parameter. That is causing the above (looping) error. Adding the ws-parameter is not possible. Nethermind does not support websocket subscriptions. So activating parameter --web3provider (ws) gives the following error messages (both in Nethermind and in beacon-node):
So leaving the ws-parameter out:
-local_node=>http
-goerli.prylabs.net=>ws
This is causing the RPC loops.
From a user perspective: there is no error/warning message in the beacon that setting only one parameter is actually not possible.
馃敟 Error
馃實 Your Environment
Operating System:
What version of Prysm are you running? (Which release)
Anything else relevant (validator index / public key)?
I think it is important to reduce the dependency on goerli.prylabs.net for eth1 data. Any obstacle or unclarity of using a local eth1-node should be removed.
The text was updated successfully, but these errors were encountered: