Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions testing/spectest/general/deneb/kzg/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "small",
srcs = ["verify_blob_kzg_proof_batch_test.go"],
data = [
"@consensus_spec_tests_general//:test_data",
],
tags = ["spectest"],
deps = [
"//beacon-chain/blockchain/kzg:go_default_library",
"//proto/prysm/v1alpha1:go_default_library",
"//testing/require:go_default_library",
"//testing/spectest/utils:go_default_library",
"//testing/util:go_default_library",
"@com_github_ghodss_yaml//:go_default_library",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package kzg

import (
"encoding/hex"
"path"
"testing"

"github.com/ghodss/yaml"
kzgPrysm "github.com/prysmaticlabs/prysm/v4/beacon-chain/blockchain/kzg"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v4/testing/require"
"github.com/prysmaticlabs/prysm/v4/testing/spectest/utils"
"github.com/prysmaticlabs/prysm/v4/testing/util"
)

type KZGTestDataInput struct {
Blobs []string `json:"blobs"`
Commitments []string `json:"commitments"`
Proofs []string `json:"proofs"`
}

type KZGTestData struct {
Input KZGTestDataInput `json:"input"`
Output bool `json:"output"`
}

func TestVerifyBlobKZGProofBatch(t *testing.T) {
require.NoError(t, kzgPrysm.Start())
testFolders, testFolderPath := utils.TestFolders(t, "general", "deneb", "kzg/verify_blob_kzg_proof_batch/small")
if len(testFolders) == 0 {
t.Fatalf("No test folders found for %s/%s/%s", "general", "deneb", "kzg/verify_blob_kzg_proof_batch/small")
}
for _, folder := range testFolders {
t.Run(folder.Name(), func(t *testing.T) {
file, err := util.BazelFileBytes(path.Join(testFolderPath, folder.Name(), "data.yaml"))
require.NoError(t, err)
test := &KZGTestData{}
require.NoError(t, yaml.Unmarshal(file, test))
var sidecars []*ethpb.BlobSidecar
blobs := test.Input.Blobs
commitments := test.Input.Commitments
proofs := test.Input.Proofs
if len(proofs) != len(blobs) {
require.Equal(t, false, test.Output)
return
}
var kzgs [][]byte
// Need separate loops to test length checks in
// `IsDataAvailable`
for i, blob := range blobs {
blobBytes, err := hex.DecodeString(blob[2:])
require.NoError(t, err)
proofBytes, err := hex.DecodeString(proofs[i][2:])
require.NoError(t, err)
sidecar := &ethpb.BlobSidecar{
Blob: blobBytes,
KzgProof: proofBytes,
}
sidecars = append(sidecars, sidecar)
}
for _, commitment := range commitments {
commitmentBytes, err := hex.DecodeString(commitment[2:])
require.NoError(t, err)
kzgs = append(kzgs, commitmentBytes)
}
if test.Output {
require.NoError(t, kzgPrysm.IsDataAvailable(kzgs, sidecars))
} else {
require.NotNil(t, kzgPrysm.IsDataAvailable(kzgs, sidecars))
}
})
}
}
25 changes: 25 additions & 0 deletions testing/spectest/mainnet/deneb/epoch_processing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "small",
srcs = [
"effective_balance_updates_test.go",
"eth1_data_reset_test.go",
"historical_summaries_update_test.go",
"inactivity_updates_test.go",
"justification_and_finalization_test.go",
"participation_flag_updates_test.go",
"randao_mixes_reset_test.go",
"registry_updates_test.go",
"rewards_and_penalties_test.go",
"slashings_reset_test.go",
"slashings_test.go",
],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
shard_count = 4,
tags = ["spectest"],
deps = ["//testing/spectest/shared/deneb/epoch_processing:go_default_library"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) {
epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_Eth1DataReset(t *testing.T) {
epoch_processing.RunEth1DataResetTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_HistoricalSummariesUpdate(t *testing.T) {
epoch_processing.RunHistoricalSummariesUpdateTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_InactivityUpdates(t *testing.T) {
epoch_processing.RunInactivityUpdatesTest(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_JustificationAndFinalization(t *testing.T) {
epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_ParticipationFlag(t *testing.T) {
epoch_processing.RunParticipationFlagUpdatesTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_RandaoMixesReset(t *testing.T) {
epoch_processing.RunRandaoMixesResetTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_ResetRegistryUpdates(t *testing.T) {
epoch_processing.RunRegistryUpdatesTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_RewardsAndPenalties(t *testing.T) {
epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_SlashingsReset(t *testing.T) {
epoch_processing.RunSlashingsResetTests(t, "mainnet")
}
11 changes: 11 additions & 0 deletions testing/spectest/mainnet/deneb/epoch_processing/slashings_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package epoch_processing

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/epoch_processing"
)

func TestMainnet_Deneb_EpochProcessing_Slashings(t *testing.T) {
epoch_processing.RunSlashingsTests(t, "mainnet")
}
14 changes: 14 additions & 0 deletions testing/spectest/mainnet/deneb/finality/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "medium",
timeout = "short",
srcs = ["finality_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
shard_count = 4,
tags = ["spectest"],
deps = ["//testing/spectest/shared/deneb/finality:go_default_library"],
)
11 changes: 11 additions & 0 deletions testing/spectest/mainnet/deneb/finality/finality_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package finality

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/finality"
)

func TestMainnet_Deneb_Finality(t *testing.T) {
finality.RunFinalityTest(t, "mainnet")
}
13 changes: 13 additions & 0 deletions testing/spectest/mainnet/deneb/fork_helper/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "small",
srcs = ["upgrade_to_deneb_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
shard_count = 4,
tags = ["spectest"],
deps = ["//testing/spectest/shared/deneb/fork:go_default_library"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fork_helper

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/fork"
)

func TestMainnet_UpgradeToDeneb(t *testing.T) {
fork.RunUpgradeToDeneb(t, "mainnet")
}
12 changes: 12 additions & 0 deletions testing/spectest/mainnet/deneb/fork_transition/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "small",
srcs = ["transition_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
tags = ["spectest"],
deps = ["//testing/spectest/shared/deneb/fork:go_default_library"],
)
11 changes: 11 additions & 0 deletions testing/spectest/mainnet/deneb/fork_transition/transition_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package fork_transition

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/fork"
)

func TestMainnet_Deneb_Transition(t *testing.T) {
fork.RunForkTransitionTest(t, "mainnet")
}
16 changes: 16 additions & 0 deletions testing/spectest/mainnet/deneb/forkchoice/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "enormous",
timeout = "short",
srcs = ["forkchoice_test.go"],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
tags = ["spectest"],
deps = [
"//runtime/version:go_default_library",
"//testing/spectest/shared/common/forkchoice:go_default_library",
],
)
12 changes: 12 additions & 0 deletions testing/spectest/mainnet/deneb/forkchoice/forkchoice_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package forkchoice

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/runtime/version"
"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/common/forkchoice"
)

func TestMainnet_Deneb_Forkchoice(t *testing.T) {
forkchoice.Run(t, "mainnet", version.Deneb)
}
24 changes: 24 additions & 0 deletions testing/spectest/mainnet/deneb/operations/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
load("@prysm//tools/go:def.bzl", "go_test")

go_test(
name = "go_default_test",
size = "small",
srcs = [
"attestation_test.go",
"attester_slashing_test.go",
"block_header_test.go",
"bls_to_execution_change_test.go",
"deposit_test.go",
"execution_payload_test.go",
"proposer_slashing_test.go",
"sync_committee_test.go",
"voluntary_exit_test.go",
"withdrawals_test.go",
],
data = glob(["*.yaml"]) + [
"@consensus_spec_tests_mainnet//:test_data",
],
shard_count = 4,
tags = ["spectest"],
deps = ["//testing/spectest/shared/deneb/operations:go_default_library"],
)
11 changes: 11 additions & 0 deletions testing/spectest/mainnet/deneb/operations/attestation_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package operations

import (
"testing"

"github.com/prysmaticlabs/prysm/v4/testing/spectest/shared/deneb/operations"
)

func TestMainnet_Deneb_Operations_Attestation(t *testing.T) {
operations.RunAttestationTest(t, "mainnet")
}
Loading