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

BLOCKHASH tests #1683

Open
OlivierBBB opened this issue Jan 7, 2025 · 1 comment
Open

BLOCKHASH tests #1683

OlivierBBB opened this issue Jan 7, 2025 · 1 comment
Assignees
Labels

Comments

@OlivierBBB
Copy link
Collaborator

We require tests for BLOCKHASH testing certain limiting + multiblock behaviour. Two blocks ought to be enough.

Multi block tests

Block becomes available

// Block 1: execute
NUMBER
BLOCKHASH

// Block 2: execute
PUSH1 1
NUMBER
SUB
BLOCKHASH

Block no longer available

// Block no longer available
// Block 1: execute
PUSH2 256
NUMBER
SUB
BLOCKHASH

// Block 2: execute
PUSH2 257
NUMBER
SUB
BLOCKHASH

Mono block tests

We maintain the tests written by @letypequividelespoubelles for the single block stuff. We add to it (I don't know how) tests around conflations containing the Genesis block.

@lorenzogentile404
Copy link
Collaborator

lorenzogentile404 commented Jan 9, 2025

By substituting DEFAULT_BLOCK_NUMBER with 0, we can achieve tests for the genesis block. Thus, we nee to make that constant a parameter that can be set when we run the tests:

public class ToyExecutionEnvironmentV2 {
  ...
  private static final long DEFAULT_BLOCK_NUMBER = 6678980;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants