forked from TrueCloudLab/frostfs-node
[#833] Upgrade Neo Go and NeoFS API Go libraries
Upgrade Neo Go lib to release v0.97.3. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
96a65df32b
commit
3929f6b396
5 changed files with 18 additions and 26 deletions
8
go.mod
8
go.mod
|
@ -10,8 +10,8 @@ require (
|
||||||
github.com/mr-tron/base58 v1.2.0
|
github.com/mr-tron/base58 v1.2.0
|
||||||
github.com/multiformats/go-multiaddr v0.4.0
|
github.com/multiformats/go-multiaddr v0.4.0
|
||||||
github.com/nspcc-dev/hrw v1.0.9
|
github.com/nspcc-dev/hrw v1.0.9
|
||||||
github.com/nspcc-dev/neo-go v0.97.1
|
github.com/nspcc-dev/neo-go v0.97.3
|
||||||
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929081312-010b1b011827
|
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929152813-0117e90e9adb
|
||||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20210520210714-9dee13f0d556
|
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20210520210714-9dee13f0d556
|
||||||
github.com/nspcc-dev/tzhash v1.4.0
|
github.com/nspcc-dev/tzhash v1.4.0
|
||||||
github.com/panjf2000/ants/v2 v2.4.0
|
github.com/panjf2000/ants/v2 v2.4.0
|
||||||
|
@ -24,11 +24,7 @@ require (
|
||||||
go.etcd.io/bbolt v1.3.6
|
go.etcd.io/bbolt v1.3.6
|
||||||
go.uber.org/atomic v1.9.0
|
go.uber.org/atomic v1.9.0
|
||||||
go.uber.org/zap v1.18.1
|
go.uber.org/zap v1.18.1
|
||||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b // indirect
|
|
||||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
|
||||||
golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4
|
golang.org/x/term v0.0.0-20210429154555-c04ba851c2a4
|
||||||
golang.org/x/text v0.3.7 // indirect
|
|
||||||
google.golang.org/genproto v0.0.0-20210928142010-c7af6a1a74c9 // indirect
|
|
||||||
google.golang.org/grpc v1.41.0
|
google.golang.org/grpc v1.41.0
|
||||||
google.golang.org/protobuf v1.27.1
|
google.golang.org/protobuf v1.27.1
|
||||||
)
|
)
|
||||||
|
|
10
go.sum
10
go.sum
|
@ -383,6 +383,8 @@ github.com/nspcc-dev/dbft v0.0.0-20200219114139-199d286ed6c1/go.mod h1:O0qtn62pr
|
||||||
github.com/nspcc-dev/dbft v0.0.0-20200711144034-c526ccc6f570/go.mod h1:1FYQXSbb6/9HQIkoF8XO7W/S8N7AZRkBsgwbcXRvk0E=
|
github.com/nspcc-dev/dbft v0.0.0-20200711144034-c526ccc6f570/go.mod h1:1FYQXSbb6/9HQIkoF8XO7W/S8N7AZRkBsgwbcXRvk0E=
|
||||||
github.com/nspcc-dev/dbft v0.0.0-20210302103605-cc75991b7cfb/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
|
github.com/nspcc-dev/dbft v0.0.0-20210302103605-cc75991b7cfb/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
|
||||||
github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
|
github.com/nspcc-dev/dbft v0.0.0-20210721160347-1b03241391ac/go.mod h1:U8MSnEShH+o5hexfWJdze6uMFJteP0ko7J2frO7Yu1Y=
|
||||||
|
github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02 h1:JgRx27vfGw5WV5QbaNDy0iy2WD1XJO964wwAapaYKLg=
|
||||||
|
github.com/nspcc-dev/go-ordered-json v0.0.0-20210915112629-e1b6cce73d02/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U=
|
||||||
github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y=
|
github.com/nspcc-dev/hrw v1.0.9 h1:17VcAuTtrstmFppBjfRiia4K2wA/ukXZhLFS8Y8rz5Y=
|
||||||
github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU=
|
github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkPG06MU=
|
||||||
github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg=
|
github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg=
|
||||||
|
@ -390,13 +392,13 @@ github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5
|
||||||
github.com/nspcc-dev/neo-go v0.95.0/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c=
|
github.com/nspcc-dev/neo-go v0.95.0/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c=
|
||||||
github.com/nspcc-dev/neo-go v0.95.1/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c=
|
github.com/nspcc-dev/neo-go v0.95.1/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c=
|
||||||
github.com/nspcc-dev/neo-go v0.95.3/go.mod h1:t15xRFDVhz5o/pstptdoW9N9JJBNn1hZ6APMNiC6MrY=
|
github.com/nspcc-dev/neo-go v0.95.3/go.mod h1:t15xRFDVhz5o/pstptdoW9N9JJBNn1hZ6APMNiC6MrY=
|
||||||
github.com/nspcc-dev/neo-go v0.97.1 h1:AMlQrRZOwEM3/NcQPuaSHP6x3CImYDXsSD+neGN590g=
|
github.com/nspcc-dev/neo-go v0.97.3 h1:qui/ZYJhga14UwFwrLJj+8t/ms8enTSUwBxKAsjlIes=
|
||||||
github.com/nspcc-dev/neo-go v0.97.1/go.mod h1:yguwQBpWMTHx07INKoElJT8Gga1LUdTSi0gT75ywJ68=
|
github.com/nspcc-dev/neo-go v0.97.3/go.mod h1:31LelE8G5NZwGmePCykqui6BpPyEklTVbOvEh5xEvz8=
|
||||||
github.com/nspcc-dev/neofs-api-go v1.24.0/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8=
|
github.com/nspcc-dev/neofs-api-go v1.24.0/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8=
|
||||||
github.com/nspcc-dev/neofs-api-go v1.26.1/go.mod h1:SHuH1Ba3U/h3j+8HHbb3Cns1LfMlEb88guWog9Qi68Y=
|
github.com/nspcc-dev/neofs-api-go v1.26.1/go.mod h1:SHuH1Ba3U/h3j+8HHbb3Cns1LfMlEb88guWog9Qi68Y=
|
||||||
github.com/nspcc-dev/neofs-api-go v1.27.1/go.mod h1:i0Cwgvcu9A4M4e58pydbXFisUhSxpfljmuWFPIp2btE=
|
github.com/nspcc-dev/neofs-api-go v1.27.1/go.mod h1:i0Cwgvcu9A4M4e58pydbXFisUhSxpfljmuWFPIp2btE=
|
||||||
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929081312-010b1b011827 h1:FBPEP4kOEkXmx4codT/0HkIHRGJ+mnub3nWtfsb24EY=
|
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929152813-0117e90e9adb h1:634hGE+KGXakNRkgB83rUoJEB4MWkfsiKCD4LrS3XOc=
|
||||||
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929081312-010b1b011827/go.mod h1:CAeWsIt2BKrg3Gty80ogQNXnFVpJt18k55AOOlzssBw=
|
github.com/nspcc-dev/neofs-api-go v1.29.1-0.20210929152813-0117e90e9adb/go.mod h1:KC8T91skIg8juvUh7lQabswQ9J6KmnXErpH8qwDitXA=
|
||||||
github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA=
|
github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA=
|
||||||
github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
|
github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw=
|
||||||
github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM=
|
github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM=
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
"github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response"
|
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/morph/subscriber"
|
"github.com/nspcc-dev/neofs-node/pkg/morph/subscriber"
|
||||||
|
@ -189,7 +189,7 @@ func (l listener) listenLoop(ctx context.Context, chEvent <-chan *state.Notifica
|
||||||
var (
|
var (
|
||||||
blockChan <-chan *block.Block
|
blockChan <-chan *block.Block
|
||||||
|
|
||||||
notaryChan <-chan *response.NotaryRequestEvent
|
notaryChan <-chan *subscriptions.NotaryRequestEvent
|
||||||
|
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
@ -349,7 +349,7 @@ func (l listener) parseAndHandleNotification(notifyEvent *state.NotificationEven
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l listener) parseAndHandleNotary(nr *response.NotaryRequestEvent) {
|
func (l listener) parseAndHandleNotary(nr *subscriptions.NotaryRequestEvent) {
|
||||||
// prepare the notary event
|
// prepare the notary event
|
||||||
notaryEvent, err := l.notaryEventsPreparator.Prepare(nr.NotaryRequest)
|
notaryEvent, err := l.notaryEventsPreparator.Prepare(nr.NotaryRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package event
|
package event
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/vm"
|
"github.com/nspcc-dev/neo-go/pkg/vm"
|
||||||
|
@ -28,9 +27,6 @@ var (
|
||||||
dummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64}, make([]byte, 64)...)
|
dummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64}, make([]byte, 64)...)
|
||||||
wrongDummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64, 1}, make([]byte, 63)...)
|
wrongDummyInvocationScript = append([]byte{byte(opcode.PUSHDATA1), 64, 1}, make([]byte, 63)...)
|
||||||
|
|
||||||
contractSysCall = make([]byte, 4)
|
|
||||||
wrongContractSysCall = make([]byte, 4)
|
|
||||||
|
|
||||||
scriptHash util.Uint160
|
scriptHash util.Uint160
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -45,9 +41,6 @@ func init() {
|
||||||
|
|
||||||
wrongAlphaKeys = keys.PublicKeys{wrongPub}
|
wrongAlphaKeys = keys.PublicKeys{wrongPub}
|
||||||
|
|
||||||
binary.LittleEndian.PutUint32(contractSysCall, interopnames.ToID([]byte(interopnames.SystemContractCall)))
|
|
||||||
binary.LittleEndian.PutUint32(wrongContractSysCall, interopnames.ToID([]byte(interopnames.SystemCallbackInvoke)))
|
|
||||||
|
|
||||||
scriptHash, _ = util.Uint160DecodeStringLE("21fce15191428e9c2f0e8d0329ff6d3dd14882de")
|
scriptHash, _ = util.Uint160DecodeStringLE("21fce15191428e9c2f0e8d0329ff6d3dd14882de")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +67,7 @@ func TestPrepare_IncorrectScript(t *testing.T) {
|
||||||
emit.Int(bw.BinWriter, 4)
|
emit.Int(bw.BinWriter, 4)
|
||||||
emit.String(bw.BinWriter, "test")
|
emit.String(bw.BinWriter, "test")
|
||||||
emit.Bytes(bw.BinWriter, scriptHash.BytesBE())
|
emit.Bytes(bw.BinWriter, scriptHash.BytesBE())
|
||||||
emit.Syscall(bw.BinWriter, interopnames.SystemCallbackInvoke)
|
emit.Syscall(bw.BinWriter, interopnames.SystemContractCallNative) // any != interopnames.SystemContractCall
|
||||||
|
|
||||||
nr := correctNR(bw.Bytes())
|
nr := correctNR(bw.Bytes())
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
"github.com/nspcc-dev/neo-go/pkg/core/state"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpc/client"
|
"github.com/nspcc-dev/neo-go/pkg/rpc/client"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/rpc/response"
|
"github.com/nspcc-dev/neo-go/pkg/rpc/response"
|
||||||
|
"github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
@ -21,7 +22,7 @@ type (
|
||||||
SubscribeForNotification(...util.Uint160) (<-chan *state.NotificationEvent, error)
|
SubscribeForNotification(...util.Uint160) (<-chan *state.NotificationEvent, error)
|
||||||
UnsubscribeForNotification()
|
UnsubscribeForNotification()
|
||||||
BlockNotifications() (<-chan *block.Block, error)
|
BlockNotifications() (<-chan *block.Block, error)
|
||||||
SubscribeForNotaryRequests(mainTXSigner util.Uint160) (<-chan *response.NotaryRequestEvent, error)
|
SubscribeForNotaryRequests(mainTXSigner util.Uint160) (<-chan *subscriptions.NotaryRequestEvent, error)
|
||||||
Close()
|
Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ type (
|
||||||
|
|
||||||
blockChan chan *block.Block
|
blockChan chan *block.Block
|
||||||
|
|
||||||
notaryChan chan *response.NotaryRequestEvent
|
notaryChan chan *subscriptions.NotaryRequestEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
// Params is a group of Subscriber constructor parameters.
|
// Params is a group of Subscriber constructor parameters.
|
||||||
|
@ -116,7 +117,7 @@ func (s *subscriber) BlockNotifications() (<-chan *block.Block, error) {
|
||||||
return s.blockChan, nil
|
return s.blockChan, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *subscriber) SubscribeForNotaryRequests(mainTXSigner util.Uint160) (<-chan *response.NotaryRequestEvent, error) {
|
func (s *subscriber) SubscribeForNotaryRequests(mainTXSigner util.Uint160) (<-chan *subscriptions.NotaryRequestEvent, error) {
|
||||||
if _, err := s.client.SubscribeForNotaryRequests(nil, &mainTXSigner); err != nil {
|
if _, err := s.client.SubscribeForNotaryRequests(nil, &mainTXSigner); err != nil {
|
||||||
return nil, fmt.Errorf("could not subscribe for notary request events: %w", err)
|
return nil, fmt.Errorf("could not subscribe for notary request events: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -157,7 +158,7 @@ func (s *subscriber) routeNotifications(ctx context.Context) {
|
||||||
|
|
||||||
s.blockChan <- b
|
s.blockChan <- b
|
||||||
case response.NotaryRequestEventID:
|
case response.NotaryRequestEventID:
|
||||||
notaryRequest, ok := notification.Value.(*response.NotaryRequestEvent)
|
notaryRequest, ok := notification.Value.(*subscriptions.NotaryRequestEvent)
|
||||||
if !ok {
|
if !ok {
|
||||||
s.log.Error("can't cast notify event value to the notary request struct")
|
s.log.Error("can't cast notify event value to the notary request struct")
|
||||||
continue
|
continue
|
||||||
|
@ -209,7 +210,7 @@ func New(ctx context.Context, p *Params) (Subscriber, error) {
|
||||||
notifyChan: make(chan *state.NotificationEvent),
|
notifyChan: make(chan *state.NotificationEvent),
|
||||||
notifyIDs: make(map[util.Uint160]string),
|
notifyIDs: make(map[util.Uint160]string),
|
||||||
blockChan: make(chan *block.Block),
|
blockChan: make(chan *block.Block),
|
||||||
notaryChan: make(chan *response.NotaryRequestEvent),
|
notaryChan: make(chan *subscriptions.NotaryRequestEvent),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Worker listens all events from neo-go websocket and puts them
|
// Worker listens all events from neo-go websocket and puts them
|
||||||
|
|
Loading…
Reference in a new issue