Commit c6b61ea1 authored by Hamdi Allam's avatar Hamdi Allam

fix circleci & remove op-node/withdrawal deps that also brings in op-e2e

parent def2dbdf
...@@ -1374,7 +1374,6 @@ workflows: ...@@ -1374,7 +1374,6 @@ workflows:
name: indexer-tests name: indexer-tests
binary_name: indexer binary_name: indexer
working_directory: indexer working_directory: indexer
dependencies: op-bindings
- go-lint-test-build: - go-lint-test-build:
name: op-heartbeat tests name: op-heartbeat tests
binary_name: op-heartbeat binary_name: op-heartbeat
......
FROM golang:1.19.0-alpine3.15 as builder FROM --platform=$BUILDPLATFORM golang:1.19.9-alpine3.16 as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
COPY ./indexer /go/indexer # build indexer with the shared go.mod & go.sum files
COPY ./.git /go/.git COPY ./indexer /app/indexer
COPY ./indexer/go.mod /go/indexer/go.mod COPY ./op-bindings /app/op-bindings
COPY ./indexer/go.sum /go/indexer/go.sum COPY ./op-service /app/op-service
COPY ./go.mod /app/go.mod
COPY ./go.sum /app/go.sum
COPY ./.git /app/.git
WORKDIR /go/indexer WORKDIR /app/indexer
RUN make
FROM alpine:3.15 RUN go mod download
COPY --from=builder /go/indexer/indexer /usr/local/bin RUN make indexer
FROM alpine:3.16
COPY --from=builder /app/indexer/indexer /usr/local/bin
CMD ["indexer"] CMD ["indexer"]
GITCOMMIT := $(shell git rev-parse HEAD) GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct') GITDATE := $(shell git show -s --format='%ct')
GITVERSION := $(shell cat package.json | jq .version)
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT) LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE) LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)" LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
indexer: indexer:
......
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
"github.com/ethereum-optimism/optimism/indexer/db" "github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum-optimism/optimism/op-service/backoff" "github.com/ethereum-optimism/optimism/op-service/backoff"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
...@@ -45,6 +44,11 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start, ...@@ -45,6 +44,11 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
return nil, err return nil, err
} }
l2L1MpABI, err := bindings.L2ToL1MessagePasserMetaData.GetAbi()
if err != nil {
return nil, err
}
receipts := make(map[common.Hash]*types.Receipt) receipts := make(map[common.Hash]*types.Receipt)
defer iter.Close() defer iter.Close()
for iter.Next() { for iter.Next() {
...@@ -61,7 +65,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start, ...@@ -61,7 +65,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
var withdrawalInitiated *bindings.L2ToL1MessagePasserMessagePassed var withdrawalInitiated *bindings.L2ToL1MessagePasserMessagePassed
for _, eLog := range receipt.Logs { for _, eLog := range receipt.Logs {
if len(eLog.Topics) == 0 || eLog.Topics[0] != withdrawals.MessagePassedTopic { if len(eLog.Topics) == 0 || eLog.Topics[0] != l2L1MpABI.Events["MessagePassed"].ID {
continue continue
} }
...@@ -76,11 +80,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start, ...@@ -76,11 +80,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
} }
} }
hash, err := withdrawals.WithdrawalHash(withdrawalInitiated) hash := common.Hash(withdrawalInitiated.WithdrawalHash)
if err != nil {
return nil, err
}
withdrawalsByBlockhash[ev.Raw.BlockHash] = append( withdrawalsByBlockhash[ev.Raw.BlockHash] = append(
withdrawalsByBlockhash[ev.Raw.BlockHash], db.Withdrawal{ withdrawalsByBlockhash[ev.Raw.BlockHash], db.Withdrawal{
TxHash: ev.Raw.TxHash, TxHash: ev.Raw.TxHash,
......
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