Skip to content

feat(op-acceptance-tests): flashblocks streaming acceptance-tests #16349

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yashvardhan-kukreja
Copy link
Contributor

@yashvardhan-kukreja yashvardhan-kukreja commented Jun 10, 2025

Signed-off-by: Yashvardhan Kukreja [email protected]

Description

This acceptance-test:

  • Goes through every rbuilder and parses its associated conductor
  • If that conductor is a non-leader (follower), it establishes a websocket connection to the rbuilder asserting no production of flashblocks from there
  • If that conductor is a leader, it establishes a websocket connection to the rbuilder asserting the production of flashblocks from it.
  • The flashblocks production is inspected for 5s expecting a total of 17 flashblocks streamed atleast. This number is derived from the expectation of getting flashblocks generated at a 250ms rate (20 flashblocks in 5s) with a tolerance of 3 blocks being slow/dropped (20-3 = 17)

Tests

  1. Generate the devnet file via netchef
export MANIFEST=$HOME/OPLabs/Projects/devnets/alphanets/interop-flash/manifest.yaml               
export INVENTORY=$HOME/OPLabs/Projects/devnets/alphanets/interop-flash/inventory.yaml
export DEPLOYER_STATE=$HOME/OPLabs/Projects/devnets/alphanets/interop-flash/op-deployer/state.json
export K8S_REPO=$HOME/OPLabs/Projects/k8s 
cd /path/to/infrastructure-services
cd netchef
just build
./bin/netchef generate --manifest $MANIFEST --inventory $INVENTORY --deployer-state $DEPLOYER_STATE --k8s-dir $K8S_REPO devnet-env

Say the devnet env is generated at /Users/ykukreja/OPLabs/Projects/infrastructure-services/netchef/devnet-tmp/devnet-env.json

  1. Point to that devnet env and run these acceptance tests
cd /path/to/optimism
cd op-acceptance-tests
cd tests/flashblocks && \
DEVSTACK_ORCHESTRATOR=sysext \
DEVNET_ENV_URL="/Users/ykukreja/OPLabs/Projects/infrastructure-services/netchef/devnet-tmp/devnet-env.json" \
go test -v -timeout=5m0s -run=TestFlashblocksStream

Here's how it worked on my end

image image

Related Issue

@yashvardhan-kukreja yashvardhan-kukreja requested a review from a team as a code owner June 10, 2025 06:48
@yashvardhan-kukreja yashvardhan-kukreja requested review from bitwiseguy and removed request for a team June 10, 2025 06:48
Comment on lines +1 to +3
//go:build !ci

// use a tag prefixed with "!". Such tag ensures that the default behaviour of this test would be to be built/run even when the go toolchain (go test) doesn't specify any tag filter.
Copy link
Contributor

Choose a reason for hiding this comment

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

huh?

Copy link
Contributor Author

@yashvardhan-kukreja yashvardhan-kukreja Jun 10, 2025

Choose a reason for hiding this comment

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

Currently, sysgo as well as Kurtosis don't implement Flashblocks.
So CI would fail.

So, if you notice the make go-test-ci and make go-test-ci-short Makefile targets, you'll see both of them ending with -tags="ci" which makes them run test in files either with //go:build ci or no mention any //go:build.

By introducing //go:build !ci in this file (along with base/conductor/leadership_transfer_test.go), we're skipping the tests in these files to be run by make go-test-ci / make go-test-ci-short.

Also, //go:build !ci means that when those make targets don't specify any tag filter (-tags="ci"), then the default nature of these test files with //go:build !ci would be to run as opposed to getting skipped when they're target without ! like //go:build foo or //go:build ci

Hope that makes sense.

Base automatically changed from yash/flashblocks-gate-and-devstack-building-blocks to develop June 12, 2025 05:33
@circleci-checks circleci-checks bot requested a review from a team as a code owner June 12, 2025 05:33
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