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

Save invalid blocks in optimist database #814

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

daveroga
Copy link
Contributor

@daveroga daveroga commented Jul 14, 2022

Fixes: #813

We will store information about invalid blocks in optimist and the type of challenge they generate:

  • Created collection invalid_blocks in optimist.
  • invalid_blocks will store this information when an invalid block is detected:
    • invalidCode
    • invalidMessage
    • block data
  • Fixed adversary test check balances when calling npm run adversary-test-all

@daveroga daveroga self-assigned this Jul 14, 2022
@druiz0992
Copy link
Contributor

Do we store address of challenger?

@daveroga
Copy link
Contributor Author

daveroga commented Jul 15, 2022

Do we store address of challenger?

We store the invalid block once it is produced and detected by optimist. At this time we don't know the challenger that will pick the challenge.
I could investigate if I can get the challenger from the emit Rollback detected from the Challenges contract in the optimist, but the sender is not passed now in the event. We could pass it in the Rollback event to know the challenger and then store it in the invalid block stored previously in the optimist database.

Copy link
Contributor

@israelboudoux israelboudoux left a comment

Choose a reason for hiding this comment

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

LGTM

@druiz0992
Copy link
Contributor

@daveroga it would be would if we could get the challenger address for statistics

@druiz0992 druiz0992 merged commit d2b760d into master Jul 20, 2022
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.

Allow Optimist to store invalid blocks info
3 participants