Commit 990e5197 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #3949 from ethereum-optimism/jg/fix_lints

Standardize & Fix Lints
parents c4bb465e ffdbcbca
...@@ -351,9 +351,8 @@ jobs: ...@@ -351,9 +351,8 @@ jobs:
- checkout - checkout
- run: - run:
name: run lint name: run lint
# command: golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint -e "errors.As" -e "errors.Is" ./...
command: | command: |
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell ./... golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint -e "errors.As" -e "errors.Is" ./...
working_directory: <<parameters.module>> working_directory: <<parameters.module>>
go-test: go-test:
...@@ -932,4 +931,4 @@ workflows: ...@@ -932,4 +931,4 @@ workflows:
requires: requires:
- op-node-publish-dev - op-node-publish-dev
- op-batcher-publish-dev - op-batcher-publish-dev
- op-proposer-publish-dev - op-proposer-publish-dev
\ No newline at end of file
...@@ -94,7 +94,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu ...@@ -94,7 +94,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
for i, otx := range params.Transactions { for i, otx := range params.Transactions {
var tx types.Transaction var tx types.Transaction
if err := tx.UnmarshalBinary(otx); err != nil { if err := tx.UnmarshalBinary(otx); err != nil {
return fmt.Errorf("transaction %d is not valid: %v", i, err) return fmt.Errorf("transaction %d is not valid: %w", i, err)
} }
ea.l2BuildingState.Prepare(tx.Hash(), i) ea.l2BuildingState.Prepare(tx.Hash(), i)
receipt, err := core.ApplyTransaction(ea.l2Cfg.Config, ea.l2Chain, &ea.l2BuildingHeader.Coinbase, receipt, err := core.ApplyTransaction(ea.l2Cfg.Config, ea.l2Chain, &ea.l2BuildingHeader.Coinbase,
...@@ -123,10 +123,10 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) { ...@@ -123,10 +123,10 @@ func (ea *L2EngineAPI) endBlock() (*types.Block, error) {
// Write state changes to db // Write state changes to db
root, err := ea.l2BuildingState.Commit(ea.l2Cfg.Config.IsEIP158(header.Number)) root, err := ea.l2BuildingState.Commit(ea.l2Cfg.Config.IsEIP158(header.Number))
if err != nil { if err != nil {
return nil, fmt.Errorf("l2 state write error: %v", err) return nil, fmt.Errorf("l2 state write error: %w", err)
} }
if err := ea.l2BuildingState.Database().TrieDB().Commit(root, false, nil); err != nil { if err := ea.l2BuildingState.Database().TrieDB().Commit(root, false, nil); err != nil {
return nil, fmt.Errorf("l2 trie write error: %v", err) return nil, fmt.Errorf("l2 trie write error: %w", err)
} }
return block, nil return block, nil
} }
......
...@@ -511,7 +511,7 @@ func (eq *EngineQueue) Reset(ctx context.Context, _ eth.L1BlockRef, _ eth.System ...@@ -511,7 +511,7 @@ func (eq *EngineQueue) Reset(ctx context.Context, _ eth.L1BlockRef, _ eth.System
} }
l1Cfg, err := eq.engine.SystemConfigByL2Hash(ctx, pipelineL2.Hash) l1Cfg, err := eq.engine.SystemConfigByL2Hash(ctx, pipelineL2.Hash)
if err != nil { if err != nil {
return NewTemporaryError(fmt.Errorf("failed to fetch L1 config of L2 block %s: %v", pipelineL2.ID(), err)) return NewTemporaryError(fmt.Errorf("failed to fetch L1 config of L2 block %s: %w", pipelineL2.ID(), err))
} }
eq.log.Debug("Reset engine queue", "safeHead", safe, "unsafe", unsafe, "safe_timestamp", safe.Time, "unsafe_timestamp", unsafe.Time, "l1Origin", l1Origin) eq.log.Debug("Reset engine queue", "safeHead", safe, "unsafe", unsafe, "safe_timestamp", safe.Time, "unsafe_timestamp", unsafe.Time, "l1Origin", l1Origin)
eq.unsafeHead = unsafe eq.unsafeHead = unsafe
......
...@@ -73,11 +73,11 @@ func (l1t *L1Traversal) AdvanceL1Block(ctx context.Context) error { ...@@ -73,11 +73,11 @@ func (l1t *L1Traversal) AdvanceL1Block(ctx context.Context) error {
// Parse L1 receipts of the given block and update the L1 system configuration // Parse L1 receipts of the given block and update the L1 system configuration
_, receipts, err := l1t.l1Blocks.FetchReceipts(ctx, nextL1Origin.Hash) _, receipts, err := l1t.l1Blocks.FetchReceipts(ctx, nextL1Origin.Hash)
if err != nil { if err != nil {
return NewTemporaryError(fmt.Errorf("failed to fetch receipts of L1 block %s for L1 sysCfg update: %v", origin, err)) return NewTemporaryError(fmt.Errorf("failed to fetch receipts of L1 block %s for L1 sysCfg update: %w", origin, err))
} }
if err := UpdateSystemConfigWithL1Receipts(&l1t.sysCfg, receipts, l1t.cfg); err != nil { if err := UpdateSystemConfigWithL1Receipts(&l1t.sysCfg, receipts, l1t.cfg); err != nil {
// the sysCfg changes should always be formatted correctly. // the sysCfg changes should always be formatted correctly.
return NewCriticalError(fmt.Errorf("failed to update L1 sysCfg with receipts from block %s: %v", origin, err)) return NewCriticalError(fmt.Errorf("failed to update L1 sysCfg with receipts from block %s: %w", origin, err))
} }
l1t.block = nextL1Origin l1t.block = nextL1Origin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment