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

Removed on-chain events are not removed from database #561

Open
darcher-framework opened this issue Dec 31, 2020 · 0 comments
Open

Removed on-chain events are not removed from database #561

darcher-framework opened this issue Dec 31, 2020 · 0 comments

Comments

@darcher-framework
Copy link

Description

Smart contract events like submitting a new proposal or voting can be removed due to chain reorganization.
However, in the periodical syncing task with blockchain, the DApp does not consider and handle the case when a previous emitted event is then removed.

This bug affects various functionalities including submitting new proposal, voting, processing a proposal and so on.

Reproduce Steps

One reproduce example is given below.

  1. submit a new proposal by sending a transaction
  2. mine a block and execute the transaction
  3. at this time, the DApp has noticed the new proposal event and add it to database
  4. chain reorganization happens, where the previous event is removed
  5. the proposal record is still in Database and is shown to users.
  6. Then if the user tries to vote, it will get the error, which means the proposal does not exist and the vote transaction will always fail.
    image

Expected Behaviour

The events removed by chain reorganization should also be removed from database of DApp, making the DApp consistent with data stored in smart contracts.

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

1 participant