Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into malfeasance-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Dec 3, 2024
2 parents 80bef7c + ffd0749 commit 3d782fc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions bootstrap/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ type EpochData struct {
ActiveSet []string `json:"activeSet"`
}

func (ed *EpochData) MarshalLogObject(encoder zapcore.ObjectEncoder) error {
encoder.AddUint32("epoch", ed.ID)
encoder.AddString("beacon", ed.Beacon)
encoder.AddInt("activeset_size", len(ed.ActiveSet))
return nil
}

type VerifiedUpdate struct {
Data *EpochOverride
Persisted string
Expand Down
7 changes: 4 additions & 3 deletions cmd/bootstrapper/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ func (g *Generator) Generate(
}

if genBeacon {
g.logger.Info("bootstrapping beacon", zap.Uint32("epoch", targetEpoch.Uint32()))
beacon, err = g.genBeacon(ctx, g.logger)
if err != nil {
return "", err
}
}
if genActiveSet {
g.logger.Info("bootstrapping activeset", zap.Uint32("epoch", targetEpoch.Uint32()))
activeSet, err = getActiveSet(ctx, g.smEndpoint, targetEpoch-1)
if err != nil {
return "", err
Expand Down Expand Up @@ -245,6 +247,7 @@ func (g *Generator) GenUpdate(
if len(activeSet) > 0 {
edata.ActiveSet = as
}
g.logger.Info("generated bootstrap", zap.Inline(&edata))
update.Data = bootstrap.InnerData{
Epoch: edata,
}
Expand All @@ -261,8 +264,6 @@ func (g *Generator) GenUpdate(
if err != nil {
return "", fmt.Errorf("persist epoch update %v: %w", filename, err)
}
g.logger.Info("generated update",
zap.String("filename", filename),
)
g.logger.Info("generated update", zap.String("filename", filename))
return filename, nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ require (
k8s.io/api v0.31.3
k8s.io/apimachinery v0.31.3
k8s.io/client-go v0.31.3
sigs.k8s.io/controller-runtime v0.19.2
sigs.k8s.io/controller-runtime v0.19.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=
lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8=
sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw=
sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
Expand Down

0 comments on commit 3d782fc

Please sign in to comment.