Skip to content

Commit

Permalink
beacon repository refactorings and cleanup (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
fridrik01 authored Dec 5, 2024
1 parent f8825fd commit 3ca00bc
Show file tree
Hide file tree
Showing 643 changed files with 1,607 additions and 4,918 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ testing/
.git/
.vscode/
*.md
contracts/
docs/
scripts/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tmp/
*.out

# Dependency directories (remove the comment below to include it)
go.work.sum
go.work.sum

##########
# Linux #
Expand Down
16 changes: 8 additions & 8 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ outpkg: "mocks"
resolve-type-alias: False # see https://vektra.github.io/mockery/latest/deprecations/#resolve-type-alias
issue-845-fix: True # see https://vektra.github.io/mockery/latest/deprecations/#issue-845-fix
packages:
github.com/berachain/beacon-kit/mod/execution/pkg/client/ethclient:
github.com/berachain/beacon-kit/mod/execution/client/ethclient:
config:
recursive: True
with-expecter: true
Expand All @@ -40,37 +40,37 @@ packages:
recursive: True
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/node-core/pkg/services/registry:
github.com/berachain/beacon-kit/mod/node-core/services/registry:
config:
recursive: True
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/storage/pkg/interfaces:
github.com/berachain/beacon-kit/mod/storage/interfaces:
config:
recursive: False
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/consensus-types/pkg/types:
github.com/berachain/beacon-kit/mod/consensus-types/types:
config:
recursive: False
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/storage/pkg/pruner:
github.com/berachain/beacon-kit/mod/storage/pruner:
config:
recursive: False
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/primitives/pkg/crypto:
github.com/berachain/beacon-kit/mod/primitives/crypto:
config:
recursive: False
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives:
github.com/berachain/beacon-kit/mod/engine-primitives/engine-primitives:
config:
recursive: False
with-expecter: true
all: True
github.com/berachain/beacon-kit/mod/state-transition/pkg/core:
github.com/berachain/beacon-kit/mod/state-transition/core:
config:
recursive: False
with-expecter: true
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ARG BUILD_TAGS="netgo,muslc,blst,bls12381,pebbledb"
ARG NAME=beacond
ARG APP_NAME=beacond
ARG DB_BACKEND=pebbledb
ARG CMD_PATH=./beacond/cmd
ARG CMD_PATH=./cmd/beacond

#######################################################
### Stage 1 - Cache Go Modules ###
Expand Down Expand Up @@ -63,10 +63,8 @@ RUN apk add --no-cache --update \
# Copy the dependencies from the cache stage
COPY --from=mod-cache /go/pkg /go/pkg

# Copy the rest of the source code
COPY ./go.mod ./go.sum ./
COPY ./mod ./mod
COPY ./beacond ./beacond
# Copy all the source code (this will ignore files/dirs in .dockerignore)
COPY ./ ./

# Build args
ARG NAME
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/make -f

include build/scripts/build.mk
include build/scripts/codegen.mk
include build/scripts/constants.mk
include build/scripts/devtools.mk
include build/scripts/linting.mk
include build/scripts/protobuf.mk
include build/scripts/release.mk
include build/scripts/testing.mk
include scripts/build/build.mk
include scripts/build/codegen.mk
include scripts/build/constants.mk
include scripts/build/devtools.mk
include scripts/build/linting.mk
include scripts/build/protobuf.mk
include scripts/build/release.mk
include scripts/build/testing.mk
include contracts/Makefile
include kurtosis/Makefile
include build/scripts/help.mk
include scripts/build/help.mk
include testing/forge-script/Makefile

# Specify the default target if none is provided
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mod/async/pkg/broker/broker.go → async/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"context"
"time"

"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/primitives/async"
)

// Broker is the unique publisher for broadcasting all events corresponding
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion mod/async/pkg/broker/errors.go → async/broker/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package broker

import (
"github.com/berachain/beacon-kit/mod/errors"
"github.com/berachain/beacon-kit/errors"
)

// errTimeout is the error returned when a dispatch operation timed out.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ package dispatcher
import (
"context"

"github.com/berachain/beacon-kit/mod/async/pkg/types"
"github.com/berachain/beacon-kit/mod/log"
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/async/types"
"github.com/berachain/beacon-kit/log"
"github.com/berachain/beacon-kit/primitives/async"
)

var _ types.Dispatcher = (*Dispatcher)(nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
package dispatcher

import (
"github.com/berachain/beacon-kit/mod/errors"
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/errors"
"github.com/berachain/beacon-kit/primitives/async"
)

//nolint:gochecknoglobals // errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
package dispatcher

import (
"github.com/berachain/beacon-kit/mod/async/pkg/broker"
"github.com/berachain/beacon-kit/mod/async/pkg/types"
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/async/broker"
"github.com/berachain/beacon-kit/async/types"
"github.com/berachain/beacon-kit/primitives/async"
)

// Opt is a type that defines a function that modifies NodeBuilder.
Expand Down
2 changes: 1 addition & 1 deletion mod/async/pkg/types/broker.go → async/types/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package types
import (
"context"

"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/primitives/async"
)

// Broker is the unique publisher for broadcasting all events corresponding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package types
import (
"context"

"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/primitives/async"
)

// Dispatcher is the maximal interface for a dispatcher that facilitates the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package blockchain

import "github.com/berachain/beacon-kit/mod/errors"
import "github.com/berachain/beacon-kit/errors"

var (
// ErrNilBlk is an error for when the beacon block is nil.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"context"
"time"

payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time"
"github.com/berachain/beacon-kit/mod/config/pkg/spec"
engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
payloadtime "github.com/berachain/beacon-kit/beacon/payload-time"
"github.com/berachain/beacon-kit/config/spec"
engineprimitives "github.com/berachain/beacon-kit/engine-primitives/engine-primitives"
)

// sendPostBlockFCU sends a forkchoice update to the execution client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package blockchain
import (
"time"

"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/primitives/math"
)

// chainMetrics is a struct that contains metrics for the chain.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package blockchain
import (
"context"

"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/primitives/math"
)

// forceStartupHead sends a force head FCU to the execution client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"context"
"time"

"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
"github.com/berachain/beacon-kit/primitives/async"
"github.com/berachain/beacon-kit/primitives/transition"
)

