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

fix: refresh readonly mem-pool when receives new mem-block #721

Conversation

jjyr
Copy link
Collaborator

@jjyr jjyr commented Jun 8, 2022

The Readonly node should not do it's own computation when the mem-pool reset, instead, the node should always wait for the full node to publish a new mem-block state, and then to sync with that state.

In this PR:

  1. Fix the inconsistent state of readonly node by stop doing reset in the MemPool#reset function.
  2. ReadOnly node cleans the mem-pool state when receives a new mem-block from fullnode.
  3. Fix filter_withdrawals, prevent removing the follow-up withdrawals from a same sender.

Note: The web3-indexer should subscribe the readonly node API to keep consistent state.

@jjyr jjyr requested review from Flouse, blckngm and zeroqn June 8, 2022 06:26
crates/mem-pool/src/pool.rs Outdated Show resolved Hide resolved
@gw-bot

This comment was marked as outdated.

@jjyr jjyr marked this pull request as ready for review June 13, 2022 05:58
@jjyr jjyr requested a review from blckngm June 13, 2022 06:01
@gw-bot

This comment was marked as outdated.

@jjyr jjyr force-pushed the fix-refresh-readonly-mem-pool-when-receives-mem-block branch from 51efa81 to cbf9ede Compare June 13, 2022 06:38
@gw-bot

This comment was marked as outdated.

@blckngm

This comment was marked as outdated.

@blckngm

This comment was marked as outdated.

@blckngm

This comment was marked as outdated.

@gw-bot

This comment was marked as outdated.

blckngm
blckngm previously approved these changes Jun 13, 2022
@gw-bot
Copy link

gw-bot bot commented Jun 13, 2022

Running integration test

Workflow Run Id: 2486855470

Components:

Manually running integration test

Post a comment contains

/itest
[prebuilds: tag]
[godwoken: branch/ref]
[scripts: branch/ref]
[polyjuice: branch/ref]
[web3: branch/ref]
[kicker: branch/ref]
[tests: branch/ref]

Note: [] means optional, for example

/itest
prebuilds: dev-202203280240
godwoken: develop
scripts: 81676d9d53ffdf5bbaa60483928d07da16eb4a88
polyjuice: e37553b9

Run Result

failure

Run Result

failure

zeroqn
zeroqn previously approved these changes Jun 13, 2022
@Flouse
Copy link
Collaborator

Flouse commented Jun 13, 2022

/itest

@gw-bot
Copy link

gw-bot bot commented Jun 13, 2022

Running integration test

Workflow Run Id: 2487384420

Components:

Manually running integration test

Post a comment contains

/itest
[prebuilds: tag]
[godwoken: branch/ref]
[scripts: branch/ref]
[polyjuice: branch/ref]
[web3: branch/ref]
[kicker: branch/ref]
[tests: branch/ref]

Note: [] means optional, for example

/itest
prebuilds: dev-202203280240
godwoken: develop
scripts: 81676d9d53ffdf5bbaa60483928d07da16eb4a88
polyjuice: e37553b9

Run Result

success

@blckngm
Copy link
Contributor

blckngm commented Jun 13, 2022

/itest
godwoken: a6ec0d9
kicker: bdc8b31163b03b80ededfb5a0b52ed1bde28eb40

@gw-bot
Copy link

gw-bot bot commented Jun 13, 2022

Running integration test

Workflow Run Id: 2487571599

Components:

Manually running integration test

Post a comment contains

/itest
[prebuilds: tag]
[godwoken: branch/ref]
[scripts: branch/ref]
[polyjuice: branch/ref]
[web3: branch/ref]
[kicker: branch/ref]
[tests: branch/ref]

Note: [] means optional, for example

/itest
prebuilds: dev-202203280240
godwoken: develop
scripts: 81676d9d53ffdf5bbaa60483928d07da16eb4a88
polyjuice: e37553b9

Run Result

success

Flouse
Flouse previously approved these changes Jun 13, 2022
@gw-bot

This comment was marked as off-topic.

@jjyr jjyr dismissed stale reviews from Flouse, zeroqn, and blckngm via 416a971 June 13, 2022 12:20
@jjyr jjyr force-pushed the fix-refresh-readonly-mem-pool-when-receives-mem-block branch from cbf9ede to 416a971 Compare June 13, 2022 12:20
@gw-bot

This comment was marked as off-topic.

@gw-bot

This comment was marked as off-topic.

@gw-bot

This comment was marked as off-topic.

@jjyr
Copy link
Collaborator Author

jjyr commented Jun 13, 2022

/itest
kicker: bdc8b31163b03b80ededfb5a0b52ed1bde28eb40

@gw-bot
Copy link

gw-bot bot commented Jun 13, 2022

Running integration test

Workflow Run Id: 2488391108

Components:

Manually running integration test

Post a comment contains

/itest
[prebuilds: tag]
[godwoken: branch/ref]
[scripts: branch/ref]
[polyjuice: branch/ref]
[web3: branch/ref]
[kicker: branch/ref]
[tests: branch/ref]

Note: [] means optional, for example

/itest
prebuilds: dev-202203280240
godwoken: develop
scripts: 81676d9d53ffdf5bbaa60483928d07da16eb4a88
polyjuice: e37553b9

Run Result

success

@jjyr jjyr requested review from Flouse, zeroqn and blckngm June 13, 2022 12:40
Flouse added a commit to Flouse/godwoken-docker-prebuilds that referenced this pull request Jun 14, 2022
@jjyr jjyr merged commit 7336780 into godwokenrises:develop Jun 14, 2022
@jjyr jjyr deleted the fix-refresh-readonly-mem-pool-when-receives-mem-block branch June 14, 2022 03:20
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.

4 participants