Skip to content

Commit 8ff5278

Browse files
Merge pull request #13 from coinbase/patrick/update-geth
[Security] Update `go` and `go-ethereum`
2 parents 3279e31 + 00ff420 commit 8ff5278

File tree

14 files changed

+54
-41
lines changed

14 files changed

+54
-41
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ version: 2.1
1616
executors:
1717
default:
1818
docker:
19-
- image: circleci/golang:1.13
19+
- image: circleci/golang:1.15
2020
user: root # go directory is owned by root
2121
working_directory: /go/src/github.com/coinbase/rosetta-ethereum
2222
environment:
@@ -50,7 +50,7 @@ jobs:
5050
name: default
5151
steps:
5252
- *fast-checkout
53-
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
53+
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.32.2
5454
- run: make lint
5555
check-license:
5656
executor:

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ RUN mkdir -p /app \
2020
WORKDIR /app
2121

2222
RUN apt-get update && apt-get install -y curl make gcc g++ git
23-
ENV GOLANG_VERSION 1.15.2
24-
ENV GOLANG_DOWNLOAD_SHA256 b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552
23+
ENV GOLANG_VERSION 1.15.5
24+
ENV GOLANG_DOWNLOAD_SHA256 9a58494e8da722c3aef248c9227b0e9c528c7318309827780f16220998180a0d
2525
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
2626

2727
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
@@ -36,10 +36,10 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
3636
# Compile geth
3737
FROM golang-builder as geth-builder
3838

39-
# VERSION: go-ethereum v.1.9.23
39+
# VERSION: go-ethereum v.1.9.24
4040
RUN git clone https://github.com/ethereum/go-ethereum \
4141
&& cd go-ethereum \
42-
&& git checkout 8c2f271528f9cccf541c6ea1c022e98407f26872
42+
&& git checkout cc05b050df5f88e80bb26aaf6d2f339c49c2d702
4343

4444
RUN cd go-ethereum \
4545
&& make geth

cmd/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func runRunCmd(cmd *cobra.Command, args []string) error {
6969
ethereum.HistoricalBalanceSupported,
7070
[]*types.NetworkIdentifier{cfg.Network},
7171
ethereum.CallMethods,
72+
ethereum.IncludeMempoolCoins,
7273
)
7374
if err != nil {
7475
return fmt.Errorf("%w: could not initialize server asserter", err)

configuration/configuration.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ const (
7171
// a running geth node. This is used
7272
// when GethEnv is not populated.
7373
DefaultGethURL = "http://localhost:8545"
74+
75+
// MiddlewareVersion is the version of rosetta-ethereum.
76+
MiddlewareVersion = "0.0.2"
7477
)
7578

7679
// Configuration determines how

ethereum/client.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { //
599599
Index: int64(len(ops) + startIndex),
600600
},
601601
Type: trace.Type,
602-
Status: opStatus,
602+
Status: RosettaTypes.String(opStatus),
603603
Account: &RosettaTypes.AccountIdentifier{
604604
Address: from,
605605
},
@@ -660,7 +660,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { //
660660
},
661661
},
662662
Type: trace.Type,
663-
Status: opStatus,
663+
Status: RosettaTypes.String(opStatus),
664664
Account: &RosettaTypes.AccountIdentifier{
665665
Address: to,
666666
},
@@ -699,7 +699,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { //
699699
Index: ops[len(ops)-1].OperationIdentifier.Index + 1,
700700
},
701701
Type: DestructOpType,
702-
Status: SuccessStatus,
702+
Status: RosettaTypes.String(SuccessStatus),
703703
Account: &RosettaTypes.AccountIdentifier{
704704
Address: acct,
705705
},
@@ -762,7 +762,7 @@ func feeOps(tx *loadedTransaction) []*RosettaTypes.Operation {
762762
Index: 0,
763763
},
764764
Type: FeeOpType,
765-
Status: SuccessStatus,
765+
Status: RosettaTypes.String(SuccessStatus),
766766
Account: &RosettaTypes.AccountIdentifier{
767767
Address: MustChecksum(tx.From.String()),
768768
},
@@ -782,7 +782,7 @@ func feeOps(tx *loadedTransaction) []*RosettaTypes.Operation {
782782
},
783783
},
784784
Type: FeeOpType,
785-
Status: SuccessStatus,
785+
Status: RosettaTypes.String(SuccessStatus),
786786
Account: &RosettaTypes.AccountIdentifier{
787787
Address: MustChecksum(tx.Miner),
788788
},
@@ -981,7 +981,7 @@ func (ec *Client) blockRewardTransaction(
981981
Index: 0,
982982
},
983983
Type: MinerRewardOpType,
984-
Status: SuccessStatus,
984+
Status: RosettaTypes.String(SuccessStatus),
985985
Account: &RosettaTypes.AccountIdentifier{
986986
Address: MustChecksum(miner),
987987
},
@@ -1008,7 +1008,7 @@ func (ec *Client) blockRewardTransaction(
10081008
Index: int64(len(ops)),
10091009
},
10101010
Type: UncleRewardOpType,
1011-
Status: SuccessStatus,
1011+
Status: RosettaTypes.String(SuccessStatus),
10121012
Account: &RosettaTypes.AccountIdentifier{
10131013
Address: MustChecksum(uncleMiner),
10141014
},

