Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[etl_optimisations] Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen Pociask committed Nov 3, 2023
1 parent 00233e2 commit bf3edcd
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 31 deletions.
15 changes: 0 additions & 15 deletions e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@ type SysTestSuite struct {
L2Client *ethclient.Client
}

// L2TestSuite ... Stores all the information needed to run an e2e L2Geth test
type L2TestSuite struct {
t *testing.T

L2Geth *op_e2e.OpGeth
L2Cfg *op_e2e.SystemConfig

App *app.Application
AppCfg *config.Config
Close func()

TestSlackSvr *TestSlackServer
TestPagerDutyServer *TestPagerDutyServer
}

// CreateSysTestSuite ... Creates a new SysTestSuite
func CreateSysTestSuite(t *testing.T) *SysTestSuite {
t.Log("Creating system test suite")
Expand Down
1 change: 0 additions & 1 deletion internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func (b *Bundle) NodeClient(n core.Network) (ix_node.EthClient, error) {
default:
return nil, fmt.Errorf("invalid network supplied")
}

}

// FromNetwork ... Retrieves an eth client from the context
Expand Down
1 change: 0 additions & 1 deletion internal/core/etl.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func (ct ComponentType) String() string {

case Transformer:
return "transformer"

}

return UnknownType
Expand Down
1 change: 0 additions & 1 deletion internal/core/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const (
// register enum
func (rt RegisterType) String() string {
switch rt {

case BlockHeader:
return "block_header"

Expand Down
6 changes: 2 additions & 4 deletions internal/engine/registry/balance_enforce.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ func (bi *BalanceInvConfig) Unmarshal(isp *core.SessionParams) error {

// BalanceHeuristic ...
type BalanceHeuristic struct {
ctx context.Context
cfg *BalanceInvConfig
client client.EthClient
ctx context.Context
cfg *BalanceInvConfig

heuristic.Heuristic
}
Expand All @@ -50,7 +49,6 @@ const reportMsg = `

// NewBalanceHeuristic ... Initializer
func NewBalanceHeuristic(ctx context.Context, cfg *BalanceInvConfig) (heuristic.Heuristic, error) {

return &BalanceHeuristic{
ctx: ctx,
cfg: cfg,
Expand Down
2 changes: 0 additions & 2 deletions internal/etl/pipeline/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ const (
emptyPipelineError = "pipeline must contain at least one component"
// Manager error constants
unknownCompType = "unknown component type %s provided"

noAggregatorErr = "aggregator component has yet to be implemented"
)
11 changes: 6 additions & 5 deletions internal/etl/registry/header_traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ import (
)

const (
// This could be configurable in the future
batchSize = 100

notFoundMsg = "not found"
)

type HeaderTraversal struct {
Expand Down Expand Up @@ -61,7 +60,7 @@ func NewHeaderTraversal(ctx context.Context, cfg *core.ClientConfig,
n: cfg.Network,
client: node,
traversal: ix_node.NewHeaderTraversal(node, startHeader, big.NewInt(0)),
pollInterval: time.Duration(cfg.PollInterval) * time.Millisecond,
pollInterval: cfg.PollInterval * time.Millisecond,

Check failure on line 63 in internal/etl/registry/header_traversal.go

View workflow job for this annotation

GitHub Actions / lint

Multiplication of durations: `cfg.PollInterval * time.Millisecond` (durationcheck)
}

reader, err := component.NewReader(ctx, core.BlockHeader, ht, opts...)
Expand Down Expand Up @@ -110,8 +109,10 @@ func (ht *HeaderTraversal) Loop(ctx context.Context, consumer chan core.TransitD

// backfill if provided starting header
if ht.traversal.LastHeader() != nil {

ht.Backfill(ht.traversal.LastHeader().Number, recent.Number, consumer)
err = ht.Backfill(ht.traversal.LastHeader().Number, recent.Number, consumer)
if err != nil {
return err
}
} else {
ht.traversal = ix_node.NewHeaderTraversal(ht.client, recent, big.NewInt(0))
}
Expand Down
4 changes: 2 additions & 2 deletions internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ func (n *noopMetricer) RecordNodeError(_ core.Network)
func (n *noopMetricer) RecordBlockLatency(_ core.Network, _ float64) {}
func (n *noopMetricer) RecordPipelineLatency(_ core.PUUID, _ float64) {}
func (n *noopMetricer) RecordAssessmentError(_ heuristic.Heuristic) {}
func (n *noopMetricer) RecordRPCClientRequest(method string) func(err error) {
func (n *noopMetricer) RecordRPCClientRequest(_ string) func(err error) {
return func(err error) {}
}
func (n *noopMetricer) RecordRPCClientBatchRequest(b []rpc.BatchElem) func(err error) {
func (n *noopMetricer) RecordRPCClientBatchRequest(_ []rpc.BatchElem) func(err error) {
return func(err error) {}
}

Expand Down

0 comments on commit bf3edcd

Please sign in to comment.