Skip to content

Commit

Permalink
AvalancheGo@v1.10.15 (#227)
Browse files Browse the repository at this point in the history
* update version

* remove factory

* remove factory from postman
  • Loading branch information
patrick-ogrady authored Nov 6, 2023
1 parent c6a1695 commit ec40e16
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DOCKER_ORG ?= avaplatform
DOCKER_IMAGE ?= ${DOCKER_ORG}/${PROJECT}
DOCKER_LABEL ?= latest
DOCKER_TAG ?= ${DOCKER_IMAGE}:${DOCKER_LABEL}
AVALANCHE_VERSION ?= v1.10.13
AVALANCHE_VERSION ?= v1.10.15

build:
export CGO_CFLAGS="-O -D__BLST_PORTABLE__" && go build -o ./rosetta-server ./cmd/server
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/ava-labs/avalanche-rosetta
go 1.20

require (
github.com/ava-labs/avalanchego v1.10.13
github.com/ava-labs/coreth v0.12.6-rc.2
github.com/ava-labs/avalanchego v1.10.15
github.com/ava-labs/coreth v0.12.8-rc.1
github.com/coinbase/rosetta-sdk-go v0.6.5
github.com/ethereum/go-ethereum v1.12.0
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.14.0
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df
golang.org/x/sync v0.3.0
)

Expand Down Expand Up @@ -78,7 +78,7 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/fasthash v1.0.3 // indirect
Expand Down
19 changes: 10 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
Expand All @@ -73,10 +73,10 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.10.13 h1:LJQoV20Rw1/D/anP7RTTTmzgvwzx3DKEfe1BZp3Szxg=
github.com/ava-labs/avalanchego v1.10.13/go.mod h1:tbPGmDognRVE/6xqqal/fszBZlr0jyll3KXXO/7cuqo=
github.com/ava-labs/coreth v0.12.6-rc.2 h1:5P9/i3h6g2uUYf6BVhG8YrV6iqhov6vRxph6cvuKpvU=
github.com/ava-labs/coreth v0.12.6-rc.2/go.mod h1:sNbwitXv4AhLvWpSqy6V8yzkhGFeWBQFD31/xiRDJ5M=
github.com/ava-labs/avalanchego v1.10.15 h1:GQ1bkwgKnv5D/yUwXUjWPFqx1cWrf35WOaHSykHUXyE=
github.com/ava-labs/avalanchego v1.10.15/go.mod h1:fHTzxKZOMdM0n4EEXDDR0V3Ieb/Jnz7PM8zAsJRsh2U=
github.com/ava-labs/coreth v0.12.8-rc.1 h1:tvJcxQTQzxIQqx8TnrxdyMhZYbdsMaiy6AEiOyjvaa4=
github.com/ava-labs/coreth v0.12.8-rc.1/go.mod h1:GBH5SxHZdScSp95IijDs9+Gxw/QDIWvfoLKiJMNYLsE=
github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
Expand Down Expand Up @@ -218,7 +218,7 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
Expand Down Expand Up @@ -544,8 +544,9 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
Expand Down Expand Up @@ -713,8 +714,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg=
golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down
3 changes: 1 addition & 2 deletions postman/test_signing_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ func parsePrivateKeyString(keyStr string) (*secp256k1.PrivateKey, *secp256k1.Pub
if err != nil {
return nil, nil, err
}
factory := secp256k1.Factory{}
key, err := factory.ToPrivateKey(pkBytes)
key, err := secp256k1.ToPrivateKey(pkBytes)
if err != nil {
return nil, nil, err
}
Expand Down
3 changes: 0 additions & 3 deletions service/backend/cchainatomictx/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cchainatomictx
import (
"github.com/ava-labs/avalanchego/codec"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/crypto/secp256k1"
"github.com/ava-labs/coreth/plugin/evm"
"github.com/coinbase/rosetta-sdk-go/types"

Expand All @@ -19,7 +18,6 @@ var (
)

type Backend struct {
fac *secp256k1.Factory
avalancheNetworkID uint32
cClient client.Client
getUTXOsPageSize uint32
Expand All @@ -31,7 +29,6 @@ type Backend struct {
// NewBackend creates a C-chain atomic transaction service backend
func NewBackend(cClient client.Client, avaxAssetID ids.ID, avalancheNetworkID uint32) *Backend {
return &Backend{
fac: &secp256k1.Factory{},
avalancheNetworkID: avalancheNetworkID,
cClient: cClient,
getUTXOsPageSize: 1024,
Expand Down
2 changes: 1 addition & 1 deletion service/backend/cchainatomictx/construction.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (

// ConstructionDerive implements /construction/derive endpoint for C-chain atomic transactions
func (b *Backend) ConstructionDerive(_ context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) {
return common.DeriveBech32Address(b.fac, constants.CChain, req)
return common.DeriveBech32Address(constants.CChain, req)
}

// ConstructionPreprocess implements /construction/preprocess endpoint for C-chain atomic transactions
Expand Down
4 changes: 2 additions & 2 deletions service/backend/common/construction.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var (
)

// DeriveBech32Address derives Bech32 addresses for the given chain using public key and hrp provided in the request
func DeriveBech32Address(fac *secp256k1.Factory, chainIDAlias constants.ChainIDAlias, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) {
pub, err := fac.ToPublicKey(req.PublicKey.Bytes)
func DeriveBech32Address(chainIDAlias constants.ChainIDAlias, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) {
pub, err := secp256k1.ToPublicKey(req.PublicKey.Bytes)
if err != nil {
return nil, service.WrapError(service.ErrInvalidInput, err)
}
Expand Down
3 changes: 0 additions & 3 deletions service/backend/pchain/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pchain
import (
"github.com/ava-labs/avalanchego/codec"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/crypto/secp256k1"
"github.com/ava-labs/avalanchego/vms/platformvm/block"
"github.com/coinbase/rosetta-sdk-go/types"

Expand All @@ -25,7 +24,6 @@ var (

type Backend struct {
genesisHandler
fac *secp256k1.Factory
networkID *types.NetworkIdentifier
networkHRP string
avalancheNetworkID uint32
Expand Down Expand Up @@ -54,7 +52,6 @@ func NewBackend(

b := &Backend{
genesisHandler: genHandler,
fac: &secp256k1.Factory{},
networkID: networkIdentifier,
pClient: pClient,
getUTXOsPageSize: 1024,
Expand Down
2 changes: 1 addition & 1 deletion service/backend/pchain/construction.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (

// ConstructionDerive implements /construction/derive endpoint for P-chain
func (b *Backend) ConstructionDerive(_ context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) {
return common.DeriveBech32Address(b.fac, constants.PChain, req)
return common.DeriveBech32Address(constants.PChain, req)
}

// ConstructionPreprocess implements /construction/preprocess endpoint for P-chain
Expand Down
2 changes: 1 addition & 1 deletion service/rosetta.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ var NodeVersion = fmt.Sprintf(
)

const (
MiddlewareVersion = "0.1.36"
MiddlewareVersion = "0.1.37"
BlockchainName = "Avalanche"
)

0 comments on commit ec40e16

Please sign in to comment.