ethereum/geth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func logPipe(pipe io.ReadCloser, identifier string) error {
4343
return err
4444
}
4545

46-
message := strings.Replace(str, "\n", "", -1)
46+
message := strings.ReplaceAll(str, "\n", "")
4747
log.Println(identifier, message)
4848
}
4949
}

ethereum/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
const (
2727
// NodeVersion is the version of geth we are using.
28-
NodeVersion = "1.9.23"
28+
NodeVersion = "1.9.24"
2929

3030
// Blockchain is Ethereum.
3131
Blockchain string = "Ethereum"
@@ -113,15 +113,15 @@ const (
113113

114114
// MainnetGethArguments are the arguments to start a mainnet geth instance.
115115
MainnetGethArguments = `--config=/app/ethereum/geth.toml --gcmode=archive --graphql`
116+
117+
// IncludeMempoolCoins does not apply to rosetta-ethereum as it is not UTXO-based.
118+
IncludeMempoolCoins = false
116119
)
117120

118121
var (
119122
// TestnetGethArguments are the arguments to start a ropsten geth instance.
120123
TestnetGethArguments = fmt.Sprintf("%s --ropsten", MainnetGethArguments)
121124

122-
// MiddlewareVersion is the version of rosetta-ethereum.
123-
MiddlewareVersion = "0.0.1"
124-
125125
// MainnetGenesisBlockIdentifier is the *types.BlockIdentifier
126126
// of the mainnet genesis block.
127127
MainnetGenesisBlockIdentifier = &types.BlockIdentifier{

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module github.com/coinbase/rosetta-ethereum
22

33
require (
44
github.com/OneOfOne/xxhash v1.2.5 // indirect
5-
github.com/coinbase/rosetta-sdk-go v0.5.9
6-
github.com/ethereum/go-ethereum v1.9.23
5+
github.com/coinbase/rosetta-sdk-go v0.6.1
6+
github.com/ethereum/go-ethereum v1.9.24
77
github.com/fatih/color v1.10.0
88
github.com/go-kit/kit v0.9.0 // indirect
99
github.com/spf13/cobra v1.1.1

go.sum

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+
8383
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
8484
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
8585
github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U=
86-
github.com/coinbase/rosetta-sdk-go v0.5.9 h1:CuGQE3HFmYwdEACJnuOtVI9cofqPsGvq6FdFIzaOPKI=
87-
github.com/coinbase/rosetta-sdk-go v0.5.9/go.mod h1:xd4wYUhV3LkY78SPH8BUhc88rXfn2jYgN9BfiSjbcvM=
86+
github.com/coinbase/rosetta-sdk-go v0.6.1 h1:aOb5qstlX0uqP9HRC7wCY+YAZDzZbS2C/i3Qy/lR3xM=
87+
github.com/coinbase/rosetta-sdk-go v0.6.1/go.mod h1:t36UuaD4p2DSXaSH9IwMasZDJ7UPxt9cQi6alS5OPTo=
8888
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
8989
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
9090
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
@@ -124,12 +124,10 @@ github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c h1:JHHhtb9XWJrGNMcr
124124
github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
125125
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
126126
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
127-
github.com/ethereum/go-ethereum v1.9.23 h1:SIKhg/z4Q7AbvqcxuPYvMxf36che/Rq/Pp0IdYEkbtw=
128-
github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM=
127+
github.com/ethereum/go-ethereum v1.9.24 h1:6AK+ORt3EMDO+FTjzXy/AQwHMbu52J2nYHIjyQX9azQ=
128+
github.com/ethereum/go-ethereum v1.9.24/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM=
129129
github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
130130
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
131-
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
132-
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
133131
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
134132
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
135133
github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc h1:jtW8jbpkO4YirRSyepBOH8E+2HEw6/hKkBvFPwhUN8c=
@@ -264,19 +262,12 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
264262
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
265263
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
266264
github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
267-
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
268-
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
269-
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
270-
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
271265
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
272266
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
273267
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
274268
github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
275269
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
276270
github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
277-
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
278-
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
279-
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
280271
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
281272
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
282273
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
@@ -393,6 +384,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D6
393384
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM=
394385
github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws=
395386
github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
387+
github.com/tidwall/gjson v1.6.3 h1:aHoiiem0dr7GHkW001T1SMTJ7X5PvyekH5WX0whWGnI=
388+
github.com/tidwall/gjson v1.6.3/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
396389
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
397390
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
398391
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
@@ -496,7 +489,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h
496489
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
497490
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
498491
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
499-
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
500492
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
501493
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
502494
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -506,7 +498,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w
506498
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
507499
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
508500
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
509-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
510501
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
511502
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
512503
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

services/account_service.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,11 @@ func (s *AccountAPIService) AccountBalance(
5959

6060
return balanceResponse, nil
6161
}
62+
63+
// AccountCoins implements /account/coins.
64+
func (s *AccountAPIService) AccountCoins(
65+
ctx context.Context,
66+
request *types.AccountCoinsRequest,
67+
) (*types.AccountCoinsResponse, *types.Error) {
68+
return nil, wrapErr(ErrUnimplemented, nil)
69+
}

0 commit comments

Comments
 (0)