Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End-to-end testing of the oracle example #32

Open
SetarehGhorshi opened this issue Oct 23, 2024 · 2 comments
Open

End-to-end testing of the oracle example #32

SetarehGhorshi opened this issue Oct 23, 2024 · 2 comments

Comments

@SetarehGhorshi
Copy link

SetarehGhorshi commented Oct 23, 2024

Hello.

I have been trying to perform an end-to-end test of the oracle example. For this purpose, I tried running two instances of it on the same machine using the provided command but with different ports.
My first issue was that the two instance were not discovering each other. I was able to fix it by manually sending a ping from one to the other in the discovery process. With this, the connection was established between the two nodes but the OracleConnection which listens to the messages passed between the nodes did not start (This poll did not start).
Based on the logs, there is no Established event received from the proto_events ( according to this part), which based on my understanding means that the into_connection() function has not been called (which is implemented here). And this seems to be the reason for OracleConnection not starting.
I tried with different options for the chain such as mainnet and dev. Also tried with the --dev flag. But still was not able to perform a full test due to the mentioned issue.
I am not sure where the issue comes from so I really appreciate it if there are any instructions for running an end-to-end test of the oracle example.
Also, I was wondering if there is any way so we can run reth on the forked state of holesky for testing?

Thanks.

@SetarehGhorshi
Copy link
Author

@loocapro I appreciate any help you can provide with this.

@loocapro
Copy link
Contributor

Hi @SetarehGhorshi ,

It seems that your two nodes did not actually connect. When nodes successfully connect, they should emit an Established event.

Also, I was wondering if there is any way so we can run reth on the forked state of holesky for testing?

You can run it with this command:

cargo run --bin oracle node --chain holesky \
--debug.tip "0x4d2d4aca1d5d0a69b1a2c75e0e5d8b3185f62f247145aa85199195742966b1dc" \
--http --http.addr 0.0.0.0 --http.port 8545 --http.api eth

Don't forget to set the P2P ports and any other arguments you might need.

Then wait until it syncs to that block hash. It’s one of the first block hashes that actually contains transactions, but if you don’t specifically need it, you can use an earlier block. The sync should take around 10 minutes.

Thanks for this! It’s really useful, and I’ll also try it on my end.

By the way, if you're comfortable with it, you could point this repo to a local Reth workspace for easier debugging. You can achieve this by using Cargo’s local path dependencies, like so:

# In your Cargo.toml
[dependencies]
reth = { path = "../path/to/local/reth" }
# add other reth crates here

This way, you’ll be able to make and test changes locally in the Reth workspace without needing to push or publish them first.

Feel free to message me on Telegram with your findings — I’m curious! TG handle: loocapro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants