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:
name: indexer-tests
binary_name: indexer
working_directory: indexer
dependencies: op-bindings
- go-lint-test-build:
name: op-heartbeat tests
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
COPY ./indexer /go/indexer
COPY ./.git /go/.git
COPY ./indexer/go.mod /go/indexer/go.mod
COPY ./indexer/go.sum /go/indexer/go.sum
# build indexer with the shared go.mod & go.sum files
COPY ./indexer /app/indexer
COPY ./op-bindings /app/op-bindings
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
RUN make
WORKDIR /app/indexer
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"]
GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct')
GITVERSION := $(shell cat package.json | jq .version)
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
indexer:
......
......@@ -5,7 +5,6 @@ import (
"github.com/ethereum-optimism/optimism/indexer/db"
"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/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
......@@ -45,6 +44,11 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
return nil, err
}
l2L1MpABI, err := bindings.L2ToL1MessagePasserMetaData.GetAbi()
if err != nil {
return nil, err
}
receipts := make(map[common.Hash]*types.Receipt)
defer iter.Close()
for iter.Next() {
......@@ -61,7 +65,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
var withdrawalInitiated *bindings.L2ToL1MessagePasserMessagePassed
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
}
......@@ -76,11 +80,7 @@ func (s *StandardBridge) GetWithdrawalsByBlockRange(ctx context.Context, start,
}
}
hash, err := withdrawals.WithdrawalHash(withdrawalInitiated)
if err != nil {
return nil, err
}
hash := common.Hash(withdrawalInitiated.WithdrawalHash)
withdrawalsByBlockhash[ev.Raw.BlockHash] = append(
withdrawalsByBlockhash[ev.Raw.BlockHash], db.Withdrawal{
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