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

route websocket proxy traffics to different destinations #119

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

taokayan
Copy link
Contributor

@taokayan taokayan commented Nov 20, 2023

Resolves #91

add web3_rpc_test_endpoint in config
add miner_rpc_endpoint in config
add whitelist_methods in config
always group all requests in a batch to send to either rpc endpoint or rpc test endpoint.
reduce frequency of get eos lib
add minmum (180) size in this.reversible_blocks as protection in case of evm-rpc is out of sync with leap endpoint

Copy link
Contributor

@elmato elmato left a comment

Choose a reason for hiding this comment

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

@taokayan looks like this PR is forking from a commit that is not including

eos-evm-ws-proxy blockmonitor: Fix fork handling

@taokayan taokayan requested a review from elmato November 21, 2023 09:04
Comment on lines 133 to 141
if( found_next_block == true ) {
while(this.reversible_blocks.length > 1024) { // protection of memory grow in case leap rpc not working
this.remove_front_block();
}

if( found_next_block == true && this.reversible_blocks.length > 180 + 30) { // reduce frequency of calling get_evm_lib
const evm_lib = await this.get_evm_lib();
while(this.reversible_blocks.length > 0 && this.reversible_blocks.peek().number < evm_lib) {
// keep at least 180 blocks in case evm-node is out of sync with leap
while(this.reversible_blocks.length > 180 && this.reversible_blocks.peek().number < evm_lib) {
this.remove_front_block();
Copy link
Contributor

Choose a reason for hiding this comment

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

In case we are on a minority fork, we will be having different behaviors from the client perspective based on how long the fork takes to solve (since we will be removing reversible blocks from our queue)
Are we ok with this?

@taokayan taokayan requested a review from elmato November 23, 2023 07:42
@taokayan taokayan merged commit 61085a8 into main Nov 24, 2023
5 of 6 checks passed
@taokayan taokayan deleted the kayan_ws_dest branch November 24, 2023 07:10
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

Successfully merging this pull request may close these issues.

Configure websocket proxy to route methods to appropriate destination
2 participants