diff --git a/.gitignore b/.gitignore index b1d2b82f..76f5d7df 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,5 @@ server *.out # Dependency directories (remove the comment below to include it) -# vendor/ -.idea - -keystore/* \ No newline at end of file +vendor/ +.idea \ No newline at end of file diff --git a/bus/redis.go b/bus/redis.go index 98020971..472ebb02 100644 --- a/bus/redis.go +++ b/bus/redis.go @@ -21,8 +21,8 @@ import ( "fmt" "github.com/go-redis/redis/v8" - "github.com/polynetwork/bridge-common/util" "github.com/polynetwork/bridge-common/log" + "github.com/polynetwork/bridge-common/util" ) type RedisConn struct { diff --git a/config.devnet.poly-starcoin.conf.json b/config.devnet.poly-starcoin.conf.json new file mode 100644 index 00000000..00058add --- /dev/null +++ b/config.devnet.poly-starcoin.conf.json @@ -0,0 +1,75 @@ +{ + "Env": "testnet", + "Bus": { + "HeightUpdateInterval": 1, + "Config": { + "Addr": "127.0.0.1:6379", + "DB": 2 + } + }, + "log": { + "Path": "./logs" + }, + "BoltPath": "boltdb.bin", + "Poly": { + "Nodes": [ + "http://43.163.197.59:22002" + ], + "Wallet": { + "KeyStoreProviders": [ + { + "Passwords": { + "0xd2eb785623a96592b223df9a37a2397c9dfcedb4": "pass1" + }, + "Path": "./keystore/poly" + } + ] + }, + "Signer": { + "KeyStoreProviders": [ + { + "Passwords": { + "0xd2eb785623a96592b223df9a37a2397c9dfcedb4": "pass1" + }, + "Path": "./keystore/signer" + } + ] + }, + "PolyTxSync": { + "Enabled": false + } + }, + "Chains": { + "318": { + "Nodes": [ + "https://proxima-seed.starcoin.org" + ], + "CheckFee": false, + "CCMContract": "0xf8ea2d94b8a7d83ace33bb56731268e0", + "CCDContract": "", + "Wallet": { + "Address": "0xf8ea2d94b8a7d83ace33bb56731268e0", + "PrivateKey": "4070faabb6492000697c7d6192ab2a3f198c551f764c56c2eb88761ecabbffe0" + } + } + }, + "Host": "", + "Port": 6601, + "ValidMethods": [ + "mint", + "burn", + "unwrap", + "add", + "remove", + "swap", + "unlock", + "addExtension", + "removeExtension", + "registerAsset", + "onCrossTransfer" + ], + "Bridge": [ + "https://bridge.poly.network/testnet/v1" + ] +} + diff --git a/config.devnet.poly-starcoin.roles.json b/config.devnet.poly-starcoin.roles.json new file mode 100644 index 00000000..c4ab22c3 --- /dev/null +++ b/config.devnet.poly-starcoin.roles.json @@ -0,0 +1,9 @@ +{ + "318": { + "PolyCommit": true, + "EpochSync": true + }, + "0": { + "PolyListen": true + } +} \ No newline at end of file diff --git a/config.devnet.starcoin-poly.conf.json b/config.devnet.starcoin-poly.conf.json new file mode 100644 index 00000000..100bcd20 --- /dev/null +++ b/config.devnet.starcoin-poly.conf.json @@ -0,0 +1,74 @@ +{ + "Env": "testnet", + "BoltPath": "boltdb.bin", + "Poly": { + "Nodes": [ + "http://43.163.197.59:22002" + ], + "Wallet": { + "KeyStoreProviders": [ + { + "Passwords": { + "0xd2eb785623a96592b223df9a37a2397c9dfcedb4": "pass1" + }, + "Path": "./keystore/poly" + } + ] + }, + "Signer": { + "KeyStoreProviders": [ + { + "Passwords": { + "0xd2eb785623a96592b223df9a37a2397c9dfcedb4": "pass1" + }, + "Path": "./keystore/poly" + } + ] + }, + "PolyTxSync": { + "Enabled": false + } + }, + "Chains": { + "318": { + "Nodes": [ + "https://proxima-seed.starcoin.org" + ], + "CCMContract": "0xf8ea2d94b8a7d83ace33bb56731268e0", + "CrossChainEventCreationNum": "6", + "TxVote": { + "StartHeight": 937, + "Poly": { + "Wallet": { + "KeyStoreProviders": [ + { + "Passwords": { + "0xd2eb785623a96592b223df9a37a2397c9dfcedb4": "pass1" + }, + "Path": "./keystore/poly" + } + ] + } + } + } + } + }, + "Host": "", + "Port": 6601, + "ValidMethods": [ + "mint", + "burn", + "unwrap", + "add", + "remove", + "swap", + "unlock", + "addExtension", + "removeExtension", + "registerAsset", + "onCrossTransfer" + ], + "Bridge": [ + "https://bridge.poly.network/testnet/v1" + ] +} diff --git a/config.devnet.starcoin-poly.roles.json b/config.devnet.starcoin-poly.roles.json new file mode 100644 index 00000000..81494221 --- /dev/null +++ b/config.devnet.starcoin-poly.roles.json @@ -0,0 +1,5 @@ +{ + "318": { + "TxVote": true + } +} \ No newline at end of file diff --git a/config/config.go b/config/config.go index fd6a12ef..c349cbd8 100644 --- a/config/config.go +++ b/config/config.go @@ -130,6 +130,7 @@ type ChainConfig struct { CCMContract string CCDContract string CrossChainEventCreationNum string // Aptos + MultiSignAccount string // Ripple ListenCheck int CheckFee bool Defer int @@ -155,6 +156,7 @@ type ListenerConfig struct { CCMContract string CCDContract string CrossChainEventCreationNum string // Aptos + MultiSignAccount string // Ripple ListenCheck int Bus *BusConfig Defer int @@ -581,6 +583,9 @@ func (c *ChainConfig) FillListener(o *ListenerConfig, bus *BusConfig) *ListenerC if o.CrossChainEventCreationNum == "" { o.CrossChainEventCreationNum = c.CrossChainEventCreationNum } + if o.MultiSignAccount == "" { + o.MultiSignAccount = c.MultiSignAccount + } if len(o.LockProxyContract) == 0 { o.LockProxyContract = c.LockProxyContract } diff --git a/go.mod b/go.mod index 3ae1d84c..086487af 100644 --- a/go.mod +++ b/go.mod @@ -6,16 +6,18 @@ require ( github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20210927032600-4c733f2cb879 github.com/boltdb/bolt v1.3.1 github.com/btcsuite/btcd v0.22.1 - github.com/devfans/zion-sdk v0.0.24 + github.com/devfans/zion-sdk v0.0.27 github.com/ethereum/go-ethereum v1.10.11 github.com/go-redis/redis/v8 v8.11.3 github.com/joeqian10/neo3-gogogo v1.2.1 github.com/ontio/ontology v1.11.1-0.20200812075204-26cf1fa5dd47 github.com/ontio/ontology-crypto v1.2.1 github.com/ontio/ontology-go-sdk v1.11.4 - github.com/polynetwork/bridge-common v0.0.36-2 + github.com/polynetwork/bridge-common v0.0.39-2 github.com/polynetwork/ripple-sdk v0.0.0-20220616022641-d64d4aa053fe github.com/portto/aptos-go-sdk v0.0.0-20230118094238-99813673238c + github.com/starcoinorg/starcoin-go v0.0.0-20220821052347-0e482a42c59e + github.com/rubblelabs/ripple v0.0.0-20220222071018-38c1a8b14c18 github.com/tendermint/tendermint v0.35.9 github.com/urfave/cli/v2 v2.3.0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa diff --git a/go.sum b/go.sum index 71f5c262..89587feb 100644 --- a/go.sum +++ b/go.sum @@ -74,7 +74,6 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJc github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -91,7 +90,6 @@ github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= @@ -110,12 +108,9 @@ github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -127,15 +122,12 @@ github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= -github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20210927032600-4c733f2cb879 h1:/OXqInjRm8CEd81EEFCGJ5Q24TTlY1/qu6DQ0D91WPA= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20210927032600-4c733f2cb879/go.mod h1:XLd05IRvH+nQt2lLvW6I2pfWBtRYE4i8Tpx45xBrlUE= -github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= @@ -149,7 +141,6 @@ github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cv github.com/alingse/asasalint v0.0.10/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= -github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -157,8 +148,6 @@ github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQY github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -167,17 +156,13 @@ github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4 github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -202,6 +187,7 @@ github.com/bits-and-blooms/bitset v1.2.1/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edY github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/blocktree/go-owcrypt v1.1.10 h1:eQhxJnUt265LUHJYbPHn9Cw76THir7lv8cWeW2Mtl8s= github.com/blocktree/go-owcrypt v1.1.10/go.mod h1:n98+UALIX82e7jhNvfYcG9pz3cDGO026EjslMrqgNvc= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= @@ -212,7 +198,6 @@ github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92 github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= @@ -221,7 +206,6 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= @@ -232,22 +216,19 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/buf v1.3.1/go.mod h1:CTRUb23N+zlm1U8ZIBKz0Sqluk++qQloB2i/MZNZHIs= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= -github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= @@ -264,7 +245,6 @@ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2u github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= @@ -281,11 +261,9 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -297,7 +275,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -311,7 +288,6 @@ github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+ github.com/creachadair/tomledit v0.0.22/go.mod h1:cIu/4x5L855oSRejIqr+WRFh+mv9g4fWLiUFaApYn/Y= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -329,11 +305,9 @@ github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0 github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= -github.com/devfans/zion-sdk v0.0.12/go.mod h1:FvNiMLw6IubOOYQ5waar5hwNV5nNrZ/45EyskL75NoI= -github.com/devfans/zion-sdk v0.0.24 h1:F9Dt6nnDoGTH8ex1BrjCz4xwmo9lac9VUouIfTrHS1w= -github.com/devfans/zion-sdk v0.0.24/go.mod h1:FvNiMLw6IubOOYQ5waar5hwNV5nNrZ/45EyskL75NoI= +github.com/devfans/zion-sdk v0.0.27 h1:u72PnebVKEmpI06Y9JSA/EPt8GKvfHuqh1ejcvuKAiY= +github.com/devfans/zion-sdk v0.0.27/go.mod h1:FvNiMLw6IubOOYQ5waar5hwNV5nNrZ/45EyskL75NoI= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de h1:t0UHb5vdojIDUqktM6+xJAfScFBsVpXZmqC9dsgJmeA= @@ -350,15 +324,11 @@ github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwu github.com/dlespiau/covertool v0.0.0-20180314162135-b0c4c6d0583a/go.mod h1:/eQMcW3eA1bzKx23ZYI2H3tXPdJB5JWYTHzoUPBvQY4= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.17+incompatible h1:JYCuMrWaVNophQTOrMMoSwudOVEfcegoZZrleKc1xwE= github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= @@ -367,6 +337,7 @@ github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA github.com/drand/bls12-381 v0.3.2/go.mod h1:dtcLgPtYT38L3NO6mPDYH0nbpc5tjPassDqiniuAt4Y= github.com/drand/kyber v1.0.1-0.20200110225416-8de27ed8c0e2/go.mod h1:UpXoA0Upd1N9l4TvRPHr1qAUBBERj6JQ/mnKI3BPEmw= github.com/drand/kyber v1.0.2/go.mod h1:x6KOpK7avKj0GJ4emhXFP5n7M7W7ChAPmnQh/OL6vRw= +github.com/drand/kyber v1.1.4 h1:YvKM03QWGvLrdTnYmxxP5iURAX+Gdb6qRDUOgg8i60Q= github.com/drand/kyber v1.1.4/go.mod h1:9+IgTq7kadePhZg7eRwSD7+bA+bmvqRK+8DtmoV5a3U= github.com/drand/kyber-bls12381 v0.2.0/go.mod h1:zQip/bHdeEB6HFZSU3v+d3cQE0GaBVQw9aR2E7AdoeI= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -383,7 +354,6 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -404,11 +374,8 @@ github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8 github.com/ethereum/go-ethereum v1.10.11 h1:KKIcwpmur9iTaVbR2dxlHu+peHVhU+/KX//NWvT1n9U= github.com/ethereum/go-ethereum v1.10.11/go.mod h1:W3yfrFyL9C1pHcwY5hmRHVDaorTiQxhYBkKyu5mEDHw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -423,9 +390,7 @@ github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+ 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/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= @@ -452,7 +417,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -464,12 +428,10 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-redis/redis v6.15.8+incompatible h1:BKZuG6mCnRj5AOaWJXoCgf6rqTYnYJLe4en2hxT7r9o= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCxgt8= github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= @@ -478,7 +440,6 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -500,18 +461,14 @@ github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= @@ -617,7 +574,6 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -642,7 +598,6 @@ github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1: github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -664,7 +619,6 @@ github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/gosuri/uilive v0.0.3/go.mod h1:qkLSc0A5EXSP6B04TrN4oQoxqFI7A8XvoXSlJi8cwk8= github.com/gosuri/uiprogress v0.0.1/go.mod h1:C1RTYn4Sc7iEyf6j8ft5dyoZ4212h8G1ol9QQluh5+0= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= @@ -678,11 +632,9 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= @@ -701,16 +653,13 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -720,13 +669,10 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= @@ -740,7 +686,6 @@ github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c/go.mod h1:lADxMC39cJ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= @@ -753,14 +698,12 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= @@ -801,7 +744,6 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -810,34 +752,10 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= -github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e h1:FdDd7bdI6cjq5vaoYlK1mfQYfF9sF2VZw8VEZMsl5t8= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= -github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098 h1:yrhek184cGp0IRyHg0uV1khLaorNg6GtDLkry4oNNjE= -github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -898,27 +816,20 @@ github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/maratori/testpackage v1.1.0/go.mod h1:PeAhzU8qkCwdGEMTEupsHJNlQu2gZopMC6RjbhmHeDc= -github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= -github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= -github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/matthewhartstonge/argon2 v0.2.1 h1:DFzhPfXcKv4T/ITjoTtEDE/WP1G2eutQBntAzKPtXtc= +github.com/matthewhartstonge/argon2 v0.2.1/go.mod h1:k3jqoN+y0w9Z6uJxIKiJDveAMDUaIBJkC/M2m37q6VM= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -931,7 +842,6 @@ github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZb github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -951,7 +861,6 @@ github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -970,15 +879,11 @@ github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8Rv github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -993,7 +898,6 @@ github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mmcloughlin/avo v0.0.0-20190318053554-7a0eb66183da/go.mod h1:lf5GMZxA5kz8dnCweJuER5Rmbx6dDu6qvw0fO3uYKK8= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1015,16 +919,10 @@ github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0 github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= @@ -1034,15 +932,13 @@ github.com/nishanths/exhaustive v0.8.1/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/ github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/novifinancial/serde-reflection/serde-generate/runtime/golang v0.0.0-20210526181959-1694c58d103e/go.mod h1:NrRYJCFtaewjIRr4B9V2AyWsAEMW0Zqdjs8Bm+bACbM= +github.com/novifinancial/serde-reflection/serde-generate/runtime/golang v0.0.0-20211013011333-6820d5b97d8c h1:ndmhYxhRcK+Q65Z/6EaR/TgHfv/b3Ew0NmzWh2ge/uE= github.com/novifinancial/serde-reflection/serde-generate/runtime/golang v0.0.0-20211013011333-6820d5b97d8c/go.mod h1:NrRYJCFtaewjIRr4B9V2AyWsAEMW0Zqdjs8Bm+bACbM= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b h1:MKwruh+HeCSKWphkxuzvRzU4QzDkg7yiPkDVV0cDFgI= github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b/go.mod h1:TLJifjWF6eotcfzDjKZsDqWJ+73Uvj/N85MvVyrvynM= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -1060,7 +956,6 @@ github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvw github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1086,38 +981,26 @@ github.com/ontio/ontology-go-sdk v1.11.4/go.mod h1:fRhHYhFfYiUuIlTVtcXLVziiXOneB github.com/ontio/wagon v0.4.1 h1:3A8BxTMVGrQnyWxD1h8w5PLvN9GZMWjC75Jw+5Vgpe0= github.com/ontio/wagon v0.4.1/go.mod h1:oTPdgWT7WfPlEyzVaHSn1vQPMSbOpQPv+WphxibWlhg= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= @@ -1129,7 +1012,6 @@ github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= @@ -1139,6 +1021,7 @@ github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCr github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/phoreproject/bls v0.0.0-20200525203911-a88a5ae26844 h1:Yflyn+XFLEu7RPzxovgEVLP6Es8JLJrHqdXunpm2ak4= github.com/phoreproject/bls v0.0.0-20200525203911-a88a5ae26844/go.mod h1:xHJKf2TLXUA39Dhv8k5QmQOxLsbrb1KeTS/3ERfLeqc= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -1158,20 +1041,17 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= -github.com/polynetwork/bridge-common v0.0.36-2 h1:Wxc4F8hTflQ0G48i8Jneld7996Yhdv8ysBoy60zwtFU= -github.com/polynetwork/bridge-common v0.0.36-2/go.mod h1:WtIkm3d7czS3Co2ZM3t4qrPcAbWQIxBnaJgyMVy4Muc= +github.com/polynetwork/bridge-common v0.0.39-2 h1:ctptvaVBpZdpGc0Vm9AiXYBMAN/92Hbo45taVQ6NysU= +github.com/polynetwork/bridge-common v0.0.39-2/go.mod h1:CPcpmKVKppVAs8uK5Rz83zDnTf6BOtIsN6Vs6Pu8jQE= github.com/polynetwork/ripple-sdk v0.0.0-20220616022641-d64d4aa053fe h1:zRVqVMQjEYmIBmh86lJSplt8VSXlC/UJCE+z20WtA2A= github.com/polynetwork/ripple-sdk v0.0.0-20220616022641-d64d4aa053fe/go.mod h1:M5k8xCDpbtYH+Xlac61sMBYhyo770ZeUc0vrJnIQn/g= -github.com/portto/aptos-go-sdk v0.0.0-20221025115549-5c74acafa193/go.mod h1:8+XTYv0iwHE5fjS8G6231LUhy2GYwl2BTlzxIqjIxyU= github.com/portto/aptos-go-sdk v0.0.0-20230118094238-99813673238c h1:5Y9hJ5fqPHdIksng2h+K4+BF1txLKB8DlgGkkuU/YW8= github.com/portto/aptos-go-sdk v0.0.0-20230118094238-99813673238c/go.mod h1:8+XTYv0iwHE5fjS8G6231LUhy2GYwl2BTlzxIqjIxyU= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= @@ -1180,17 +1060,13 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -1198,7 +1074,6 @@ github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1247,7 +1122,6 @@ github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubr github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -1257,7 +1131,6 @@ github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0K github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -1287,7 +1160,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= github.com/sivchari/nosnakecase v1.5.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= @@ -1301,7 +1173,6 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= @@ -1324,21 +1195,18 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/starcoinorg/starcoin-go v0.0.0-20220105024102-530daedc128b/go.mod h1:P9XqzWTePMp9MxrXY9ND/diw388Gk3nUHs/QVaAZnzA= +github.com/starcoinorg/starcoin-go v0.0.0-20220821052347-0e482a42c59e h1:WDZNzkQMiJZrRX83LmiWtFPdNw8yX0dDhigxHlXZ1i0= +github.com/starcoinorg/starcoin-go v0.0.0-20220821052347-0e482a42c59e/go.mod h1:zAQJSejAXUFiHLWthiWAMHLnPY2UAg8//JiMzcpmaBY= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 h1:ju5UTwk5Odtm4trrY+4Ca4RMj5OyXbmVeDAVad2T0Jw= -github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -1420,11 +1288,8 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= @@ -1446,6 +1311,7 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= gitlab.com/bosi/decorder v0.2.2/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= go.dedis.ch/kyber/v3 v3.0.9/go.mod h1:rhNjUUg6ahf8HEg5HUvVBYoWY4boAafX8tYxX+PS+qg= @@ -1456,7 +1322,6 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -1470,8 +1335,6 @@ go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+ go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1503,7 +1366,6 @@ go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1513,7 +1375,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -1539,7 +1400,7 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= @@ -1592,7 +1453,6 @@ golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1600,10 +1460,8 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190326090315-15845e8f865b/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1636,7 +1494,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1710,7 +1567,6 @@ golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1741,7 +1597,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1822,6 +1677,7 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220222160653-b146bcec3beb/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1837,7 +1693,6 @@ golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUN golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1862,7 +1717,6 @@ golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2M golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190106171756-3ef68632349c/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1904,7 +1758,6 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1984,7 +1837,6 @@ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -2027,7 +1879,6 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -2042,7 +1893,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -2127,13 +1977,9 @@ google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= @@ -2186,7 +2032,6 @@ google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscL google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2195,16 +2040,12 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200316214253-d7b0ff38cac9/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= @@ -2214,11 +2055,9 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2236,12 +2075,9 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2253,12 +2089,10 @@ honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.3.2/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= -launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= -pgregory.net/rapid v0.4.8 h1:d+5SGZWUbJPbl3ss6tmPFqnNeQR6VDOFly+eTjwPiEw= pgregory.net/rapid v0.4.8/go.mod h1:Z5PbWqjvWR1I3UGjvboUuan4fe4ZYEYNLNQLExzCoUs= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= @@ -2266,4 +2100,3 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/keystore/poly/d2eb785623a96592b223df9a37a2397c9dfcedb4 b/keystore/poly/d2eb785623a96592b223df9a37a2397c9dfcedb4 new file mode 100644 index 00000000..abde0403 --- /dev/null +++ b/keystore/poly/d2eb785623a96592b223df9a37a2397c9dfcedb4 @@ -0,0 +1 @@ +{"address":"d2eb785623a96592b223df9a37a2397c9dfcedb4","crypto":{"cipher":"aes-128-ctr","ciphertext":"9c79302b78df6ec477783456d3a14cade0d45fccec6eb96314556c9e2efa9d88","cipherparams":{"iv":"523113d6964e973a8f7c64df3ebfd755"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"36c9092ace322339518b9b6cd9b46566ca3a26e071a8addbf8a4cb54a03da08f"},"mac":"f42e24d12ace8980bbe6514dfa0805e93f64572b3ba982b32b38161be92aa1f6"},"id":"52613e94-5d89-4e15-afe4-f1c5874beb5d","version":3} \ No newline at end of file diff --git a/keystore/signer/d2eb785623a96592b223df9a37a2397c9dfcedb4 b/keystore/signer/d2eb785623a96592b223df9a37a2397c9dfcedb4 new file mode 100644 index 00000000..abde0403 --- /dev/null +++ b/keystore/signer/d2eb785623a96592b223df9a37a2397c9dfcedb4 @@ -0,0 +1 @@ +{"address":"d2eb785623a96592b223df9a37a2397c9dfcedb4","crypto":{"cipher":"aes-128-ctr","ciphertext":"9c79302b78df6ec477783456d3a14cade0d45fccec6eb96314556c9e2efa9d88","cipherparams":{"iv":"523113d6964e973a8f7c64df3ebfd755"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"36c9092ace322339518b9b6cd9b46566ca3a26e071a8addbf8a4cb54a03da08f"},"mac":"f42e24d12ace8980bbe6514dfa0805e93f64572b3ba982b32b38161be92aa1f6"},"id":"52613e94-5d89-4e15-afe4-f1c5874beb5d","version":3} \ No newline at end of file diff --git a/msg/errors.go b/msg/errors.go index e7b429db..c25b5e0c 100644 --- a/msg/errors.go +++ b/msg/errors.go @@ -47,4 +47,9 @@ var ( ERR_APTOS_COIN_STORE_NOT_PUBLISHED = errors.New("Account hasn't registered CoinStore for CoinType") ERR_APTOS_TREASURY_NOT_EXIST = errors.New("Asset not exist in lock proxy") ERR_APTOS_SEQUENCE_NUMBER_INVALID = errors.New("Sequence number is invalid") + + // For Starcoin + ERR_STARCOIN_COIN_STORE_NOT_PUBLISHED = errors.New("Account hasn't registered CoinStore for CoinType") + ERR_STARCOIN_TREASURY_NOT_EXIST = errors.New("Asset not exist in lock proxy") + ERR_STARCOIN_SEQUENCE_NUMBER_INVALID = errors.New("Sequence number is invalid") ) diff --git a/msg/event.go b/msg/event.go index ef60a6cb..8e734384 100644 --- a/msg/event.go +++ b/msg/event.go @@ -118,7 +118,6 @@ func (o *BindAssetEvent) Format() (title string, keys []string, values []interfa return } - func ParseInt(value, ty string) (v *big.Int) { switch ty { case "Integer": @@ -142,4 +141,4 @@ func HexStringReverse(value string) string { aa, _ := hex.DecodeString(value) bb := HexReverse(aa) return hex.EncodeToString(bb) -} \ No newline at end of file +} diff --git a/relayer/aptos/listener.go b/relayer/aptos/listener.go index 87ad53e9..d59471ae 100644 --- a/relayer/aptos/listener.go +++ b/relayer/aptos/listener.go @@ -3,6 +3,7 @@ package aptos import ( "context" "encoding/hex" + "fmt" "github.com/polynetwork/bridge-common/base" "github.com/polynetwork/bridge-common/chains" "github.com/polynetwork/bridge-common/chains/aptos" @@ -11,6 +12,7 @@ import ( "github.com/polynetwork/poly-relayer/config" "github.com/polynetwork/poly-relayer/msg" "strconv" + "strings" "time" ) @@ -27,13 +29,6 @@ func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err erro l.name = base.GetChainName(config.ChainId) l.ccm = config.CCMContract l.CrossChainEventCreationNum = config.CrossChainEventCreationNum - //l.poly = poly - - //l.state = bus.NewRedisChainStore( - // bus.ChainHeightKey{ChainId: config.ChainId, Type: bus.KEY_HEIGHT_HEADER}, bus.New(config.Bus.Redis), - // config.Bus.HeightUpdateInterval, - //) - l.sdk, err = aptos.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) return } @@ -120,12 +115,56 @@ func (l *Listener) LastHeaderSync(u uint64, u2 uint64) (uint64, error) { return 0, nil } -func (l *Listener) ScanTx(s string) (*msg.Tx, error) { - return nil, nil // todo +func (l *Listener) ScanTx(hash string) (*msg.Tx, error) { + tx, err := l.sdk.Node().GetTxByHash(hash) + if err != nil { + return nil, err + } + + if !strings.Contains(strings.ToLower(tx.Payload.Function), strings.ToLower(l.ccm)) { + return nil, fmt.Errorf("not Aptos cross chain transaction") + } + + ccEventType := l.ccm + "::cross_chain_manager::CrossChainEvent" + for _, event := range tx.Events { + if event.GUID.AccountAddress != l.ccm { + continue + } + if strconv.FormatUint(uint64(event.GUID.CreationNumber), 10) != l.CrossChainEventCreationNum { + continue + } + if event.Type != ccEventType { + continue + } + + toChainId, _ := strconv.ParseUint(event.Data["to_chain_id"].(string), 0, 32) + + rawData, ok := event.Data["raw_data"] + if !ok { + log.Error("no raw_data in aptos cross chain event", "hash", hash) + continue + } + + t := &msg.Tx{ + TxType: msg.SRC, + TxId: event.Data["tx_id"].(string)[2:], + SrcHash: tx.Hash, + DstChainId: toChainId, + SrcParam: rawData.(string)[2:], + SrcChainId: l.config.ChainId, + CCMEventSequence: uint64(event.SequenceNumber), + SrcProxy: l.ccm, + DstProxy: event.Data["to_contract"].(string), + SrcAddress: event.Data["sender"].(string), + } + return t, nil + } + + return nil, fmt.Errorf("not Aptos cross chain transaction") } -func (l *Listener) GetTxBlock(s string) (uint64, error) { - return 0, nil +func (l *Listener) GetTxBlock(hash string) (uint64, error) { + return l.sdk.Node().GetVersionByTx(hash) } func (l *Listener) Compose(tx *msg.Tx) error { @@ -133,7 +172,7 @@ func (l *Listener) Compose(tx *msg.Tx) error { } func (l *Listener) LatestHeight() (uint64, error) { - panic("implement me") + return l.sdk.Node().GetLatestHeight() } func (l *Listener) WaitTillHeight(ctx context.Context, height uint64, interval time.Duration) (uint64, bool) { diff --git a/relayer/encrypt.go b/relayer/encrypt.go index efd88870..3fc43858 100644 --- a/relayer/encrypt.go +++ b/relayer/encrypt.go @@ -26,21 +26,29 @@ import ( func EncryptFile(ctx *cli.Context) (err error) { file := ctx.String("file") data, err := ioutil.ReadFile(file) - if err != nil { return } + if err != nil { + return + } pass, err := util.ReadPassword("passphrase") - if err != nil { return } + if err != nil { + return + } cipherData := util.Encrypt(data, []byte(pass)) - err = ioutil.WriteFile(file + ".encrypted", cipherData, 0644) + err = ioutil.WriteFile(file+".encrypted", cipherData, 0644) return } func DecryptFile(ctx *cli.Context) (err error) { file := ctx.String("file") cipherData, err := ioutil.ReadFile(file) - if err != nil { return } + if err != nil { + return + } pass, err := util.ReadPassword("passphrase") - if err != nil { return } + if err != nil { + return + } data := util.Decrypt(cipherData, []byte(pass)) - err = ioutil.WriteFile(file + ".decrypted", data, 0644) + err = ioutil.WriteFile(file+".decrypted", data, 0644) return -} \ No newline at end of file +} diff --git a/relayer/eth/eth.go b/relayer/eth/eth.go index 98aa9db8..fea47be1 100644 --- a/relayer/eth/eth.go +++ b/relayer/eth/eth.go @@ -315,7 +315,7 @@ func (s *Submitter) run(account accounts.Account, mq bus.TxBus, delay bus.Delaye if err == nil { err = s.SubmitTx(tx) if err != nil { - log.Error("SubmitTx failed", "polyHash", tx.PolyHash.Hex(), "err", err) + log.Error("SubmitTx failed", "chain", s.name, "polyHash", tx.PolyHash.Hex(), "err", err) } } else { log.Error("ProcessTx failed", "polyHash", tx.PolyHash.Hex(), "err", err) diff --git a/relayer/eth/listener.go b/relayer/eth/listener.go index 033b3730..26a82e7d 100644 --- a/relayer/eth/listener.go +++ b/relayer/eth/listener.go @@ -85,18 +85,17 @@ func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err erro func (l *Listener) getProofHeight(txHeight uint64) (height uint64, err error) { switch l.config.ChainId { - // only header sync chian //todo - case base.ETH, base.BSC, base.HECO, base.O3, base.BYTOM, base.HSC, base.GOERLI, base.SEPOLIA, base.MATIC: + //header sync chain //todo + case base.ETH, base.BSC, base.HECO, base.GOERLI, base.SEPOLIA: h, err := l.poly.Node().GetInfoHeight(nil, l.config.ChainId) height = uint64(h) return height, err - case base.OK, base.HARMONY: - height, err = l.sdk.Node().GetLatestHeight() - if err != nil { - return 0, err - } - height = height - 2 - + //case base.OK, base.HARMONY: + // height, err = l.sdk.Node().GetLatestHeight() + // if err != nil { + // return 0, err + // } + // height = height - 2 case base.PLT: return txHeight, nil default: diff --git a/relayer/harmony/listener.go b/relayer/harmony/listener.go index 3473d7ee..30e94c1f 100644 --- a/relayer/harmony/listener.go +++ b/relayer/harmony/listener.go @@ -30,10 +30,10 @@ import ( type Listener struct { *eth.Listener - sdk *harmony.SDK - poly *zion.SDK - epoch uint64 - header []byte // Pending header + sdk *harmony.SDK + poly *zion.SDK + epoch uint64 + header []byte // Pending header nextEpochBlock uint64 } @@ -60,7 +60,9 @@ func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err erro l.Listener = new(eth.Listener) l.poly = poly err = l.Listener.Init(config, poly) - if err != nil { return } + if err != nil { + return + } l.sdk, err = harmony.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) return } @@ -70,7 +72,7 @@ func (l *Listener) Header(height uint64) (header []byte, hash []byte, err error) if prev == height || next == height { header, err = l.genesisHeader(height) if err == nil { - log.Info("Fetched block header", "chain", l.Name(), "height", height, ) + log.Info("Fetched block header", "chain", l.Name(), "height", height) } } else { log.Warn("Skipping harmony header fetch, for not last epoch", @@ -82,17 +84,25 @@ func (l *Listener) Header(height uint64) (header []byte, hash []byte, err error) func (l *Listener) Compose(tx *msg.Tx) (err error) { err = l.Listener.Compose(tx) - if err != nil { return } + if err != nil { + return + } header, err := l.sdk.Node().HeaderByNumberRLP(tx.SrcProofHeight) if err != nil { return } nextHeader, err := l.sdk.Node().HeaderByNumber(tx.SrcProofHeight + 1) - if err != nil { return } + if err != nil { + return + } sig, err := nextHeader.GetLastCommitSignature() - if err != nil { return } + if err != nil { + return + } bitmap, err := nextHeader.GetLastCommitBitmap() - if err != nil { return } + if err != nil { + return + } hs := harmony.HeaderWithSig{header, sig, bitmap} tx.SrcStateRoot, err = hs.Encode() return @@ -101,7 +111,9 @@ func (l *Listener) Compose(tx *msg.Tx) (err error) { func (l *Listener) GenesisHeader(height uint64) (data []byte, err error) { if height == 0 { height, err = l.sdk.Node().GetLatestHeight() - if err != nil { return } + if err != nil { + return + } height, _ = GetLastEpochBlock(height) } return l.genesisHeader(height) @@ -113,11 +125,17 @@ func (l *Listener) genesisHeader(height uint64) (data []byte, err error) { return } nextHeader, err := l.sdk.Node().HeaderByNumber(height + 1) - if err != nil { return } + if err != nil { + return + } sig, err := nextHeader.GetLastCommitSignature() - if err != nil { return } + if err != nil { + return + } bitmap, err := nextHeader.GetLastCommitBitmap() - if err != nil { return } + if err != nil { + return + } hs := harmony.HeaderWithSig{header, sig, bitmap} data, err = hs.Encode() return diff --git a/relayer/harmony/listener_test.go b/relayer/harmony/listener_test.go index 6a1ed309..60bd5c4f 100644 --- a/relayer/harmony/listener_test.go +++ b/relayer/harmony/listener_test.go @@ -12,7 +12,7 @@ func TestGetLastEpochBlock(t *testing.T) { if prev != 23592959 { t.Errorf("Prev for mainnet gives the wrong result") } - if next != 23592959 + EPOCH_BLOCKS_MAINNET { + if next != 23592959+EPOCH_BLOCKS_MAINNET { t.Errorf("Next for mainnet gives the wrong result") } } diff --git a/relayer/neo/listener.go b/relayer/neo/listener.go index a42a2537..e9f170dc 100644 --- a/relayer/neo/listener.go +++ b/relayer/neo/listener.go @@ -326,4 +326,4 @@ func (l *Listener) LastHeaderSync(force, last uint64) (height uint64, err error) func (l *Listener) LatestHeight() (uint64, error) { return l.sdk.Node().GetLatestHeight() } -*/ \ No newline at end of file +*/ diff --git a/relayer/ont/listener.go b/relayer/ont/listener.go index 88cd5a49..321b4abb 100644 --- a/relayer/ont/listener.go +++ b/relayer/ont/listener.go @@ -209,6 +209,47 @@ func (l *Listener) GetTxBlock(hash string) (height uint64, err error) { } func (l *Listener) ScanTx(hash string) (tx *msg.Tx, err error) { + height, err := l.sdk.Node().GetBlockHeightByTxHash(hash) + if err != nil { + return nil, fmt.Errorf("ONT failed to get block height by hash %s, err %v", hash, err) + } + + event, err := l.sdk.Node().GetSmartContractEvent(hash) + if err != nil { + return nil, fmt.Errorf("ONT failed to fetch smart contract events for hash %s, err %v", hash, err) + + } + for _, notify := range event.Notify { + if !strings.EqualFold(notify.ContractAddress, strings.TrimPrefix(l.ccm, "0x")) { + continue + } + log.Info("ont scan", "hash", hash, "notify", fmt.Sprintf("%+v", *notify)) + states, ok := notify.States.([]interface{}) + if !ok || states[0].(string) != "cross_chain" { + continue + } + srcProxy, err := utils.AddressFromBase58(states[3].(string)) + if err != nil { + return nil, fmt.Errorf("decode src lock proxy of ONT ccm event failed. srcHash %s, err %v", event.TxHash, err) + } + + dstChainId, err := strconv.ParseUint(states[4].(string), 10, 32) + if err != nil { + return nil, fmt.Errorf("decode dst chain id of ONT ccm event failed. srcHash %s, err %v", event.TxHash, err) + } + + return &msg.Tx{ + TxType: msg.SRC, + TxId: states[2].(string), + SrcHash: event.TxHash, + DstChainId: dstChainId, + SrcHeight: uint64(height), + SrcChainId: l.ChainId(), + SrcProxy: srcProxy.ToHexString(), + DstProxy: states[5].(string), + SrcParam: states[6].(string), + }, nil + } return } diff --git a/relayer/ontevm/listener.go b/relayer/ontevm/listener.go index 67f8fc24..1a2908db 100644 --- a/relayer/ontevm/listener.go +++ b/relayer/ontevm/listener.go @@ -47,15 +47,6 @@ type Listener struct { abiParsed abi.ABI } -//type Listener struct { -// *eth.Listener -// sdk *harmony.SDK -// poly *zion.SDK -// epoch uint64 -// header []byte // Pending header -// nextEpochBlock uint64 -//} - func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err error) { if config.ChainId != base.ONTEVM { return fmt.Errorf("ONTEVM chain id is incorrect in config %v", config.ChainId) @@ -84,15 +75,6 @@ func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err erro return } -//func (l *Listener) getProofHeight(txHeight uint64) (height uint64, err error) { -// h, err := l.poly.Node().GetInfoHeight(nil, l.config.ChainId) -// if err != nil { -// return 0, fmt.Errorf("getProofHeight unsupported chain %s err %v", l.name, err) -// } -// height = uint64(h) -// return height, err -//} - type MakeTxParamWithSender struct { Sender ontocommon.Address ccom.MakeTxParam @@ -116,102 +98,6 @@ func (this *MakeTxParamWithSender) Deserialization(data []byte) (err error) { return this.MakeTxParam.Deserialization(source) } -//func (l *Listener) Compose(tx *msg.Tx) (err error) { -// if tx.SrcHeight == 0 { -// return fmt.Errorf("Invalid tx src height(0)") -// } -// v, err := l.poly.Node().GetSideChainMsg(base.ONTEVM, tx.SrcHeight) -// if err != nil { -// return fmt.Errorf("GetSideChainMsg:%s", err) -// } -// if len(v) == 0 { -// msg, err := l.sdk.Node().GetCrossChainMsg(uint32(tx.SrcHeight)) -// if err != nil { -// return fmt.Errorf("err ontNode.GetCrossChainMsg:%s", err) -// } -// tx.SrcStateRoot, err = hex.DecodeString(msg) -// if err != nil { -// return fmt.Errorf("err tx.SrcStateRoot hex.DecodeString(msg):%s", err) -// } -// } -// hashes, err := l.sdk.Node().GetCrossStatesLeafHashes(float64(tx.SrcHeight)) -// if err != nil { -// return fmt.Errorf("GetCrossStatesLeafHashes:%s", err) -// } -// param := ccom.MakeTxParam{} -// par, err := hex.DecodeString(tx.SrcParam) -// if err != nil { -// return fmt.Errorf("err hexDecodeString SrcParam:%s", err) -// } -// err = param.Deserialization(ontocommon.NewZeroCopySource(par)) -// if err != nil { -// return fmt.Errorf("err param.Deserialization par:%s", err) -// } -// eccmAddr := HexStringReverse((l.ccm.String())[2:]) -// ontEccmAddr, err := ontocommon.AddressFromHexString(eccmAddr) -// if err != nil { -// return fmt.Errorf("err addressFromHexString eccmAddr:%s", err) -// } -// makeTxParamWithSender := &MakeTxParamWithSender{ -// ontEccmAddr, -// param, -// } -// itemValue, err := makeTxParamWithSender.Serialization() -// if err != nil { -// return fmt.Errorf("err makeTxParamWithSender.Serialization:%s", err) -// } -// hashesx := make([]ontocommon.Uint256, 0) -// for _, v := range hashes.Hashes { -// uint256v, err := ontocommon.Uint256FromHexString(v) -// if err != nil { -// return fmt.Errorf("err Uint256FromHexString hashes.Hashes:%s", err) -// } -// hashesx = append(hashesx, uint256v) -// } -// path, err := merkle.MerkleLeafPath(itemValue, hashesx) -// if err != nil { -// return fmt.Errorf("err merkle.MerkleLeafPath:%s", err) -// } -// tx.SrcProof = path -// tx.SrcProofHeight = tx.SrcHeight -// { -// value, _, _, _ := msg.ParseAuditPath(tx.SrcProof) -// if len(value) == 0 { -// return fmt.Errorf("ParseAuditPath got null param") -// } -// param := &MakeTxParamWithSender{} -// err = param.Deserialization(value) -// if err != nil { -// return fmt.Errorf("err param.Deserialization value:%s", err) -// } -// tx.Param = &pcom.MakeTxParam{ -// TxHash: param.TxHash, -// CrossChainID: param.CrossChainID, -// FromContractAddress: param.FromContractAddress, -// ToChainID: param.ToChainID, -// ToContractAddress: param.ToContractAddress, -// Method: param.Method, -// Args: param.Args, -// } -// } -// return -//} - -//func (l *Listener) Header(height uint64) (header []byte, hash []byte, err error) { -// block, err := l.sdk.Node().GetBlockByHeight(uint32(height)) -// if err != nil { -// return -// } -// info := &vconfig.VbftBlockInfo{} -// if err := json.Unmarshal(block.Header.ConsensusPayload, info); err != nil { -// return nil, nil, fmt.Errorf("ONTEVM unmarshal blockInfo error: %s", err) -// } -// if info.NewChainConfig != nil { -// return block.Header.ToArray(), nil, nil -// } -// return -//} - type StorageLog struct { Address common.Address Topics []common.Hash @@ -275,17 +161,17 @@ func (l *Listener) Scan(height uint64) (txs []*msg.Tx, err error) { err = fmt.Errorf("decoding states err:%v", err) return nil, err } - source := ontocommon.NewZeroCopySource(data) // todo modify + source := ontocommon.NewZeroCopySource(data) var storageLog StorageLog err = storageLog.Deserialization(source) if err != nil { return nil, err } - // todo - CrossChainEvent := "0x6ad3bf15c1988bc04bc153490cab16db8efb9a3990215bf1c64ea6e28be88483" - if len(storageLog.Topics) == 0 || common.HexToHash(CrossChainEvent) != storageLog.Topics[0] { + + if len(storageLog.Topics) == 0 || l.abiParsed.Events["CrossChainEvent"].ID != storageLog.Topics[0] { continue } + var event eccm_abi.EthCrossChainManagerImplementationCrossChainEvent err = l.abiParsed.UnpackIntoInterface(&event, "CrossChainEvent", storageLog.Data) if err != nil { @@ -333,20 +219,6 @@ func (l *Listener) Nodes() chains.Nodes { return l.sdk.ChainSDK } -//func (l *Listener) LastHeaderSync(force, last uint64) (height uint64, err error) { -// if l.poly == nil { -// err = fmt.Errorf("No poly sdk provided for listener chain %s", l.name) -// return -// } -// -// if force != 0 { -// return force, nil -// } -// h, err := l.poly.Node().GetInfoHeight(nil, l.ChainId()) -// height = uint64(h) -// return -//} - func (l *Listener) LatestHeight() (uint64, error) { return l.sdk.Node().GetLatestHeight() } diff --git a/relayer/relayer.go b/relayer/relayer.go index 51b18369..6e5cfc7b 100644 --- a/relayer/relayer.go +++ b/relayer/relayer.go @@ -24,6 +24,7 @@ import ( "github.com/polynetwork/poly-relayer/relayer/neo3" "github.com/polynetwork/poly-relayer/relayer/ont" "github.com/polynetwork/poly-relayer/relayer/ripple" + "github.com/polynetwork/poly-relayer/relayer/starcoin" "sync" "time" @@ -97,6 +98,10 @@ func GetListener(chain uint64) (listener IChainListener) { listener = new(neo3.Listener) case base.APTOS: listener = new(aptos.Listener) + case base.RIPPLE: + listener = new(ripple.Listener) + case base.STARCOIN: + listener = new(starcoin.Listener) default: if base.SameAsETH(chain) { return new(eth.Listener) @@ -113,6 +118,8 @@ func GetSubmitter(chain uint64) (submitter IChainSubmitter) { submitter = new(ripple.Submitter) case base.APTOS: submitter = new(aptos.Submitter) + case base.STARCOIN: + submitter = new(starcoin.Submitter) default: if base.SameAsETH(chain) { return new(eth.Submitter) diff --git a/relayer/relayer_test.go b/relayer/relayer_test.go index 7df5055f..ec965d20 100644 --- a/relayer/relayer_test.go +++ b/relayer/relayer_test.go @@ -18,11 +18,14 @@ package relayer import ( + "encoding/hex" + "github.com/polynetwork/poly-relayer/config" + "github.com/polynetwork/poly-relayer/msg" + "github.com/stretchr/testify/assert" "os" "testing" "github.com/polynetwork/bridge-common/log" - "github.com/polynetwork/poly-relayer/config" ) func TestMain(m *testing.M) { @@ -41,3 +44,40 @@ func TestMain(m *testing.M) { err = conf.Init() config.CONFIG_PATH = path } + +func TestGetEpochByHeight1(t *testing.T) { + config, err := config.New("../config.devnet.poly-starcoin.conf.json") + if err != nil { + log.Error("Failed to parse config file", "err", err) + } + err = config.Init() + if err != nil { + log.Error("Failed to initialize configuration", "err", err) + } + l, _ := PolyListener() + + epoch, err := l.SDK().Node().GetEpochInfo(0) + if epoch == nil { + log.Error("epoch not found in zion?", "err", err) + } + log.Info("zion GetCurrentEpochInfo", "epoch id", epoch.ID.Uint64(), "epoch start height", epoch.StartHeight.Uint64(), "epoch end height", epoch.EndHeight.Uint64()) + + epoch_by_id, err := l.EpochById(epoch.ID.Uint64()) + if err != nil { + log.Error("Get Epoch failed", "err", err) + } + log.Info("Print change epoch data: ", + " \nepoch.Header: ", hex.EncodeToString(epoch_by_id.Header), + "\nepoch.Seal: ", hex.EncodeToString(epoch_by_id.Seal)) + +} + +func TestParseRawData(t *testing.T) { + raw_data := "00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000013e0000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000205991d3d0450c3c714c254ac7176184f5a95b417fa2bceff89f53bdcd3eece5d800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f8ea2d94b8a7d83ace33bb56731268e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f7879000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f8ea2d94b8a7d83ace33bb56731268e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f787900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006756e6c6f636b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007c4a0000000000000000000000000000000105546f6b656e33546f6b656e3c307830303030303030303030303030303030303030303030303030303030303030313a3a5354433a3a5354433e1029ce635e538f628632963e92ed506d25204e00000000000000000000000000000000000000000000000000000000000000000000" + hex_byte, _ := hex.DecodeString(raw_data) + param, _ := msg.DecodeTxParam(hex_byte) + toContractFromMove := "000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f8ea2d94b8a7d83ace33bb56731268e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f78790000000000000000000000000000000000" + txParamToContractAddr := hex.EncodeToString(param.ToContractAddress) + log.Info("TestParseRawData", " | txParam: ", txParamToContractAddr) + assert.Equal(t, toContractFromMove, txParamToContractAddr) +} diff --git a/relayer/ripple/listener.go b/relayer/ripple/listener.go new file mode 100644 index 00000000..fe41efc9 --- /dev/null +++ b/relayer/ripple/listener.go @@ -0,0 +1,208 @@ +package ripple + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "github.com/devfans/zion-sdk/contracts/native/cross_chain_manager/common" + "github.com/ethereum/go-ethereum/rlp" + "github.com/polynetwork/bridge-common/base" + "github.com/polynetwork/bridge-common/chains" + "github.com/polynetwork/bridge-common/chains/ripple" + "github.com/polynetwork/bridge-common/chains/zion" + "github.com/polynetwork/bridge-common/log" + "github.com/polynetwork/poly-relayer/config" + "github.com/polynetwork/poly-relayer/msg" + "github.com/rubblelabs/ripple/data" + "math/big" + "time" +) + +type Listener struct { + sdk *ripple.SDK + MultiSignAccount string + config *config.ListenerConfig + name string +} + +type CrossChainInfo struct { + DstChain uint64 + DstAddress string +} + +func (l *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err error) { + l.config = config + l.name = base.GetChainName(config.ChainId) + l.MultiSignAccount = config.MultiSignAccount + l.sdk, err = ripple.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) + return +} + +func (l *Listener) Scan(height uint64) (txs []*msg.Tx, err error) { + ledger, err := l.sdk.Node().GetRpcClient().GetLedger(uint32(height)) + if err != nil { + return nil, err + } + + if ledger == nil { + return nil, fmt.Errorf("get Ripple ledger failed, height=%d", height) + } + + for _, txData := range ledger.Ledger.Transactions { + if !txData.MetaData.TransactionResult.Success() { + continue + } + payment, ok := txData.Transaction.(*data.Payment) + if !ok { + continue + } + if payment.Amount.Currency.Machine() != "XRP" || payment.Destination.String() != l.MultiSignAccount { + continue + } + + if len(payment.Memos) != 1 { + log.Error("Ripple payment.Memos invalid", "txHash: %s", txData.GetHash().String()) + continue + } + + log.Info("Found Ripple tx", "height", height, "hash", txData.GetHash().String(), "tx", fmt.Sprintf("%+v", *txData)) + + crossChainInfo := new(CrossChainInfo) + err = json.Unmarshal(payment.Memos[0].Memo.MemoData.Bytes(), crossChainInfo) + if err != nil { + log.Error("Ripple deserialize cross chain info failed", + "hash", txData.GetHash().String(), + "MemoData", string(payment.Memos[0].Memo.MemoData.Bytes()), "err", err) + continue + } + + dstAddress, err := hex.DecodeString(crossChainInfo.DstAddress) + if err != nil { + log.Error("Ripple deserialize dstAddress failed", + "hash", txData.GetHash().String(), + "crossChainInfo", fmt.Sprintf("%+v", *crossChainInfo), "err", err) + continue + } + + deliveredAmount, err := txData.MetaData.DeliveredAmount.NonNative() + if err != nil { + log.Error("Ripple txData.MetaData.DeliveredAmount.NonNative() failed", "hash", txData.GetHash().String(), "err", err) + continue + } + amount, ok := new(big.Int).SetString(deliveredAmount.String(), 10) + if !ok { + log.Error("Ripple convert amount to big int failed", "hash", txData.GetHash().String(), "amount", deliveredAmount) + continue + } + rippleTxArgs := &common.RippleTxArgs{ToAddress: dstAddress, Amount: amount} + b, err := rlp.EncodeToBytes(rippleTxArgs) + if err != nil { + log.Error("Ripple rlp.EncodeToBytes rippleTxArgs failed", "hash", txData.GetHash().String(), "err", err) + continue + } + + param := &common.MakeTxParam{ + TxHash: txData.GetHash().Bytes(), + CrossChainID: txData.GetHash().Bytes(), + FromContractAddress: payment.Destination[:], + ToChainID: crossChainInfo.DstChain, + Method: "unlock", + Args: b, + } + + rawParam, err := rlp.EncodeToBytes(param) + if err != nil { + log.Error("Ripple rlp encode param failed", "hash", txData.GetHash().String(), "err", err) + continue + } + + //rawParam, err := msg.EncodeTxParam(param) + //if err != nil { + // log.Error("Ripple EncodeTxParam failed", "hash", txData.GetHash().String(), "err", err) + // continue + //} + + log.Info("Found Ripple src cross chain tx", "hash", txData.GetHash().String()) + + tx := &msg.Tx{ + TxType: msg.SRC, + TxId: txData.GetHash().String(), + SrcHash: txData.GetHash().String(), + DstChainId: crossChainInfo.DstChain, + SrcParam: hex.EncodeToString(rawParam), + SrcChainId: l.config.ChainId, + SrcHeight: height, + } + txs = append(txs, tx) + } + return +} + +func (l *Listener) Defer() int { + return l.config.Defer +} + +func (l *Listener) ListenCheck() time.Duration { + return time.Second +} + +func (l *Listener) ChainId() uint64 { + return l.config.ChainId +} + +func (l *Listener) Nodes() chains.Nodes { + return l.sdk.ChainSDK +} + +func (l *Listener) Header(height uint64) (header []byte, hash []byte, err error) { + return nil, nil, nil +} + +func (l *Listener) LastHeaderSync(u uint64, u2 uint64) (uint64, error) { + return 0, nil +} + +func (l *Listener) ScanTx(hash string) (*msg.Tx, error) { + txData, err := l.sdk.Node().GetRpcClient().GetTx(hash) + if err != nil { + return nil, fmt.Errorf("ripple get tx failed. hash: %s, err: %s", hash, err) + } + + txs, err := l.Scan(uint64(txData.Ledger())) + if err != nil { + return nil, err + } + + for _, tx := range txs { + if txData.GetHash().String() == tx.SrcHash { + return tx, nil + } + } + return nil, fmt.Errorf("%s is not Ripple src cross tx", hash) +} + +func (l *Listener) GetTxBlock(hash string) (uint64, error) { + tx, err := l.sdk.Node().GetRpcClient().GetTx(hash) + if err != nil { + return 0, fmt.Errorf("ripple get tx failed. hash: %s, err: %s", hash, err) + } + + return uint64(tx.LedgerSequence), nil +} + +func (l *Listener) Compose(tx *msg.Tx) error { + return nil +} + +func (l *Listener) LatestHeight() (uint64, error) { + return l.sdk.Node().GetLatestHeight() +} + +func (l *Listener) WaitTillHeight(ctx context.Context, height uint64, interval time.Duration) (uint64, bool) { + return 0, false +} + +func (l *Listener) GetFee() (float64, error) { + return l.sdk.Node().GetFee() +} diff --git a/relayer/sidechain.go b/relayer/sidechain.go index fd4b4a35..ec7028ea 100644 --- a/relayer/sidechain.go +++ b/relayer/sidechain.go @@ -140,7 +140,7 @@ func AddSideChain(ctx *cli.Context) (err error) { } hash, err := ps.RegisterSideChain(chain.ChainID, chain.Router, chain.Name, chain.CCMCAddress, chain.ExtraInfo, update) - log.Info("Sent tx", "hash", hash, "err", err) + log.Info("Sent tx", "hash", hash.Hex(), "err", err) return } diff --git a/relayer/starcoin/lib.go b/relayer/starcoin/lib.go new file mode 100644 index 00000000..0d6f87ba --- /dev/null +++ b/relayer/starcoin/lib.go @@ -0,0 +1,704 @@ +package starcoin + +import ( + "fmt" + + "github.com/novifinancial/serde-reflection/serde-generate/runtime/golang/bcs" + "github.com/novifinancial/serde-reflection/serde-generate/runtime/golang/serde" +) + +type AccountAddress [16]uint8 + +func (obj *AccountAddress) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := serialize_array16_u8_array((([16]uint8)(*obj)), serializer); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *AccountAddress) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeAccountAddress(deserializer serde.Deserializer) (AccountAddress, error) { + var obj [16]uint8 + if err := deserializer.IncreaseContainerDepth(); err != nil { + return (AccountAddress)(obj), err + } + if val, err := deserialize_array16_u8_array(deserializer); err == nil { + obj = val + } else { + return ((AccountAddress)(obj)), err + } + deserializer.DecreaseContainerDepth() + return (AccountAddress)(obj), nil +} + +func BcsDeserializeAccountAddress(input []byte) (AccountAddress, error) { + if input == nil { + var obj AccountAddress + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeAccountAddress(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type CrossChainEvent struct { + Sender []byte + TxId []byte + ProxyOrAssetContract []byte + ToChainId uint64 + ToContract []byte + RawData []byte +} + +func (obj *CrossChainEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.Sender); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.TxId); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ProxyOrAssetContract); err != nil { + return err + } + if err := serializer.SerializeU64(obj.ToChainId); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToContract); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.RawData); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *CrossChainEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeCrossChainEvent(deserializer serde.Deserializer) (CrossChainEvent, error) { + var obj CrossChainEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.Sender = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.TxId = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ProxyOrAssetContract = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU64(); err == nil { + obj.ToChainId = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToContract = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.RawData = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeCrossChainEvent(input []byte) (CrossChainEvent, error) { + if input == nil { + var obj CrossChainEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeCrossChainEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type CrossChainFeeLockEvent struct { + FromAssetHash TokenCode + Sender AccountAddress + ToChainId uint64 + ToAddress []byte + Net serde.Uint128 + Fee serde.Uint128 + Id serde.Uint128 +} + +func (obj *CrossChainFeeLockEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := obj.FromAssetHash.Serialize(serializer); err != nil { + return err + } + if err := obj.Sender.Serialize(serializer); err != nil { + return err + } + if err := serializer.SerializeU64(obj.ToChainId); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToAddress); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Net); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Fee); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Id); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *CrossChainFeeLockEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeCrossChainFeeLockEvent(deserializer serde.Deserializer) (CrossChainFeeLockEvent, error) { + var obj CrossChainFeeLockEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := DeserializeTokenCode(deserializer); err == nil { + obj.FromAssetHash = val + } else { + return obj, err + } + if val, err := DeserializeAccountAddress(deserializer); err == nil { + obj.Sender = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU64(); err == nil { + obj.ToChainId = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToAddress = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Net = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Fee = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Id = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeCrossChainFeeLockEvent(input []byte) (CrossChainFeeLockEvent, error) { + if input == nil { + var obj CrossChainFeeLockEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeCrossChainFeeLockEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type CrossChainFeeSpeedUpEvent struct { + FromAssetHash TokenCode + Sender AccountAddress + TxHash []byte + Efee serde.Uint128 +} + +func (obj *CrossChainFeeSpeedUpEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := obj.FromAssetHash.Serialize(serializer); err != nil { + return err + } + if err := obj.Sender.Serialize(serializer); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.TxHash); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Efee); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *CrossChainFeeSpeedUpEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeCrossChainFeeSpeedUpEvent(deserializer serde.Deserializer) (CrossChainFeeSpeedUpEvent, error) { + var obj CrossChainFeeSpeedUpEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := DeserializeTokenCode(deserializer); err == nil { + obj.FromAssetHash = val + } else { + return obj, err + } + if val, err := DeserializeAccountAddress(deserializer); err == nil { + obj.Sender = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.TxHash = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Efee = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeCrossChainFeeSpeedUpEvent(input []byte) (CrossChainFeeSpeedUpEvent, error) { + if input == nil { + var obj CrossChainFeeSpeedUpEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeCrossChainFeeSpeedUpEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type LockEvent struct { + FromAssetHash TokenCode + FromAddress []byte + ToChainId uint64 + ToAssetHash []byte + ToAddress []byte + Amount serde.Uint128 +} + +func (obj *LockEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := obj.FromAssetHash.Serialize(serializer); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.FromAddress); err != nil { + return err + } + if err := serializer.SerializeU64(obj.ToChainId); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToAssetHash); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToAddress); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Amount); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *LockEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeLockEvent(deserializer serde.Deserializer) (LockEvent, error) { + var obj LockEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := DeserializeTokenCode(deserializer); err == nil { + obj.FromAssetHash = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.FromAddress = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU64(); err == nil { + obj.ToChainId = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToAssetHash = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToAddress = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Amount = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeLockEvent(input []byte) (LockEvent, error) { + if input == nil { + var obj LockEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeLockEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type TokenCode struct { + Address AccountAddress + Module string + Name string +} + +func (obj *TokenCode) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := obj.Address.Serialize(serializer); err != nil { + return err + } + if err := serializer.SerializeStr(obj.Module); err != nil { + return err + } + if err := serializer.SerializeStr(obj.Name); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *TokenCode) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeTokenCode(deserializer serde.Deserializer) (TokenCode, error) { + var obj TokenCode + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := DeserializeAccountAddress(deserializer); err == nil { + obj.Address = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeStr(); err == nil { + obj.Module = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeStr(); err == nil { + obj.Name = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeTokenCode(input []byte) (TokenCode, error) { + if input == nil { + var obj TokenCode + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeTokenCode(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type UnlockEvent struct { + ToAssetHash []byte + ToAddress []byte + Amount serde.Uint128 +} + +func (obj *UnlockEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToAssetHash); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToAddress); err != nil { + return err + } + if err := serializer.SerializeU128(obj.Amount); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *UnlockEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeUnlockEvent(deserializer serde.Deserializer) (UnlockEvent, error) { + var obj UnlockEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToAssetHash = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToAddress = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeU128(); err == nil { + obj.Amount = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeUnlockEvent(input []byte) (UnlockEvent, error) { + if input == nil { + var obj UnlockEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeUnlockEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} + +type VerifyHeaderAndExecuteTxEvent struct { + FromChainId uint64 + ToContract []byte + CrossChainTxHash []byte + FromChainTxHash []byte +} + +func (obj *VerifyHeaderAndExecuteTxEvent) Serialize(serializer serde.Serializer) error { + if err := serializer.IncreaseContainerDepth(); err != nil { + return err + } + if err := serializer.SerializeU64(obj.FromChainId); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.ToContract); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.CrossChainTxHash); err != nil { + return err + } + if err := serializer.SerializeBytes(obj.FromChainTxHash); err != nil { + return err + } + serializer.DecreaseContainerDepth() + return nil +} + +func (obj *VerifyHeaderAndExecuteTxEvent) BcsSerialize() ([]byte, error) { + if obj == nil { + return nil, fmt.Errorf("Cannot serialize null object") + } + serializer := bcs.NewSerializer() + if err := obj.Serialize(serializer); err != nil { + return nil, err + } + return serializer.GetBytes(), nil +} + +func DeserializeVerifyHeaderAndExecuteTxEvent(deserializer serde.Deserializer) (VerifyHeaderAndExecuteTxEvent, error) { + var obj VerifyHeaderAndExecuteTxEvent + if err := deserializer.IncreaseContainerDepth(); err != nil { + return obj, err + } + if val, err := deserializer.DeserializeU64(); err == nil { + obj.FromChainId = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.ToContract = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.CrossChainTxHash = val + } else { + return obj, err + } + if val, err := deserializer.DeserializeBytes(); err == nil { + obj.FromChainTxHash = val + } else { + return obj, err + } + deserializer.DecreaseContainerDepth() + return obj, nil +} + +func BcsDeserializeVerifyHeaderAndExecuteTxEvent(input []byte) (VerifyHeaderAndExecuteTxEvent, error) { + if input == nil { + var obj VerifyHeaderAndExecuteTxEvent + return obj, fmt.Errorf("Cannot deserialize null array") + } + deserializer := bcs.NewDeserializer(input) + obj, err := DeserializeVerifyHeaderAndExecuteTxEvent(deserializer) + if err == nil && deserializer.GetBufferOffset() < uint64(len(input)) { + return obj, fmt.Errorf("Some input bytes were not read") + } + return obj, err +} +func serialize_array16_u8_array(value [16]uint8, serializer serde.Serializer) error { + for _, item := range value { + if err := serializer.SerializeU8(item); err != nil { + return err + } + } + return nil +} + +func deserialize_array16_u8_array(deserializer serde.Deserializer) ([16]uint8, error) { + var obj [16]uint8 + for i := range obj { + if val, err := deserializer.DeserializeU8(); err == nil { + obj[i] = val + } else { + return obj, err + } + } + return obj, nil +} + +func encode_u128_argument(arg serde.Uint128) []byte { + + s := bcs.NewSerializer() + if err := s.SerializeU128(arg); err == nil { + return s.GetBytes() + } + + panic("Unable to serialize argument of type u128") +} + +func encode_u8vector_argument(arg []byte) []byte { + + s := bcs.NewSerializer() + if err := s.SerializeBytes(arg); err == nil { + return s.GetBytes() + } + + panic("Unable to serialize argument of type u8vector") +} diff --git a/relayer/starcoin/listener.go b/relayer/starcoin/listener.go index 67e38212..0ebb7e6f 100644 --- a/relayer/starcoin/listener.go +++ b/relayer/starcoin/listener.go @@ -1,292 +1,239 @@ -/* - * Copyright (C) 2021 The poly network Authors - * This file is part of The poly network library. - * - * The poly network is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The poly network is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * You should have received a copy of the GNU Lesser General Public License - * along with The poly network . If not, see . - */ - package starcoin -/* + import ( - "bytes" "context" - "encoding/hex" - "encoding/json" "fmt" + "github.com/ontio/ontology/common/log" "github.com/polynetwork/bridge-common/base" "github.com/polynetwork/bridge-common/chains" - "github.com/polynetwork/bridge-common/chains/poly" "github.com/polynetwork/bridge-common/chains/starcoin" - "github.com/polynetwork/poly-relayer/bus" + "github.com/polynetwork/bridge-common/chains/zion" "github.com/polynetwork/poly-relayer/config" "github.com/polynetwork/poly-relayer/msg" - pcom "github.com/polynetwork/poly/common" - ccom "github.com/polynetwork/poly/native/service/cross_chain_manager/common" - "github.com/starcoinorg/starcoin-go/client" + starcoin_client "github.com/starcoinorg/starcoin-go/client" "strconv" - "strings" "time" ) type Listener struct { - sdk *starcoin.SDK - poly *poly.SDK - ccm string - ccd string - config *config.ListenerConfig - GetProofHeight func() (uint64, error) - GetProof func(*client.Event, uint64) (uint64, []byte, error) - name string - state bus.ChainStore // Header sync state -} - -func (l *Listener) Init(config *config.ListenerConfig, poly *poly.SDK) (err error) { - if config.ChainId != base.STARCOIN { - return fmt.Errorf("STARCOIN chain id is incorrect in config %v", config.ChainId) - } - l.config = config - l.name = base.GetChainName(config.ChainId) - l.ccm = config.CCMContract - l.poly = poly - l.GetProofHeight = l.getProofHeight - l.GetProof = l.getProof - l.sdk, err = starcoin.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) - l.state = bus.NewRedisChainStore( - bus.ChainHeightKey{ChainId: config.ChainId, Type: bus.KEY_HEIGHT_HEADER}, bus.New(config.Bus.Redis), - config.Bus.HeightUpdateInterval, - ) - return -} - -func (l *Listener) Header(height uint64) (header []byte, hash []byte, err error) { - hdr, err := l.sdk.Node().HeaderWithDifficultyInfoByNumber(context.Background(), height) - if err != nil { - err = fmt.Errorf("starcoin HeaderWithDifficutyInfoByNumber on height %d error %v", height, err) - return - } - header, err = json.Marshal(hdr) - if err != nil { - err = fmt.Errorf("starcoin height %d json.Marshal hdr error %v", height, err) - return - } - hash, err = hdr.BlockHeader.Hash() //calculated hash - if err != nil { - err = fmt.Errorf("starcoin height %d get header hash error %v", height, err) - return - } - blockhash, err := hex.DecodeString(strings.TrimPrefix(hdr.BlockHeader.BlockHash, "0x")) - if err != nil { - err = fmt.Errorf("starcoin height %d get block hash error %v", height, err) - return - } - if !bytes.Equal(hash, blockhash) { - err = fmt.Errorf("starcoin height %d hdr.BlockHeader.Hash(): %s <> hdr.BlockHeader.BlockHash: %s", height, hex.EncodeToString(hash), hex.EncodeToString(blockhash)) - return - } - return -} - -func (l *Listener) GetTxBlock(hash string) (height uint64, err error) { - tx, err := l.sdk.Node().GetTransactionInfoByHash(context.Background(), hash) - if err != nil { - return 0, err - } - if tx == nil { - err = fmt.Errorf("starcoin cannot get transaction info by hash %s", hash) - return 0, err - } - height, err = strconv.ParseUint(tx.BlockNumber, 10, 64) - return -} - -func (l *Listener) getProofHeight() (height uint64, err error) { - h, err := l.poly.Node().GetSideChainHeight(l.config.ChainId) - if err != nil { - return 0, err - } - height = h - base.BlocksToWait(l.config.ChainId) - return -} - -func (l *Listener) getProof(event *client.Event, txHeight uint64) (height uint64, proof []byte, err error) { - proofHeight, err := l.GetProofHeight() - if err != nil { - err = fmt.Errorf("%s get proof height error %v", l.name, err) - return - } - if txHeight > proofHeight { - err = fmt.Errorf("%w Proof not ready tx height %v proof height %v", msg.ERR_PROOF_UNAVAILABLE, txHeight, height) - // We dont return here, still fetch the proof of this tx height - height = txHeight - } else { - height, err = strconv.ParseUint(event.BlockNumber, 10, 64) - } - - txGlobalIdx, e := strconv.ParseUint(event.TransactionGlobalIndex, 10, 64) - if e != nil { - err = fmt.Errorf("starcoin height %d ParseUint evt.TransactionGlobalIndex error %v", txHeight, e) - return - } - starcoinProof, e := l.sdk.Node().GetTransactionProof(context.Background(), event.BlockHash, txGlobalIdx, &event.EventIndex) - if e != nil { - err = fmt.Errorf("starcoin height %d GetTransactionProof error %v", txHeight, e) - return - } - proof, e = json.Marshal(starcoinProof) - if e != nil { - err = fmt.Errorf("starcoin height %d Marshal srcProof error %v", txHeight, e) - return - } - return -} - -func (l *Listener) Compose(tx *msg.Tx) (err error) { - if tx.SrcHeight == 0 { - return fmt.Errorf("tx missing attributes src height %v, txid %s", tx.SrcHeight, tx.TxId) - } - if len(tx.SrcParam) == 0 { - return fmt.Errorf("src param is missing") - } - - event := client.Event{} - srcParamBytes, err := hex.DecodeString(tx.SrcParam) - if err != nil { - err = fmt.Errorf("starcoin height %d DecodeString tx.SrcParam error %v", tx.SrcHeight, err) - return - } - err = json.Unmarshal(srcParamBytes, &event) - if err != nil { - err = fmt.Errorf("starcoin height %d event unmarshal error %v", tx.SrcHeight, err) - return - } - - eventIdx := event.EventIndex - evtMsg := starcoin.StarcoinToPolyHeaderOrCrossChainMsg{ - EventIndex: &eventIdx, - AccessPath: nil, - } - evtMsgBS, err := json.Marshal(evtMsg) - if err != nil { - err = fmt.Errorf("starcoin height %d marshal evtMsg error %v", tx.SrcHeight, err) - return - } - tx.SrcStateRoot = evtMsgBS - tx.SrcEvent = []byte{} - - evtData, err := hex.DecodeString(strings.TrimPrefix(event.Data, "0x")) - if err != nil { - err = fmt.Errorf("starcoin height %d evt.Data decodeString error %v", tx.SrcHeight, err) - return - } - ccEvent, err := starcoin.DeserializeCrossChainEvent(evtData) - if err != nil { - err = fmt.Errorf("starcoin height %d DeserializeCrossChainDepositEvent error %v", tx.SrcHeight, err) - return - } - tx.DstChainId = ccEvent.ToChainId - tx.TxId = hex.EncodeToString(ccEvent.TxId) - - param := &ccom.MakeTxParam{} - if err = param.Deserialization(pcom.NewZeroCopySource(ccEvent.RawData)); err != nil { - return - } - tx.Param = param - tx.SrcProofHeight, tx.SrcProof, err = l.GetProof(&event, tx.SrcHeight) + sdk *starcoin.SDK + ccm string + crossChainEventDataCreationNum string + config *config.ListenerConfig + name string +} + +func (this *Listener) Init(config *config.ListenerConfig, poly *zion.SDK) (err error) { + this.config = config + this.name = base.GetChainName(config.ChainId) + this.ccm = config.CCMContract + this.crossChainEventDataCreationNum = config.CrossChainEventCreationNum + this.sdk, err = starcoin.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) return } -func (l *Listener) Scan(height uint64) (txs []*msg.Tx, err error) { - eventTag := "::CrossChainManager::CrossChainEvent" - eventFilter := &client.EventFilter{ - Address: []string{l.ccm}, - TypeTags: []string{l.ccm + eventTag}, +func (this *Listener) Scan(height uint64) (txs []*msg.Tx, err error) { + eventFilter := starcoin_client.EventFilter{ + Address: []string{this.ccm}, + TypeTags: []string{fmt.Sprintf("%s::zion_cross_chain_manager::CrossChainEvent", this.ccm)}, FromBlock: height, ToBlock: &height, } - events, err := l.sdk.Node().GetEvents(context.Background(), eventFilter) + + events, err := this.sdk.Node().GetEvents(context.Background(), &eventFilter) if err != nil { - err = fmt.Errorf("failed to fetch starcoin events height %d error %v", height, err) - return + return nil, err } - if events == nil { + if len(events) == 0 { return } + txs = []*msg.Tx{} - for _, evt := range events { - srcParam, e := json.Marshal(evt) - if e != nil { - err = fmt.Errorf("starcoin height %d json.Marshal evt error %v", height, e) - return + for _, event := range events { + eventData, err := HexToBytes(event.Data) + if err != nil { + log.Errorf("Scan | hex.DecodeString error :%s", err.Error()) + return txs, err } + crossChainEventData, err := BcsDeserializeCrossChainEvent(eventData) + if err != nil { + log.Errorf("fetchLockDepositEvents - BcsDeserializeCrossChainDepositEvent error :%s", err.Error()) + return txs, err + } + //var isTarget bool + //if len(this.config.ProxyOrAssetContracts) > 0 { + // // // fmt.Println(tools.EncodeToHex(ccEvent.Sender)) + // // fmt.Println("---------------- height -----------------") + // // fmt.Println(height) + // // fmt.Println("---------------- ProxyOrAssetContract -----------------") + // // fmt.Println(ccEvent.ProxyOrAssetContract) + // // fmt.Println(string(ccEvent.ProxyOrAssetContract)) //tools.EncodeToHex(ccEvent.ProxyOrAssetContract) + // // fmt.Println("---------------- TxId(crossChainEventData.TxId) -----------------") + // // fmt.Println(tools.EncodeToHex(ccEvent.TxId)) + // // fmt.Println("---------------- ToChainId -----------------") + // // fmt.Println(ccEvent.ToChainId) + // // fmt.Println("---------------- ToContract -----------------") + // // fmt.Println(string(ccEvent.ToContract)) + // // fmt.Println("---------------- RawData -----------------") + // // fmt.Println(tools.EncodeToHex(ccEvent.RawData)) + // //var proxyOrAssetContract string + // proxyOrAssetContract := string(ccEvent.ProxyOrAssetContract) // for 'source' proxy contract, filter is outbound chain Id. + // for _, v := range this.config.ProxyOrAssetContracts { // renamed TargetContracts + // chainIdArrMap, ok := v[proxyOrAssetContract] + // if ok { + // if len(chainIdArrMap["outbound"]) == 0 { + // isTarget = true + // break + // } + // for _, id := range chainIdArrMap["outbound"] { + // if id == ccEvent.ToChainId { + // isTarget = true + // break + // } + // } + // if isTarget { + // break + // } + // } + // } + // if !isTarget { + // continue + // } + //} + //param := &common2.MakeTxParam{} + ////_ = param.Deserialization(common.NewZeroCopySource([]byte(ccEvent.RawData))) + //raw, _ := this.polySdk.GetStorage(autils.CrossChainManagerContractAddress.ToHexString(), + // append(append([]byte(cross_chain_manager.DONE_TX), autils.GetUint64Bytes(this.config.StarcoinConfig.SideChainId)...), param.CrossChainID...)) + //if len(raw) != 0 { + // log.Debugf("fetchLockDepositEvents - ccid %s (tx_hash: %s) already on poly", + // hex.EncodeToString(param.CrossChainID), evt.TransactionHash) + // continue + //} + //index := big.NewInt(0) + //index.SetBytes(ccEvent.TxId) + //txHash, err := tools.HexWithPrefixToBytes(evt.TransactionHash) + //if err != nil { + // log.Errorf("fetchLockDepositEvents - tools.HexWithPrefixToBytes error: %s", err.Error()) + // return false, err + //} + //// fmt.Println("---------------- Starcoin Transaction Hash -----------------") + //// fmt.Println(tools.EncodeToHex(txHash)) + //crossTx := &CrossTransfer{ + // txIndex: tools.EncodeBigInt(index), // tools.EncodeBigInt(ccEvent.TxId to big.Int), + // txId: txHash, // starcoin tx hash + // toChain: uint32(ccEvent.ToChainId), + // value: ccEvent.RawData, + // height: height, + //} + //sink := common.NewZeroCopySink(nil) + //crossTx.Serialization(sink) + //err = this.db.PutStarcoinTxRetry(sink.Bytes(), evt) + //if err != nil { + // log.Errorf("fetchLockDepositEvents - this.db.PutStarcoinTxRetry error: %s", err.Error()) + // return false, err + //} + //log.Infof("fetchLockDepositEvent - height: %d", height) + ccmSequenceNum, err := strconv.ParseUint(event.EventSeqNumber, 0, 64) tx := &msg.Tx{ - TxType: msg.SRC, - SrcParam: hex.EncodeToString(srcParam), - SrcHash: evt.TransactionHash, - SrcHeight: height, - SrcChainId: base.STARCOIN, + TxType: msg.SRC, + TxId: string(crossChainEventData.TxId)[2:], + SrcHash: event.TransactionHash, + DstChainId: crossChainEventData.ToChainId, + SrcParam: starcoin_client.BytesToHexString(crossChainEventData.RawData)[2:], + SrcChainId: this.config.ChainId, + CCMEventSequence: ccmSequenceNum, + SrcProxy: this.ccm, + DstProxy: starcoin_client.BytesToHexString(crossChainEventData.ToContract), + SrcAddress: starcoin_client.BytesToHexString(crossChainEventData.Sender), } - l.Compose(tx) txs = append(txs, tx) } - return + return txs, nil + + //srcTx, err := this.sdk.Node().GetTxByVersion(uint64(event.Version)) + //if err != nil { + // log.Error("get transaction by version failed", "err", err) + // continue + //} + // + //rawData, ok := event.Data["raw_data"] + //if !ok { + // log.Error("no raw_data in aptos cross chain event", "sequenceNum", event.SequenceNumber) + // continue + //} + //rawDataBytes, err := hex.DecodeString(rawData.(string)[2:]) + //if !ok { + // log.Error("hex.DecodeString aptos raw data failed", "sequenceNum", event.SequenceNumber, "err", err) + // continue + //} + // + //param, err := msg.DecodeTxParam(rawDataBytes) + //if err != nil { + // log.Error("msg.DecodeTxParam aptos raw data failed", "sequenceNum", event.SequenceNumber, "err", err) + // continue + //} + //log.Info("Found aptos src cross chain tx", "method", param.Method, "hash", srcTx.Hash, "sequence", event.SequenceNumber) + // + //toChainId, _ := strconv.ParseUint(event.Data["to_chain_id"].(string), 0, 32) + // + //tx := &msg.Tx{ + // TxType: msg.SRC, + // TxId: event.Data["tx_id"].(string)[2:], + // SrcHash: srcTx.Hash, + // DstChainId: toChainId, + // SrcParam: rawData.(string)[2:], + // SrcChainId: this.config.ChainId, + // CCMEventSequence: uint64(event.SequenceNumber), + // SrcProxy: this.ccm, + // DstProxy: event.Data["to_contract"].(string), + // SrcAddress: event.Data["sender"].(string), + //} + //txs = append(txs, tx) + // } + // return } -func (l *Listener) ScanTx(string) (tx *msg.Tx, err error) { - return +func (this *Listener) Defer() int { + return this.config.Defer } -func (l *Listener) ListenCheck() time.Duration { - duration := time.Second - if l.config.ListenCheck > 0 { - duration = time.Duration(l.config.ListenCheck) * time.Second - } - return duration +func (this *Listener) ListenCheck() time.Duration { + return time.Second } -func (l *Listener) Nodes() chains.Nodes { - return l.sdk.ChainSDK +func (this *Listener) ChainId() uint64 { + return this.config.ChainId } -func (l *Listener) ChainId() uint64 { - return l.config.ChainId +func (this *Listener) Nodes() chains.Nodes { + return this.sdk.ChainSDK } -func (l *Listener) Defer() int { - return l.config.Defer +func (this *Listener) Header(height uint64) (header []byte, hash []byte, err error) { + return nil, nil, nil } -func (l *Listener) Name() string { - return l.name +func (this *Listener) LastHeaderSync(u uint64, u2 uint64) (uint64, error) { + return 0, nil } -func (l *Listener) SDK() *starcoin.SDK { - return l.sdk +func (this *Listener) ScanTx(s string) (*msg.Tx, error) { + return nil, nil // todo } -func (l *Listener) LatestHeight() (uint64, error) { - return l.sdk.Node().GetLatestHeight() +func (this *Listener) GetTxBlock(s string) (uint64, error) { + return 0, nil } -func (l *Listener) LastHeaderSync(force, _ uint64) (height uint64, err error) { - if l.poly == nil { - err = fmt.Errorf("no poly sdk provided for chain %s listener", l.name) - return - } +func (this *Listener) Compose(tx *msg.Tx) error { + return nil +} - if force != 0 { - return force, nil - } - return l.poly.Node().GetSideChainHeight(l.config.ChainId) +func (this *Listener) LatestHeight() (uint64, error) { + panic("implement me") +} + +func (this *Listener) WaitTillHeight(ctx context.Context, height uint64, interval time.Duration) (uint64, bool) { + return 0, false } -*/ diff --git a/relayer/starcoin/listener_test.go b/relayer/starcoin/listener_test.go new file mode 100644 index 00000000..0c82f2fc --- /dev/null +++ b/relayer/starcoin/listener_test.go @@ -0,0 +1,44 @@ +package starcoin + +import ( + "encoding/hex" + "github.com/ontio/ontology/common/log" + "github.com/polynetwork/poly-relayer/msg" + "github.com/starcoinorg/starcoin-go/client" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestCrossChainData(t *testing.T) { + data := "0x1048b75ec5bb72e54bca2633c36ca3eb0410000000000000000000000000000000004140000000000000005800000000000000100000000000000048b75ec5bb72e54bca2633c36ca3eb040f000000000000007a696f6e5f6c6f636b5f70726f787900003e010000000000001048b75ec5bb72e54bca2633c36ca3eb04c102e000000000000000f80000000000000020010000000000003e0100000000000069010000000000008101000000000000a3010000000000001000000000000000000000000000000000000000000000002000000000000000f5220b972969f97023a9669e68c65cf6e87d9a1ad635e1ef5e6208c232b63c16410000000000000040000000000000005800000000000000100000000000000048b75ec5bb72e54bca2633c36ca3eb040f000000000000007a696f6e5f6c6f636b5f70726f78790000100000000000000048b75ec5bb72e54bca2633c36ca3eb040600000000000000756e6c6f636b00000000000000000000000000000000000000003e000000000000000c3078313a3a5354433a3a53541048b75ec5bb72e54bca2633c36ca3eb041027000000000000000000000000000000000000000000000000000000000000" + eventData, err := HexToBytes(data) + if err != nil { + log.Errorf("Scan | hex.DecodeString error :%s", err.Error()) + } + crossChainEventData, err := BcsDeserializeCrossChainEvent(eventData) + if err != nil { + log.Errorf("fetchLockDepositEvents - BcsDeserializeCrossChainDepositEvent error :%s", err.Error()) + } + assert.Equal(t, crossChainEventData.ToChainId, uint64(318), "Not equal") + log.Info(client.BytesToHexString(crossChainEventData.ToContract)) + log.Info(client.BytesToHexString(crossChainEventData.ProxyOrAssetContract)) + log.Info(client.BytesToHexString(crossChainEventData.Sender)) + log.Info(client.BytesToHexString(crossChainEventData.TxId)) +} + +func TestSrcParam(t *testing.T) { + // tx hash 0x61a081eeb1e847d53c9afd9f048a05f3a88e9a2f3a1afafc50a89280c5e3dd7c + + srcParam := "0x00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000013e0000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000202c38e0fd45b4eb4a73f7fe12749bd1229dde283399bffabd4e90589c1e561f5700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f08ac0c1c6c8f2be528b35824755054000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f787900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010f08ac0c1c6c8f2be528b358247550540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006756e6c6f636b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003f0d3078313a3a5354433a3a5354431048b75ec5bb72e54bca2633c36ca3eb04102700000000000000000000000000000000000000000000000000000000000000" + raw, err := hex.DecodeString(srcParam[2:]) + if err != nil || len(raw) == 0 { + assert.Fail(t, "Failed to load") + //log.Fatal("Unexpected empty SrcParam", "err", err, "hash", srcParam) + } + + txParam, err := msg.DecodeTxParam(raw) + if err != nil { + assert.Fail(t, "Failed to load", err) + } + assert.Equal(t, 318, int(txParam.ToChainID)) +} diff --git a/relayer/starcoin/starcoin.go b/relayer/starcoin/starcoin.go new file mode 100644 index 00000000..c75d7186 --- /dev/null +++ b/relayer/starcoin/starcoin.go @@ -0,0 +1,411 @@ +package starcoin + +import ( + "context" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "github.com/devfans/zion-sdk/core/types" + "github.com/ethereum/go-ethereum/rlp" + "github.com/polynetwork/bridge-common/base" + "github.com/polynetwork/bridge-common/chains/starcoin" + "github.com/polynetwork/bridge-common/chains/zion" + "github.com/polynetwork/bridge-common/log" + "github.com/polynetwork/bridge-common/util" + "github.com/polynetwork/poly-relayer/bus" + "github.com/polynetwork/poly-relayer/config" + "github.com/polynetwork/poly-relayer/msg" + starcoin_client "github.com/starcoinorg/starcoin-go/client" + starcoin_types "github.com/starcoinorg/starcoin-go/types" + "strconv" + "strings" + "sync" + "time" +) + +type Submitter struct { + context.Context + wg *sync.WaitGroup + config *config.SubmitterConfig + sdk *starcoin.SDK + name string + ccm string + polyId uint64 + wallet *StarcoinWallet +} + +func (this *Submitter) Init(config *config.SubmitterConfig) (err error) { + this.config = config + this.sdk, err = starcoin.WithOptions(config.ChainId, config.Nodes, time.Minute, 1) + if err != nil { + return + } + if config.Wallet != nil { + sdk, e := starcoin.WithOptions(config.ChainId, config.Wallet.Nodes, time.Minute, 1) + if e != nil { + return e + } + w := NewStarcoinWallet(config.Wallet, sdk) + err = w.Init() + if err != nil { + return err + } + this.wallet = w + } + + this.ccm = util.LowerHex(config.CCMContract) + this.name = base.GetChainName(config.ChainId) + this.polyId = zion.ReadChainID() + return +} + +func (this *Submitter) Submit(message msg.Message) error { + return nil +} + +func (this *Submitter) Hook(ctx context.Context, wg *sync.WaitGroup, ch <-chan msg.Message) error { + this.Context = ctx + this.wg = wg + return nil +} + +func (this *Submitter) Start(ctx context.Context, wg *sync.WaitGroup, bus bus.TxBus, delay bus.DelayedTxBus, composer msg.PolyComposer) error { + this.Context = ctx + this.wg = wg + log.Info("Starting submitter worker", "index", 0, "total", 1, "account", this.wallet.Address, "chain", this.name) + go this.run(this.wallet, bus, delay, composer) + return nil +} + +func (this *Submitter) run(wallet *StarcoinWallet, mq bus.TxBus, delay bus.DelayedTxBus, compose msg.PolyComposer) error { + this.wg.Add(1) + defer this.wg.Done() + for { + select { + case <-this.Done(): + log.Info("Submitter is exiting now", "chain", this.name) + return nil + default: + } + tx, err := mq.Pop(this.Context) + if err != nil { + log.Error("Bus pop error", "err", err) + continue + } + if tx == nil { + time.Sleep(time.Second) + continue + } + log.Info("Processing poly tx", "poly_hash", tx.PolyHash.Hex(), "account", wallet.Address) + err = this.ProcessTx(tx, compose) + if err == nil { + err = this.SubmitTx(tx) + } + if err != nil { + log.Error("Process poly tx error", "chain", this.name, "err", err) + log.Json(log.ERROR, tx) + if errors.Is(err, msg.ERR_INVALID_TX) || errors.Is(err, msg.ERR_TX_BYPASS) { + log.Error("Skipped poly tx for error", "poly_hash", tx.PolyHash, "err", err) + continue + } + tx.Attempts++ + if errors.Is(err, msg.ERR_STARCOIN_SEQUENCE_NUMBER_INVALID) { + tsp := time.Now().Unix() + 60 + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } else if errors.Is(err, msg.ERR_LOW_BALANCE) { + tsp := time.Now().Unix() + 60*10 + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } else if errors.Is(err, msg.ERR_STARCOIN_COIN_STORE_NOT_PUBLISHED) { + tsp := time.Now().Unix() + 60*10 + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } else if errors.Is(err, msg.ERR_STARCOIN_TREASURY_NOT_EXIST) { + tsp := time.Now().Unix() + 60*10 + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } else { + tsp := time.Now().Unix() + 60*3 + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } + } else { + log.Info("Submitted poly tx", "poly_hash", tx.PolyHash.Hex(), "chain", this.name, "dst_hash", tx.DstHash) + + // Retry to verify a successful submit + tsp := time.Now().Unix() + 60*3 + if tx.DstHash != "" { + bus.SafeCall(this.Context, tx, "push to delay queue", func() error { return delay.Delay(context.Background(), tx, tsp) }) + } + } + } +} + +func (this *Submitter) Process(m msg.Message, composer msg.PolyComposer) error { + tx, ok := m.(*msg.Tx) + if !ok { + return fmt.Errorf("%s Proccess: Invalid poly tx cast %v", this.name, m) + } + return this.ProcessTx(tx, composer) +} + +func (this *Submitter) ProcessTx(m *msg.Tx, compose msg.PolyComposer) (err error) { + if m.Type() != msg.POLY { + return fmt.Errorf("%s desired message is not poly tx %v", this.name, m.Type()) + } + + if m.DstChainId != this.config.ChainId { + return fmt.Errorf("message dst chain does not match %v", m.DstChainId) + } + + err = compose(m) + if err != nil { + return + } + return this.processPolyTx(m) +} + +func (this *Submitter) processPolyTx(tx *msg.Tx) (err error) { + txJson, _ := json.Marshal(tx) + fmt.Printf("tx: %s\n", string(txJson)) + + argsZS := util.NewZeroCopySource(tx.MerkleValue.MakeTxParam.Args) + argsAssetAddress, eof := argsZS.NextVarBytes() + if eof { + return fmt.Errorf("%s failed to decode Args %v", this.name, err) + } + fmt.Println("argsAssetAddress=", string(argsAssetAddress)) + tx.ToAssetAddress = string(argsAssetAddress) + return +} + +func (this *Submitter) ExecuteScriptFunction( + moduleId starcoin_types.ModuleId, + functionName string, + typeArgs []starcoin_types.TypeTag, + args [][]byte) (string, error) { + + payload := starcoin_types.TransactionPayload__ScriptFunction{ + Value: starcoin_types.ScriptFunction{ + Module: moduleId, + Function: starcoin_types.Identifier(functionName), + TyArgs: typeArgs, + Args: args, + }} + + gasPrice, err := this.sdk.Node().GetGasUnitPrice(context.Background()) + if err != nil { + return "", fmt.Errorf("starcoin GetGas price failed :%s", err.Error()) + } + + accountNonce, err := this.sdk.Node().GetAccountSequenceNumber(this.Context, this.wallet.address()) + if err != nil { + return "", fmt.Errorf("%w Starcoin GetAccount nonce error: %s", msg.ERR_TX_EXEC_FAILURE, err) + } + + gasLimit := starcoin_client.DEFAULT_MAX_GAS_AMOUNT * 4 + rawTransaction, err := this.sdk.Node().BuildRawUserTransaction( + context.Background(), + this.wallet.Address, + &payload, + gasPrice, + uint64(gasLimit), + accountNonce) + if err != nil { + return "", fmt.Errorf("starcoin Submittx | BuildRawUserTransaction error: %s", err.Error()) + } + + pubKey := this.wallet.asPublicKey() + pubKeyStr := hex.EncodeToString(pubKey) + log.Info("starcoin Submittx | Publickey: ", pubKeyStr, ". ") + + dryResult, err := this.sdk.Node().DryRunRaw(context.Background(), *rawTransaction, pubKey) + if err != nil { + return "", fmt.Errorf("starcoin Submittx | DryRunRaw error: %s", err.Error()) + } + + if dryResult.Status != "Executed" { + return "", fmt.Errorf("starcoin Submittx | DryRunRaw error: %s", dryResult.Status) + } + + return this.sdk.Node().SubmitTransaction(context.Background(), this.wallet.asPrivateKey(), rawTransaction) +} + +func (this *Submitter) SubmitTx(tx *msg.Tx) (err error) { + cctx, err := hex.DecodeString(tx.PolyParam) + if err != nil || len(cctx) == 0 { + return fmt.Errorf("poly param merke value missing or invalid") + } + + hsHeader, err := rlp.EncodeToBytes(types.HotstuffFilteredHeader(tx.AnchorHeader)) + if err != nil { + log.Error("EncodeToBytes Hotstuff failed", "polyHash", tx.PolyHash.Hex(), "err", err) + return err + } + + extra, err := types.ExtractHotstuffExtra(tx.AnchorHeader) + if err != nil { + log.Error("ExtractHotstuffExtra failed", "polyHash", tx.PolyHash.Hex(), "err", err) + return + } + rawSeals, err := rlp.EncodeToBytes(extra.CommittedSeal) + if err != nil { + log.Error("rlp.EncodeToBytes failed", "polyHash", tx.PolyHash.Hex(), "err", err) + return + } + + log.Info("Before commit relayer transaction from zion ", + " \nhsHeader: ", hex.EncodeToString(hsHeader), + "\nrawSeals: ", hex.EncodeToString(rawSeals), + "\n tx.PolyAccountProof: ", hex.EncodeToString(tx.PolyAccountProof), + "\n tx.PolyStorageProof: ", hex.EncodeToString(tx.PolyStorageProof), + "\n cctx: ", hex.EncodeToString(cctx)) + + coinTypeTag, err := getAssetCoinTypeTag(tx.ToAssetAddress) + if err != nil { + return fmt.Errorf("getAssetCoinTypeTag error: %s", err) + } + + rawTx, err := this.ExecuteScriptFunction( + starcoin_types.ModuleId{Address: this.wallet.Address, Name: "zion_lock_proxy_script"}, + "relay_unlock_tx", + []starcoin_types.TypeTag{coinTypeTag}, + [][]byte{ + encode_u8vector_argument(hsHeader), + encode_u8vector_argument(rawSeals), + encode_u8vector_argument(tx.PolyAccountProof), + encode_u8vector_argument(tx.PolyStorageProof), + encode_u8vector_argument(cctx), + }) + + if err != nil { + info := err.Error() + if strings.Contains(info, "SEQUENCE_NUMBER_TOO_OLD") || strings.Contains(info, "SEQUENCE_NUMBER_TOO_NEW") { + err = msg.ERR_STARCOIN_SEQUENCE_NUMBER_INVALID + } else if strings.Contains(info, "INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE") { + err = msg.ERR_LOW_BALANCE + } else if strings.Contains(info, "ECOIN_STORE_NOT_PUBLISHED") { + err = msg.ERR_STARCOIN_COIN_STORE_NOT_PUBLISHED + } else if strings.Contains(info, "ETREASURY_NOT_EXIST") { + err = msg.ERR_STARCOIN_TREASURY_NOT_EXIST + } + } else { + log.Info("starcoin", "script payload tx hash", rawTx) + tx.DstHash = rawTx + } + return +} + +func getAssetCoinTypeTag(toAssetAddress string) (starcoin_types.TypeTag, error) { + parts := strings.Split(toAssetAddress, "<") + if len(parts) != 2 { + return nil, fmt.Errorf("invalid toAssetAddress: %s", toAssetAddress) + } + + parts = strings.Split(strings.TrimSuffix(parts[1], ">"), "::") + if len(parts) != 3 { + return nil, fmt.Errorf("invalid toAssetAddress: %s", toAssetAddress) + } + + if len(parts[0])%2 == 1 { + parts[0] = strings.Replace(parts[0], "0x", "0x0", 1) + } + addr, err := starcoin_types.ToAccountAddress(parts[0]) + if err != nil { + return nil, fmt.Errorf("getAssetCoinTypeTag HexToAccountAddress failed. err: %s", err) + } + + return &starcoin_types.TypeTag__Struct{ + Value: starcoin_types.StructTag{ + Address: *addr, + Module: starcoin_types.Identifier(parts[1]), + Name: starcoin_types.Identifier(parts[2]), + }}, nil +} + +func (this *Submitter) ProcessEpochs(epochs []*msg.Tx) error { + for _, m := range epochs { + if m.Type() != msg.POLY_EPOCH || m.PolyEpoch == nil { + return fmt.Errorf("Invalid Poly epoch message %s", m.Encode()) + } + epoch := m.PolyEpoch + log.Info("Submitting poly epoch", "epoch", epoch.EpochId, "height", epoch.Height, "chain", this.name, "current poly height ") + + log.Info("Print change epoch data: ", + " \nepoch.Header: ", hex.EncodeToString(epoch.Header), + "\nepoch.Seal: ", hex.EncodeToString(epoch.Seal)) + + rawTx, err := this.ExecuteScriptFunction( + starcoin_types.ModuleId{Address: this.wallet.Address, Name: "zion_cross_chain_manager_script"}, + "change_epoch", + []starcoin_types.TypeTag{}, + [][]byte{ + encode_u8vector_argument(epoch.Header), + encode_u8vector_argument(epoch.Seal), + }) + if err != nil { + return fmt.Errorf("Starcoin epoch sync SubmitTransaction failed. epoch: %d, err: %v", epoch.EpochId, err) + } else { + log.Info("Starcoin epoch sync", "epoch", epoch.EpochId, "hash", rawTx) + } + count := 20 + CONFIRM: + for { + txInfo, e := this.sdk.Node().GetTransactionInfoByHash(this.Context, rawTx) + if e != nil { + count-- + e = fmt.Errorf("Starcoin epoch sync GetTransactionByHash failed, hash: %s, err: %v", rawTx, e) + } else { + if strings.EqualFold("\"Executed\"", string(txInfo.Status)) { + log.Info("Starcoin epoch sync tx confirmed", "epoch", epoch.EpochId, "hash", rawTx) + break CONFIRM + } else { + e = fmt.Errorf("Starcoin epoch sync tx pedding, hash: %s, VmStatus: %s", rawTx, txInfo.Status) + } + } + time.Sleep(time.Second * 3) + if count <= 0 { + return e + } + } + } + return nil +} + +func ToUint64(i interface{}) (uint64, error) { + switch i := i.(type) { + case uint64: + return i, nil + case float64: + return uint64(i), nil + case string: + return strconv.ParseUint(i, 10, 64) + case json.Number: + r, err := i.Int64() + return uint64(r), err + } + return 0, fmt.Errorf("unknown type to uint64 %t", i) +} + +func ExtractSingleResult(result interface{}) interface{} { + r := result.([]interface{}) + if len(r) == 0 { + return nil + } + return r[0] +} + +func (this *Submitter) GetPolyEpochStartHeight() (uint64, error) { + c := starcoin_client.ContractCall{ + FunctionId: fmt.Sprintf("%s::zion_cross_chain_manager::getCurEpochStartHeight", "0x"+strings.TrimPrefix(this.ccm, "0x")), + TypeArgs: []string{}, + Args: []string{}, + } + r, err := this.sdk.Node().CallContract(context.Background(), c) + if err != nil { + return 0, err + } + return ToUint64(ExtractSingleResult(r)) +} + +func (this *Submitter) Stop() error { + this.wg.Wait() + return nil +} diff --git a/relayer/starcoin/starcoin_test.go b/relayer/starcoin/starcoin_test.go new file mode 100644 index 00000000..987705b6 --- /dev/null +++ b/relayer/starcoin/starcoin_test.go @@ -0,0 +1,63 @@ +package starcoin + +import ( + "github.com/polynetwork/bridge-common/log" + "testing" +) + +func TestGetAssetCoinTypeTag(t *testing.T) { + //hexBytes, _ := hex.DecodeString("0x000000000000000000000000000000010353544303535443") + //tokenCode, _ := BcsDeserializeTokenCode(hexBytes) + //tokenTag := fmt.Sprintf("%s::%s::%s", tokenCode.Address, tokenCode.Module, tokenCode.Name) + coinTypeTag, _ := getAssetCoinTypeTag("0x00000000000000000000000000000001::STC::STC") + log.Info("Coin type tag: ", coinTypeTag, "") +} + +//func TestG(t *testing.T) { +// txJson := "{\"TxType\":2,\"Attempts\":1,\"TxId\":\"2c38e0fd45b4eb4a73f7fe12749bd1229dde283399bffabd4e90589c1e561f57\",\"SrcChainId\":318,\"SrcProxy\":\"000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f08ac0c1c6c8f2be528b35824755054000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f78790000000000000000000000000000000000\",\"PolyHash\":\"0x983561882d758959e2022006b4d0848dfd6a677fd2c06e5ab80466e992fa9565\",\"PolyHeight\":178220,\"PolyKey\":\"0x3b7cfcc4efb9d360c5c96cfdfe2c4b3d8feeaa303a14cea1bd2e1e0d76e39362\",\"AnchorHeight\":179948,\"PolyParam\":\"f90177a0983561882d758959e2022006b4d0848dfd6a677fd2c06e5ab80466e992fa956582013ef901509000000000000000000000000000000000a02c38e0fd45b4eb4a73f7fe12749bd1229dde283399bffabd4e90589c1e561f57b8c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010f08ac0c1c6c8f2be528b35824755054000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f7a696f6e5f6c6f636b5f70726f7879000000000000000000000000000000000082013e90f08ac0c1c6c8f2be528b35824755054086756e6c6f636bb83f0d3078313a3a5354433a3a5354431048b75ec5bb72e54bca2633c36ca3eb041027000000000000000000000000000000000000000000000000000000000000\",\"DstChainId\":318,\"DstProxy\":\"f08ac0c1c6c8f2be528b358247550540\",\"ToAssetAddress\":\"0x1::STC::STC\",\"Delay\":0}" +// tx := json.Unmarshal() +// coinTypeTag, _ := getAssetCoinTypeTag("0x00000000000000000000000000000001::STC::STC") +// +// cctx, err := hex.DecodeString(tx.PolyParam) +// if err != nil || len(cctx) == 0 { +// return fmt.Errorf("poly param merke value missing or invalid") +// } +// +// hsHeader, err := rlp.EncodeToBytes(types.HotstuffFilteredHeader(tx.AnchorHeader)) +// if err != nil { +// log.Error("EncodeToBytes Hotstuff failed", "polyHash", tx.PolyHash.Hex(), "err", err) +// return err +// } +// +// extra, err := types.ExtractHotstuffExtra(tx.AnchorHeader) +// if err != nil { +// log.Error("ExtractHotstuffExtra failed", "polyHash", tx.PolyHash.Hex(), "err", err) +// return +// } +// rawSeals, err := rlp.EncodeToBytes(extra.CommittedSeal) +// if err != nil { +// log.Error("rlp.EncodeToBytes failed", "polyHash", tx.PolyHash.Hex(), "err", err) +// return +// } +// +// //seed, err := hex.DecodeString(this.wallet.PrivateKey) +// //if err != nil { +// // return fmt.Errorf("decode private key error: %v", err) +// //} +// //priv := ed25519.NewKeyFromSeed(seed) +// //pub := priv.Public().(ed25519.PublicKey) +// //authKey := sha3.Sum256(append(pub[:], 0x00)) +// //address := hex.EncodeToString(authKey[:]) +// +// coinTypeTag, err := getAssetCoinTypeTag(tx.ToAssetAddress) +// if err != nil { +// return fmt.Errorf("getAssetCoinTypeTag error: %s", err) +// } +// log.Info("Before commit relayer transaction from zion, \nhsHeader: %s\n rawSeals: %s\n tx.PolyAccountProof\n tx.PolyStorageProof: %s\n ccctx: %s\n", +// starcoin_client.BytesToHexString(hsHeader), +// starcoin_client.BytesToHexString(rawSeals), +// starcoin_client.BytesToHexString(tx.PolyAccountProof), +// starcoin_client.BytesToHexString(tx.PolyStorageProof), +// starcoin_client.BytesToHexString(cctx)) +// log.Info("Coin type tag: ", coinTypeTag) +//} diff --git a/relayer/starcoin/starcoin_wallet.go b/relayer/starcoin/starcoin_wallet.go new file mode 100644 index 00000000..78d1490c --- /dev/null +++ b/relayer/starcoin/starcoin_wallet.go @@ -0,0 +1,47 @@ +package starcoin + +import ( + "encoding/hex" + "github.com/blocktree/go-owcrypt" + "github.com/polynetwork/bridge-common/chains/starcoin" + "github.com/polynetwork/bridge-common/log" + "github.com/polynetwork/bridge-common/wallet" + starcoin_types "github.com/starcoinorg/starcoin-go/types" +) + +type StarcoinWallet struct { + sdk *starcoin.SDK + Address starcoin_types.AccountAddress + PrivateKey string + config *wallet.Config +} + +func NewStarcoinWallet(config *wallet.Config, sdk *starcoin.SDK) *StarcoinWallet { + account, err := starcoin_types.ToAccountAddress(config.Address) + if err != nil { + log.Error("Parse account failed, {}", config.Address) + } + return &StarcoinWallet{sdk: sdk, Address: *account, PrivateKey: config.PrivateKey, config: config} +} + +func (this *StarcoinWallet) asPublicKey() starcoin_types.Ed25519PublicKey { + bytes, err := hex.DecodeString(this.PrivateKey) + if err != nil { + log.Error("Parse account failed, {}", this.Address) + } + publicKeyBytes, _ := owcrypt.GenPubkey(bytes, owcrypt.ECC_CURVE_ED25519_NORMAL) + return publicKeyBytes +} + +func (this *StarcoinWallet) asPrivateKey() starcoin_types.Ed25519PrivateKey { + privateKeyBytes, _ := hex.DecodeString(this.PrivateKey) + return privateKeyBytes +} + +func (this *StarcoinWallet) address() string { + return this.config.Address +} + +func (w *StarcoinWallet) Init() (err error) { + return +} diff --git a/relayer/starcoin/util.go b/relayer/starcoin/util.go new file mode 100644 index 00000000..bc29bb77 --- /dev/null +++ b/relayer/starcoin/util.go @@ -0,0 +1,132 @@ +package starcoin + +import ( + "bytes" + "crypto/ed25519" + "crypto/elliptic" + "encoding/hex" + "fmt" + "math/big" + "strings" + "time" + + "github.com/btcsuite/btcd/btcec" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ontio/ontology-crypto/ec" + "github.com/ontio/ontology-crypto/keypair" + "github.com/ontio/ontology-crypto/sm2" +) + +// encode big int to hex string +func EncodeBigInt(b *big.Int) string { + if b.Uint64() == 0 { + return "00" + } + return hex.EncodeToString(b.Bytes()) +} + +// encode bytes to hex with prefix +func EncodeToHex(b []byte) string { + return "0x" + hex.EncodeToString(b) +} + +func HexWithPrefixToBytes(str string) ([]byte, error) { + if !strings.HasPrefix(str, "0x") { + return nil, fmt.Errorf("it does not have 0x prefix") + } + return hex.DecodeString(str[2:]) +} + +func HexToBytes(str string) ([]byte, error) { + if !strings.HasPrefix(str, "0x") { + return hex.DecodeString(str[:]) + } + return hex.DecodeString(str[2:]) +} + +func CurrentTimeMillis() int64 { + return time.Now().UnixNano() / 1000000 +} + +const ( + STARCOIN_CHAIN_ID_MAIN int = 1 + STARCOIN_CHAIN_ID_BARNARD int = 251 + STARCOIN_CHAIN_ID_PROXIMA int = 252 + STARCOIN_CHAIN_ID_HALLEY int = 253 +) + +// Get Starcoin explorer Txn. URL +func GetExplorerUrl(chainId int) string { + switch chainId { + case STARCOIN_CHAIN_ID_MAIN: + return "https://stcscan.io/main/transactions/detail/" + case STARCOIN_CHAIN_ID_BARNARD: + return "https://stcscan.io/barnard/transactions/detail/" + case STARCOIN_CHAIN_ID_PROXIMA: + return "https://stcscan.io/proxima/transactions/detail/" + case STARCOIN_CHAIN_ID_HALLEY: + return "https://stcscan.io/halley/transactions/detail/" + default: + return "{NO-URL}/" + } +} + +func GetNoCompresskey(key keypair.PublicKey) []byte { + var buf bytes.Buffer + switch t := key.(type) { + case *ec.PublicKey: + switch t.Algorithm { + case ec.ECDSA: + // Take P-256 as a special case + if t.Params().Name == elliptic.P256().Params().Name { + return ec.EncodePublicKey(t.PublicKey, false) + } + buf.WriteByte(byte(0x12)) + case ec.SM2: + buf.WriteByte(byte(0x13)) + } + label, err := GetCurveLabel(t.Curve.Params().Name) + if err != nil { + panic(err) + } + buf.WriteByte(label) + buf.Write(ec.EncodePublicKey(t.PublicKey, false)) + case ed25519.PublicKey: + panic("err") + default: + panic("err") + } + return buf.Bytes() +} + +func GetCurveLabel(name string) (byte, error) { + switch strings.ToUpper(name) { + case strings.ToUpper(elliptic.P224().Params().Name): + return 1, nil + case strings.ToUpper(elliptic.P256().Params().Name): + return 2, nil + case strings.ToUpper(elliptic.P384().Params().Name): + return 3, nil + case strings.ToUpper(elliptic.P521().Params().Name): + return 4, nil + case strings.ToUpper(sm2.SM2P256V1().Params().Name): + return 20, nil + case strings.ToUpper(btcec.S256().Name): + return 5, nil + default: + panic("err") + } +} + +func GetEthNoCompressKey(key keypair.PublicKey) []byte { + var buf bytes.Buffer + switch t := key.(type) { + case *ec.PublicKey: + return crypto.FromECDSAPub(t.PublicKey) + case ed25519.PublicKey: + panic("err") + default: + panic("err") + } + return buf.Bytes() +} diff --git a/relayer/tx_vote.go b/relayer/tx_vote.go index 85ba016e..f767cc3a 100644 --- a/relayer/tx_vote.go +++ b/relayer/tx_vote.go @@ -20,10 +20,16 @@ package relayer import ( "context" "fmt" + "github.com/devfans/zion-sdk/contracts/native/governance/side_chain_manager" + "github.com/devfans/zion-sdk/contracts/native/utils" + "github.com/ethereum/go-ethereum/rlp" "github.com/polynetwork/poly-relayer/msg" + "github.com/polynetwork/poly-relayer/relayer/ripple" + "math/big" "sync" "time" + "github.com/devfans/zion-sdk/contracts/native/go_abi/side_chain_manager_abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/polynetwork/bridge-common/base" "github.com/polynetwork/bridge-common/log" @@ -100,6 +106,7 @@ func (h *TxVoteHandler) start() (err error) { log.Info("Scanning Aptos txs", "CCM sequence", scanStart, "chain", h.config.ChainId) } else { h.height++ + scanStart = h.height if latest < h.height+confirms { if h.listener.Nodes() != nil { latest, ok = h.listener.Nodes().WaitTillHeight(h.Context, h.height+confirms, h.listener.ListenCheck()) @@ -110,7 +117,6 @@ func (h *TxVoteHandler) start() (err error) { continue } log.Info("Scanning txs in block", "height", h.height, "chain", h.config.ChainId) - scanStart = h.height } } @@ -205,11 +211,12 @@ func (h *TxVoteHandler) startReplenish() { } tx, e := h.listener.ScanTx(hash) - if e != nil { + if e != nil || tx == nil { log.Error("Tx vote replenish scan tx failure", "chain", h.config.ChainId, "hash", hash, "err", e) continue } + log.Info("Tx vote replenish found src tx", "chain", h.Chain(), "hash", hash) e = h.submitter.VoteTxOfHash(tx, h.store) if e != nil { log.Error("Replenish tx vote failure", "chain", h.config.ChainId, "height", height, "hash", hash, "err", e) @@ -237,6 +244,65 @@ func (h *TxVoteHandler) replenish() { return } +func (h *TxVoteHandler) updateRippleFee() error { + h.wg.Add(1) + defer h.wg.Done() + + ticker := time.NewTicker(1 * time.Minute) + defer ticker.Stop() + + log.Info("updateRippleFee will start...", "chain", h.Chain()) + for { + select { + case <-h.Done(): + log.Info("updateRippleFee is exiting...", "chain", h.config.ChainId, "height", h.height) + return nil + default: + } + + select { + case <-ticker.C: + rippleFee, err := h.listener.(*ripple.Listener).GetFee() + if err != nil { + log.Error("Ripple GetFee failed", "err", err) + continue + } + + zionFee := &side_chain_manager.Fee{ + Fee: new(big.Int), + } + sideChainManager, err := side_chain_manager_abi.NewISideChainManager(utils.SideChainManagerContractAddress, h.submitter.SDK().Node()) + result, err := sideChainManager.GetFee(&bind.CallOpts{}, h.Chain()) + if err != nil { + log.Error("Zion GetFee failed", "chain", h.Chain(), "err", err) + continue + } + err = rlp.DecodeBytes(result, zionFee) + if err != nil { + log.Error("zion GetFee rlp.DecodeBytes failed", "err", err) + continue + } + log.Info("Ripple fee", "rippleFee", rippleFee, "zionFee", zionFee.Fee.String()) + + if uint64(rippleFee) > zionFee.Fee.Uint64()*4/5 || uint64(rippleFee) < zionFee.Fee.Uint64()/20 { + param := &side_chain_manager.UpdateFeeParam{ + ChainID: h.Chain(), + ViewNum: zionFee.View, + Fee: new(big.Int).SetUint64(uint64(rippleFee)), + } + + hash, err := h.submitter.UpdateFee(param) + if err != nil { + log.Error("updateRippleFee failed", "err", err) + continue + } + log.Info("updateRippleFee success", "fee", param.Fee.Uint64(), "hash", hash) + } + default: + } + } +} + func (h *TxVoteHandler) Start() (err error) { if h.config.ChainId == base.APTOS { if h.config.CCMEventSequence == 0 { @@ -255,7 +321,7 @@ func (h *TxVoteHandler) Start() (err error) { } else { h.height, err = h.store.GetTxHeight() if err != nil { - log.Error("get voter start height from store failed", "err", err) + log.Error("get voter start height from store failed", "chain", h.Chain(), "err", err) return } } @@ -265,6 +331,11 @@ func (h *TxVoteHandler) Start() (err error) { h.submitter.StartTxVote(h.Context, h.wg, h.config, h.store) go h.start() go h.replenish() + + if h.Chain() == base.RIPPLE { + go h.updateRippleFee() + } + return } diff --git a/relayer/validate.go b/relayer/validate.go index cb5510ee..79262987 100644 --- a/relayer/validate.go +++ b/relayer/validate.go @@ -23,8 +23,8 @@ import ( "fmt" "time" - "github.com/polynetwork/bridge-common/log" "github.com/ethereum/go-ethereum/common" + "github.com/polynetwork/bridge-common/log" "github.com/polynetwork/bridge-common/tools" "github.com/polynetwork/poly-relayer/bus" "github.com/polynetwork/poly-relayer/config" @@ -38,9 +38,9 @@ type IValidator interface { } type Validator struct { - vs func(uint64) IValidator + vs func(uint64) IValidator listener IChainListener - outputs chan tools.CardEvent + outputs chan tools.CardEvent } func StartValidator(vs func(uint64) IValidator, listener IChainListener, outputs chan tools.CardEvent) (err error) { @@ -62,9 +62,9 @@ func (v *Validator) start() (err error) { } var ( - latest uint64 + latest uint64 listener *eth.Listener - scan func(uint64) ([]*msg.Tx, error) + scan func(uint64) ([]*msg.Tx, error) ) if chainID > 0 { @@ -74,10 +74,9 @@ func (v *Validator) start() (err error) { scan = v.listener.(*zion.Listener).ScanDst } - for { height++ - if latest < height { + if latest < height { latest, _ = v.listener.Nodes().WaitTillHeight(context.Background(), height, v.listener.ListenCheck()) } log.Info("Validating txs in block", "height", height, "chain", chainID) @@ -100,7 +99,9 @@ func (v *Validator) start() (err error) { print = log.Error } print("Validating tx", "chain", chainID, "origin", tx.SrcChainId, "hash", hash, "err", err) - if err == nil || errors.Is(err, msg.ERR_TX_VOILATION) { break } + if err == nil || errors.Is(err, msg.ERR_TX_VOILATION) { + break + } time.Sleep(time.Second) } if err != nil { @@ -111,7 +112,7 @@ func (v *Validator) start() (err error) { } } } - if height % 100 == 0 { + if height%100 == 0 { status.SetHeight(chainID, bus.KEY_HEIGHT_VALIDATOR, height) } if listener != nil { @@ -126,4 +127,3 @@ func (v *Validator) start() (err error) { } } - diff --git a/relayer/zion/zion.go b/relayer/zion/zion.go index 0ce74a4b..5d6f6d0b 100644 --- a/relayer/zion/zion.go +++ b/relayer/zion/zion.go @@ -22,6 +22,8 @@ import ( "encoding/hex" "errors" "fmt" + "github.com/devfans/zion-sdk/contracts/native/go_abi/side_chain_manager_abi" + "github.com/devfans/zion-sdk/contracts/native/governance/side_chain_manager" "math/big" "strings" "sync" @@ -71,6 +73,7 @@ type Submitter struct { blocksToWait uint64 txabi abi.ABI hsabi abi.ABI + scabi abi.ABI } type Composer struct { @@ -116,6 +119,11 @@ func (s *Submitter) Init(config *config.SubmitterConfig) (err error) { return } + s.scabi, err = abi.JSON(strings.NewReader(side_chain_manager_abi.ISideChainManagerABI)) + if err != nil { + return + } + s.txabi, err = abi.JSON(strings.NewReader(ccm.ICrossChainManagerABI)) return } @@ -270,13 +278,11 @@ func (s *Submitter) RetryWithData(account accounts.Account, store *store.Store, needRetry = false } else if !pending { hash, err := s.wallet.SendWithAccount(account, tx.To, big.NewInt(0), 0, nil, nil, tx.Data) - // TODO: detect already done tx here if err != nil || hash == "" { - if strings.Contains(err.Error(), "CheckConsensusSigns, signer already exist") { + if strings.Contains(err.Error(), "signer already exist") { alreadyDone = true needRetry = false } - // else if other case (header sync) todo if alreadyDone { log.Warn("tx already sent to zion", "src hash", tx.Hash.Hex(), "To", tx.To.Hex(), "err", err) } else { @@ -337,7 +343,7 @@ func (s *Submitter) VoteHeaderOfHeight(height uint32, header []byte, store *stor } hash, err := s.wallet.Send(zion.INFO_SYNC_ADDRESS, big.NewInt(0), 0, nil, nil, data) if err != nil || hash == "" { - log.Error("Failed to send header", "err", err, "hash", hash) + log.Error("Failed to send header", "chain", s.config.ChainId, "err", err) return } log.Info("Send header vote", "src height", height, "zion hash", hash, "chain", s.name) @@ -431,7 +437,7 @@ func (s *Submitter) voteHeader(account accounts.Account, store *store.Store) { return store.DeleteHeader(headers...) }) } else { - log.Error("Failed to send header", "err", err, "hash", hash) + log.Error("Failed to send header", "chain", s.config.ChainId, "err", err) } continue } @@ -615,6 +621,33 @@ func (s *Submitter) voteTx(account accounts.Account, store *store.Store) { } } +func (s *Submitter) UpdateFee(param *side_chain_manager.UpdateFeeParam) (hash string, err error) { + digest, err := param.Digest() + if err != nil { + err = fmt.Errorf("UpdateFee param.Digest err: %v", err) + return + } + + param.Signature, err = s.voter.SignHash(digest) + if err != nil { + err = fmt.Errorf("UpdateFee sign param err: %v", err) + return + } + + data, err := s.scabi.Pack("updateFee", param.ChainID, param.ViewNum, param.Fee, param.Signature) + if err != nil { + err = fmt.Errorf("UpdateFee pack data err: %v", err) + return + } + + hash, err = s.wallet.Send(utils.SideChainManagerContractAddress, big.NewInt(0), 0, nil, nil, data) + if err != nil { + err = fmt.Errorf("UpdateFee send tx err: %v", err) + return + } + return +} + func (s *Submitter) consume(account accounts.Account, mq bus.SortedTxBus) error { s.wg.Add(1) defer s.wg.Done() diff --git a/scripts/docker-compose.yaml b/scripts/docker-compose.yaml new file mode 100644 index 00000000..9cf7d3cf --- /dev/null +++ b/scripts/docker-compose.yaml @@ -0,0 +1,8 @@ + +version: '3' +services: + redis: + image: redis + command: redis-server --requirepass "" + ports: + - "6379:6379" \ No newline at end of file diff --git a/scripts/start_server.sh b/scripts/start_server.sh new file mode 100755 index 00000000..f35fae92 --- /dev/null +++ b/scripts/start_server.sh @@ -0,0 +1,28 @@ + +# 0: poly to starcoin, 1: starcoin to poly, +# if you want to specific a scanning height, please use this command: +# `/server --config config.devnet.poly-starcoin.conf.json --roles config.devnet.poly-starcoin.roles.json settxblock -chain 0 -height ` +ROLE=$1 +START_HEIGHT=$2 + +set -e + +SCRIPT_PATH="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )" + +docker-compose down +docker-compose up -d + +if [ "${ROLE}" = "1" ] +then + CONFIG_FILE=config.devnet.poly-starcoin.conf.json + ROLE_FILE=config.devnet.poly-starcoin.roles.json +else + CONFIG_FILE=config.devnet.starcoin-poly.conf.json + ROLE_FILE=config.devnet.starcoin-poly.roles.json +fi + +cd "$SCRIPT_PATH/.." || exit +#gvm use system +./build.sh testnet +./server --config $CONFIG_FILE --roles $ROLE_FILE settxblock -chain 0 -height $START_HEIGHT +./server --config $CONFIG_FILE --roles $ROLE_FILE \ No newline at end of file diff --git a/store/bolt.go b/store/bolt.go index 5cdaa352..2d7313dd 100644 --- a/store/bolt.go +++ b/store/bolt.go @@ -15,7 +15,6 @@ * along with The poly network . If not, see . */ - package store import ( @@ -27,7 +26,9 @@ var ( ) func Init(file string) (err error) { - if db != nil { return } + if db != nil { + return + } db, err = bolt.Open(file, 0600, nil) return } @@ -59,14 +60,14 @@ func Write(bucket, key, value []byte) (err error) { return } -func Transact(bucket []byte, f func(bucket *bolt.Bucket)error) (err error) { +func Transact(bucket []byte, f func(bucket *bolt.Bucket) error) (err error) { err = db.Update(func(tx *bolt.Tx) error { return f(tx.Bucket(bucket)) }) return } -func Scan(bucket []byte, f func(bucket *bolt.Bucket)error) (err error) { +func Scan(bucket []byte, f func(bucket *bolt.Bucket) error) (err error) { err = db.View(func(tx *bolt.Tx) error { return f(tx.Bucket(bucket)) })