// ProcessGenesisData processes the genesis state and initializes the beacon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"context"
"time"

payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time"
engineerrors "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/errors"
"github.com/berachain/beacon-kit/mod/errors"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
payloadtime "github.com/berachain/beacon-kit/beacon/payload-time"
engineerrors "github.com/berachain/beacon-kit/engine-primitives/errors"
"github.com/berachain/beacon-kit/errors"
"github.com/berachain/beacon-kit/primitives/transition"
)

// VerifyIncomingBlock verifies the state root of an incoming block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"context"
"sync"

asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
"github.com/berachain/beacon-kit/mod/log"
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
asynctypes "github.com/berachain/beacon-kit/async/types"
"github.com/berachain/beacon-kit/log"
"github.com/berachain/beacon-kit/primitives/async"
"github.com/berachain/beacon-kit/primitives/common"
"github.com/berachain/beacon-kit/primitives/transition"
)

// Service is the blockchain service.
Expand Down
10 changes: 5 additions & 5 deletions mod/beacon/blockchain/types.go → beacon/blockchain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"context"
"time"

engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/constraints"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
engineprimitives "github.com/berachain/beacon-kit/engine-primitives/engine-primitives"
"github.com/berachain/beacon-kit/primitives/common"
"github.com/berachain/beacon-kit/primitives/constraints"
"github.com/berachain/beacon-kit/primitives/math"
"github.com/berachain/beacon-kit/primitives/transition"
)

// AvailabilityStore interface is responsible for validating and storing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"errors"
"fmt"

"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/primitives/math"
)

// ErrTooFarInTheFuture is returned when the payload timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"testing"
"time"

payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
payloadtime "github.com/berachain/beacon-kit/beacon/payload-time"
"github.com/berachain/beacon-kit/primitives/math"
"github.com/stretchr/testify/require"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import (
"fmt"
"time"

payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time"
"github.com/berachain/beacon-kit/mod/config/pkg/spec"
engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/bytes"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
"github.com/berachain/beacon-kit/mod/primitives/pkg/version"
payloadtime "github.com/berachain/beacon-kit/beacon/payload-time"
"github.com/berachain/beacon-kit/config/spec"
engineprimitives "github.com/berachain/beacon-kit/engine-primitives/engine-primitives"
"github.com/berachain/beacon-kit/primitives/bytes"
"github.com/berachain/beacon-kit/primitives/common"
"github.com/berachain/beacon-kit/primitives/crypto"
"github.com/berachain/beacon-kit/primitives/math"
"github.com/berachain/beacon-kit/primitives/transition"
"github.com/berachain/beacon-kit/primitives/version"
"golang.org/x/sync/errgroup"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package validator

import "github.com/berachain/beacon-kit/mod/errors"
import "github.com/berachain/beacon-kit/errors"

var (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package validator
import (
"time"

"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/primitives/math"
)

// validatorMetrics is a struct that contains metrics for the chain.
Expand Down
12 changes: 6 additions & 6 deletions mod/beacon/validator/service.go → beacon/validator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ package validator
import (
"context"

asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
"github.com/berachain/beacon-kit/mod/log"
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
asynctypes "github.com/berachain/beacon-kit/async/types"
"github.com/berachain/beacon-kit/log"
"github.com/berachain/beacon-kit/primitives/async"
"github.com/berachain/beacon-kit/primitives/common"
"github.com/berachain/beacon-kit/primitives/crypto"
"github.com/berachain/beacon-kit/primitives/transition"
)

// Service is responsible for building beacon blocks and sidecars.
Expand Down
14 changes: 7 additions & 7 deletions mod/beacon/validator/types.go → beacon/validator/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (
"context"
"time"

engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/constraints"
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
"github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
engineprimitives "github.com/berachain/beacon-kit/engine-primitives/engine-primitives"
"github.com/berachain/beacon-kit/primitives/common"
"github.com/berachain/beacon-kit/primitives/constraints"
"github.com/berachain/beacon-kit/primitives/crypto"
"github.com/berachain/beacon-kit/primitives/eip4844"
"github.com/berachain/beacon-kit/primitives/math"
"github.com/berachain/beacon-kit/primitives/transition"
)

// BeaconBlock represents a beacon block interface.
Expand Down
Loading

0 comments on commit 3ca00bc

Please sign in to comment.