Skip to content

Commit

Permalink
rename BlsSigner to BLSSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Jan 15, 2025
1 parent f1eb0ad commit cab9487
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion node/grpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func newTestServerWithConfig(t *testing.T, mockValidator bool, config *node.Conf
Config: config,
Logger: logger,
KeyPair: keyPair,
BlsSigner: signer,
BLSSigner: signer,
Metrics: metrics,
Store: store,
ChainState: chainState,
Expand Down
4 changes: 2 additions & 2 deletions node/grpc/server_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *ServerV2) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (
return nil, api.NewErrorInternal("v2 store not initialized")
}

if s.node.BlsSigner == nil {
if s.node.BLSSigner == nil {
return nil, api.NewErrorInternal("missing bls signer")
}

Expand Down Expand Up @@ -179,7 +179,7 @@ func (s *ServerV2) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (
return nil, api.NewErrorInternal(fmt.Sprintf("failed to store batch: %v", res.err))
}

sig, err := s.node.BlsSigner.Sign(ctx, batchHeaderHash[:])
sig, err := s.node.BLSSigner.Sign(ctx, batchHeaderHash[:])
if err != nil {
return nil, api.NewErrorInternal(fmt.Sprintf("failed to sign batch: %v", err))
}
Expand Down
2 changes: 1 addition & 1 deletion node/grpc/server_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func newTestComponents(t *testing.T, config *node.Config) *testComponents {
Config: config,
Logger: logger,
KeyPair: keyPair,
BlsSigner: signer,
BLSSigner: signer,
Metrics: metrics,
StoreV2: s,
ChainState: chainState,
Expand Down
13 changes: 5 additions & 8 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ type Node struct {
PubIPProvider pubip.Provider
OperatorSocketsFilterer indexer.OperatorSocketsFilterer
ChainID *big.Int
BLSPublicKeyHex string

BlsSigner blssigner.Signer
BLSSigner blssigner.Signer

RelayClient atomic.Value

Expand Down Expand Up @@ -129,7 +128,6 @@ func NewNode(
if err != nil {
return nil, fmt.Errorf("failed to create BLS signer: %w", err)
}
blsPublicKeyHex := blsSigner.GetPublicKeyG1()
operatorID, err := blsSigner.GetOperatorId()
if err != nil {
return nil, fmt.Errorf("failed to get operator ID: %w", err)
Expand Down Expand Up @@ -204,8 +202,7 @@ func NewNode(
PubIPProvider: pubIPProvider,
OperatorSocketsFilterer: socketsFilterer,
ChainID: chainID,
BlsSigner: blsSigner,
BLSPublicKeyHex: blsPublicKeyHex,
BLSSigner: blsSigner,
}

if !config.EnableV2 {
Expand Down Expand Up @@ -305,7 +302,7 @@ func (n *Node) Start(ctx context.Context) error {
Timeout: 10 * time.Second,
PrivKey: privateKey,
KeyPair: n.KeyPair,
Signer: n.BlsSigner,
Signer: n.BLSSigner,
OperatorId: n.Config.ID,
QuorumIDs: n.Config.QuorumIDList,
RegisterNodeAtStart: n.Config.RegisterNodeAtStart,
Expand Down Expand Up @@ -556,14 +553,14 @@ func (n *Node) ProcessBatch(ctx context.Context, header *core.BatchHeader, blobs
}

n.Metrics.RecordStoreChunksStage("signed", batchSize, time.Since(stageTimer))
log.Debug("Sign batch succeeded", "pubkey", n.BLSPublicKeyHex, "duration", time.Since(stageTimer))
log.Debug("Sign batch succeeded", "pubkey", n.BLSSigner.GetPublicKeyG1(), "duration", time.Since(stageTimer))

log.Debug("Exiting process batch", "duration", time.Since(start))
return signature, nil
}

func (n *Node) SignMessage(ctx context.Context, data [32]byte) (*core.Signature, error) {
signature, err := n.BlsSigner.Sign(ctx, data[:])
signature, err := n.BLSSigner.Sign(ctx, data[:])
if err != nil {
return nil, fmt.Errorf("failed to sign message: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func mustMakeOperators(t *testing.T, cst *coremock.ChainDataMock, logger logging
Config: config,
Logger: logger,
KeyPair: op.KeyPair,
BlsSigner: op.Signer,
BLSSigner: op.Signer,
Metrics: metrics,
Store: store,
ChainState: cst,
Expand Down

0 comments on commit cab9487

Please sign in to comment.