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

genesis_test: Numerous improvements #227

Merged
merged 9 commits into from
Nov 29, 2022
Merged

Conversation

mitjat
Copy link
Contributor

@mitjat mitjat commented Nov 24, 2022

Speed improvements:

  • Optionally use genesis dump from local file (crucial for faster testing) (see NOTE)
  • Memoize chainId (speeds things up considerably)

Features and bugfixes:

  • check that all node-tracked accounts are present in indexer (we only checked in the other direction before)
  • bugfix: genesis_test: ignore reserved addresses (previously, the test complained because indexer had them and the node didn't)
  • bugfix: interpret NULL values in runtimes table (bug introduced by Strenghten sql constraints #217 which stopped storing literal "none" from the node in the db, storing it instead as NULL. genesis_test wasn't expecting the NULL.)
  • bugfix: fix TestBlocksSanityCheck (just needed to know the genesis round)
  • bugfix: Makefile: start a stopped postgres if present (unrelated to the rest of PR, too small to warrant its own PR)

NOTE: To create a genesis dump at a given height, you have to use a locally compiled oasis-node. The released binary has a bug that ignores the --height flag and snapshots the most recent height instead. Example:

height=8050156; cd ~/oasis/oasis-core && make build-go && time ./go/oasis-node/oasis-node genesis dump --height $height --genesis.file ~/oasis/oasis-indexer/genesis@${height}.json -a unix:/tmp/node.sock

NOTE 2: genesis_test is still BROKEN. 1200 blocks in, the nodes are not tracked correctly. If I run the test at only one block after genesis, the test does pass. To be debugged later.

This is in preparation for parallelization in #179 -- we'll need to sanity-check any changes to processing.

Copy link
Collaborator

@Andrew7234 Andrew7234 left a comment

Choose a reason for hiding this comment

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

Looks good! This should make debugging easier

@mitjat mitjat force-pushed the mitjat/genesis-test-from-file branch from ec887f7 to 8decff3 Compare November 29, 2022 00:03
@mitjat mitjat force-pushed the mitjat/genesis-test-from-file branch from 8decff3 to 6b6dd3a Compare November 29, 2022 01:33
@mitjat mitjat enabled auto-merge November 29, 2022 01:33
@mitjat mitjat merged commit aac10f7 into main Nov 29, 2022
@mitjat mitjat deleted the mitjat/genesis-test-from-file branch November 29, 2022 01:38
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.

2 participants