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

Add rate limiting to the Ethereum event oracle #463

Merged

Conversation

james-chf
Copy link
Contributor

@james-chf james-chf commented Sep 9, 2022

(this PR was split out from #253)

Closes #464

This PR has the oracle back off a bit after having gotten the latest block from the Ethereum JSON-RPC endpoint being used, otherwise we call the Ethereum RPC endpoint very fast over and over. Also adding some extra logging, so we can see what the latest block height is.

2022-08-04T12:56:01.158995Z  WARN namada_apps::node::ledger::ethereum_node::oracle::oracle_process: 
Couldn't get the latest Ethereum block height, will keep trying
error=FailedToSend(Connect(Io(Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })))
2022-08-04T12:53:54.587542Z DEBUG namada_apps::node::ledger::ethereum_node::oracle::oracle_process:
Got latest Ethereum block height latest_block=Uint256(7345457)

(we could expand the backoff strategy in later PRs but adding these small 1-second sleeps solves the immediate issue)

@james-chf james-chf changed the base branch from main to eth-bridge-integration September 9, 2022 11:59
@james-chf james-chf force-pushed the james/ethbridge/oracle-rate-limiting branch 3 times, most recently from 8b1c14e to f46a324 Compare September 22, 2022 12:34
@james-chf james-chf changed the base branch from eth-bridge-integration to james/ethbridge/optional-geth September 23, 2022 12:43
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from ef55fb6 to 777d8bb Compare September 23, 2022 12:44
@james-chf james-chf force-pushed the james/ethbridge/oracle-rate-limiting branch from f46a324 to 9a5ddf4 Compare September 23, 2022 12:52
@james-chf james-chf force-pushed the james/ethbridge/oracle-rate-limiting branch from 9a5ddf4 to fd9c4c0 Compare September 23, 2022 13:01
@james-chf james-chf marked this pull request as ready for review September 23, 2022 13:02
@sug0 sug0 merged commit 190bf02 into james/ethbridge/optional-geth Sep 26, 2022
@sug0 sug0 deleted the james/ethbridge/oracle-rate-limiting branch September 26, 2022 08:42
@james-chf
Copy link
Contributor Author

As this PR got merged into #253 , it will merge with that

phy-chain pushed a commit to phy-chain/namada that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants