From 07a991d3e491cfb90dfa94aa09fa4de2ec322746 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Tue, 28 Jun 2022 16:40:07 +0530 Subject: [PATCH 1/2] Add misssing error logs --- pkg/eth/api.go | 3 +++ pkg/eth/backend.go | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/pkg/eth/api.go b/pkg/eth/api.go index 5c05e1c55..43d1811ba 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -37,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/statediff" @@ -1096,11 +1097,13 @@ func (pea *PublicEthAPI) writeStateDiffFor(blockHash common.Hash) { func (pea *PublicEthAPI) rpcMarshalBlock(b *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error) { fields, err := RPCMarshalBlock(b, inclTx, fullTx) if err != nil { + log.Error("error RPC marshalling block with hash", b.Hash().String(), err) return nil, err } if inclTx { td, err := pea.B.GetTd(b.Hash()) if err != nil { + log.Error("error getting td for block with hash", b.Hash().String(), err) return nil, err } fields["totalDifficulty"] = (*hexutil.Big)(td) diff --git a/pkg/eth/backend.go b/pkg/eth/backend.go index 9ea501db4..6d69b27fa 100644 --- a/pkg/eth/backend.go +++ b/pkg/eth/backend.go @@ -342,6 +342,7 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber var headerIPLD models.IPLDModel headerIPLD, err = b.Fetcher.FetchHeader(tx, headerCID) if err != nil { + log.Error("error fetching header ipld", err) if err == sql.ErrNoRows { return nil, nil } @@ -352,10 +353,12 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber if err != nil { return nil, err } + // Fetch and decode the uncle IPLDs var uncleIPLDs []models.IPLDModel uncleIPLDs, err = b.Fetcher.FetchUncles(tx, uncleCIDs) if err != nil { + log.Error("error fetching uncle iplds", err) return nil, err } var uncles []*types.Header @@ -367,10 +370,12 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber } uncles = append(uncles, &uncle) } + // Fetch and decode the transaction IPLDs var txIPLDs []models.IPLDModel txIPLDs, err = b.Fetcher.FetchTrxs(tx, txCIDs) if err != nil { + log.Error("error fetching tx iplds", err) return nil, err } var transactions []*types.Transaction @@ -386,6 +391,7 @@ func (b *Backend) BlockByNumber(ctx context.Context, blockNumber rpc.BlockNumber var rctIPLDs []models.IPLDModel rctIPLDs, err = b.Fetcher.FetchRcts(tx, rctCIDs) if err != nil { + log.Error("error fetching rct iplds", err) return nil, err } var receipts []*types.Receipt @@ -438,6 +444,7 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo var headerIPLD models.IPLDModel headerIPLD, err = b.Fetcher.FetchHeader(tx, headerCID) if err != nil { + log.Error("error fetching header ipld", err) if err == sql.ErrNoRows { return nil, nil } @@ -452,6 +459,7 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo var uncleIPLDs []models.IPLDModel uncleIPLDs, err = b.Fetcher.FetchUncles(tx, uncleCIDs) if err != nil { + log.Error("error fetching uncle iplds", err) if err == sql.ErrNoRows { return nil, nil } @@ -470,6 +478,7 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo var txIPLDs []models.IPLDModel txIPLDs, err = b.Fetcher.FetchTrxs(tx, txCIDs) if err != nil { + log.Error("error fetching tx iplds", err) if err == sql.ErrNoRows { return nil, nil } @@ -488,6 +497,7 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo var rctIPLDs []models.IPLDModel rctIPLDs, err = b.Fetcher.FetchRcts(tx, rctCIDs) if err != nil { + log.Error("error fetching rct iplds", err) if err == sql.ErrNoRows { return nil, nil } From 923a8c3241922ef490e17958b07c196cc4641a1a Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Tue, 28 Jun 2022 17:28:41 +0530 Subject: [PATCH 2/2] Update refs in GitHub workflows --- .github/workflows/on-pr-publish.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on-pr-publish.yaml b/.github/workflows/on-pr-publish.yaml index 3d492919f..9abf2448d 100644 --- a/.github/workflows/on-pr-publish.yaml +++ b/.github/workflows/on-pr-publish.yaml @@ -28,9 +28,9 @@ jobs: BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }} BUILD_KEY: ${{ secrets.BUILD_KEY }} with: - STACK_ORCHESTRATOR_REF: "b3cb26e93b7e387d96417c81f880a3b8699b67db" - GO_ETHEREUM_REF: "d629c99d84cb8d20b89e46c1d9f852c7409829f2" - IPLD_ETH_DB_REF: "48eb594ea95763bda8e51590f105f7a2657ac6d4" + STACK_ORCHESTRATOR_REF: "382aca8e42bc5e33f301f77cdd2e09cc80602fc3" + GO_ETHEREUM_REF: "c265fdc30915e01bb633203acbbd9d5009a7ddf2" + IPLD_ETH_DB_REF: "4e948c58ce20c20ab633289f986d2ed2a1fe02ec" build: name: Run docker build runs-on: ubuntu-latest