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

Simulated Backend State Transition Tests Part 1 #1221

Merged
merged 44 commits into from
Jan 6, 2019
Merged

Conversation

rauljordan
Copy link
Contributor

@rauljordan rauljordan commented Jan 2, 2019

This is part of #904


Description

This PR serves as the first instance of using our simulated backend to run YAML tests for pure state transitions of the beacon chain. This PR creates a StateTest category for YAML, and advances a beacon state by N slots given the following configuration:

title: Sample Ethereum Serenity State Transition Tests
summary: Testing state transitions occurring with no blocks being published
test_suite: prysm
fork: tchaikovsky
version: 1.0
test_cases:
  - config:
      publish_blocks: false
      epoch_length: 64
      deposits_for_chain_start: 1000
      num_slots: 32 # Testing advancing state to slot < EpochLength
    results:
      slot: 32
  - config:
      publish_blocks: false
      epoch_length: 64
      deposits_for_chain_start: 16384
      num_slots: 64 # Testing advancing state to exactly slot == EpochLength
    results:
      slot: 64
  - config:
      publish_blocks: false
      epoch_length: 64
      deposits_for_chain_start: 1000
      num_slots: 128 # Testing advancing state's slot == 2*EpochLength
    results:
      slot: 128

This PR only advances the state without including any blocks during each state transition instance.

Steps to Reproduce

go run ./beacon-chain/chaintest/main.go -tests-dir ./beacon-chain/chaintest/tests

@prestonvanloon prestonvanloon self-assigned this Jan 4, 2019
Copy link
Member

@terencechain terencechain 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. No comment

@codecov
Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #1221 into master will increase coverage by 0.09%.
The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
+ Coverage   73.06%   73.15%   +0.09%     
==========================================
  Files          86       85       -1     
  Lines        5825     5797      -28     
==========================================
- Hits         4256     4241      -15     
+ Misses       1221     1214       -7     
+ Partials      348      342       -6

@rauljordan rauljordan merged commit c86bd54 into master Jan 6, 2019
@nisdas nisdas deleted the advance-state branch January 28, 2019 12:05
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