From c26670726eb01d68238f4d7517c3b3e64d5ead2d Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 10:48:14 +0800 Subject: [PATCH 1/7] Problem: cosmos-sdk `v0.46.7` is not used Solution: - update dependency - `v0.46.7` fix a gov migration issue which affect query votes of old proposals. --- CHANGELOG.md | 2 ++ go.mod | 30 +++++++++++++++--------------- go.sum | 32 ++++++++++++++++++++------------ gomod2nix.toml | 43 +++++++++++++++++++++---------------------- 4 files changed, 58 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c6bfd8b6d..80906e02d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## UNRELEASED ### Improvements + - [#781](/~https://github.com/crypto-org-chain/cronos/pull/781) Add prune command. +- [#]() Update cosmos-sdk to `v0.46.7`, it fix a gov migration issue. *Nov 22, 2022* diff --git a/go.mod b/go.mod index 61dc6eff84..2d6e321755 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( cosmossdk.io/math v1.0.0-beta.3 github.com/armon/go-metrics v0.4.1 - github.com/cosmos/cosmos-sdk v0.46.6 + github.com/cosmos/cosmos-sdk v0.46.7 github.com/cosmos/ibc-go/v5 v5.1.0 github.com/ethereum/go-ethereum v1.10.19 github.com/evmos/ethermint v0.6.1-0.20221101220534-a8ea4eceb6d9 @@ -19,7 +19,7 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 - github.com/tendermint/tendermint v0.34.23 + github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 google.golang.org/grpc v1.50.1 @@ -46,7 +46,7 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/btcsuite/btcd v0.22.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect @@ -55,14 +55,13 @@ require ( github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.7.0 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.4 // indirect - github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect - github.com/cosmos/ledger-go v0.9.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -167,16 +166,17 @@ require ( github.com/tklauser/numcpus v0.4.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect - github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect + github.com/zondax/hid v0.9.1 // indirect + github.com/zondax/ledger-go v0.14.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/crypto v0.1.0 // indirect + golang.org/x/crypto v0.2.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.1.0 // indirect + golang.org/x/net v0.2.0 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.97.0 // indirect @@ -189,9 +189,9 @@ require ( ) replace ( - // ics23 patch for dragonberry - github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.6 + // Ref: https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702 + github.com/confio/ics23/go => github.com/confio/ics23/go v0.9.0 + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.7 github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.19-deepcopy-jumptable github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.20.1-cronos diff --git a/go.sum b/go.sum index e6febca7d6..2e83c366c3 100644 --- a/go.sum +++ b/go.sum @@ -493,8 +493,9 @@ github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv 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= -github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= @@ -591,6 +592,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= +github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= @@ -731,15 +734,14 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= -github.com/cosmos/cosmos-sdk v0.46.6 h1:K9EZsqOZ2jQX3bIQUpn7Hk/YCoaJWRLU56PzvpX8INk= -github.com/cosmos/cosmos-sdk v0.46.6/go.mod h1:JNklMfXo7MhDF1j/jxZCmDyOYyqhVoKB22e8p1ATEqA= +github.com/cosmos/cosmos-sdk v0.46.7 h1:dkGy9y2ewgqvawrUOuWb2oz3MdotVduokyreXC4bS0s= +github.com/cosmos/cosmos-sdk v0.46.7/go.mod h1:fqKqz39U5IlEFb4nbQ72951myztsDzFKKDtffYJ63nk= github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1/go.mod h1:JUMM2MxF9wuwzRWZJjb8BjXsn1BmPmdBd3a75pIct4I= -github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= -github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -752,9 +754,9 @@ github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONAp github.com/cosmos/ibc-go/v5 v5.0.0-beta1/go.mod h1:9mmcbzuidgX7nhafIKng/XhXAHDEnRqDjGy/60W1cvg= github.com/cosmos/ibc-go/v5 v5.1.0 h1:m1NHXFkwwvNeJegZqtyox1WLinh+PMy4ivU/Cs9KjeA= github.com/cosmos/ibc-go/v5 v5.1.0/go.mod h1:H6sV0/CkNRDtvSrhbsIgiog1WnSwhguGfg8x34MOVEk= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= +github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= +github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= 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= @@ -2387,6 +2389,8 @@ github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPS github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.0 h1:dlMC7aO8Wss1CxBq2I96kZ69Nh1ligzbs8UWOtq/AsA= +github.com/zondax/ledger-go v0.14.0/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -2541,8 +2545,9 @@ golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0 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/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= +golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2704,8 +2709,9 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221017152216-f25eb7ecb193/go.mod h1:RpDiru2p0u2F0lLpEoqnP2+7xs0ifAuOcJ442g6GU2s= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -2930,8 +2936,9 @@ golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/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-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2939,8 +2946,9 @@ golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220919170432-7a66f970e087/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/gomod2nix.toml b/gomod2nix.toml index 37e7c6e494..5e5840f042 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -62,8 +62,8 @@ schema = 3 version = "v0.22.1" hash = "sha256-hBU+roIELcmbW2Gz7eGZzL9qNA1bakq5wNxqCgs4TKc=" [mod."github.com/btcsuite/btcd/btcec/v2"] - version = "v2.2.0" - hash = "sha256-cwoIqi0SiAaGEBtuQKip9OVirKIeJw5fUoWo7x/xfOc=" + version = "v2.3.2" + hash = "sha256-natWs+yIAuD1UI07iZtjPilroQLfXizFn3lNOiOT83U=" [mod."github.com/btcsuite/btcd/chaincfg/chainhash"] version = "v1.0.1" hash = "sha256-vix0j/KGNvoKjhlKgVeSLY6un2FHeIEoZWMC4z3yvZ4=" @@ -89,18 +89,17 @@ schema = 3 version = "v0.7.9" hash = "sha256-ZWIXIXcHGjeCNgMrpXymry8/8esDDauGFfF/+gEoO1Y=" [mod."github.com/confio/ics23/go"] - version = "v0.8.0" - hash = "sha256-mFKxFHp7RaE1L5NdtH9H9px2Cy6I5uOZVnFOgE8Nrew=" - replaced = "github.com/cosmos/cosmos-sdk/ics23/go" + version = "v0.9.0" + hash = "sha256-guD8w7YygfUp7lpTAUyXQuCPx8F3lXkcg+yR5+JOCbk=" [mod."github.com/cosmos/btcutil"] - version = "v1.0.4" - hash = "sha256-JvcBXBdjdmnaW/nyf/tw/uaOAGn1b78yxrtl2/Rs3kA=" + version = "v1.0.5" + hash = "sha256-t572Sr5iiHcuMKLMWa2i+LBAt192oa+G1oA371tG/eI=" [mod."github.com/cosmos/cosmos-proto"] version = "v1.0.0-alpha7" hash = "sha256-2wCH+toTF2A6MfFjOa13muEH5oBCcxAhZEqirNOrBA0=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.6" - hash = "sha256-H1VZxZUWXhpXiY3A9smLp09MEGpXmh+XvX6YUiXPcpQ=" + version = "v0.46.7" + hash = "sha256-54DCF8lrnA1oUmBJlbUlWXOP5UbenRInUROn5P5I9qI=" replaced = "github.com/cosmos/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" @@ -115,11 +114,8 @@ schema = 3 version = "v5.1.0" hash = "sha256-9ZwGw6XqYkBtj+vTQ2IodNb7VcGesTFnVsxjd+G1I6Q=" [mod."github.com/cosmos/ledger-cosmos-go"] - version = "v0.11.1" - hash = "sha256-yli+VvVtZmHo2LPvCY6lYVUfcCDn3sBLDL+a8KIlqDA=" - [mod."github.com/cosmos/ledger-go"] - version = "v0.9.2" - hash = "sha256-0YI+0A6wFBjiebBwzWOQjkgXkTakCrf7Gjg2xEaQdoM=" + version = "v0.12.1" + hash = "sha256-9+nr+/r4MyiogddS0JcXOuriPqXP4nxln8ts+mYQRcg=" [mod."github.com/creachadair/taskgroup"] version = "v0.3.2" hash = "sha256-Y261IO/d9xjV0UScqHvo31broxvnKn4IQQC9Mu6jNkE=" @@ -482,6 +478,9 @@ schema = 3 [mod."github.com/zondax/hid"] version = "v0.9.0" hash = "sha256-PvXtxXo/3C+DS9ZeGBlr4zXbIpaYNtMqLzxYhusFXNY=" + [mod."github.com/zondax/ledger-go"] + version = "v0.14.0" + hash = "sha256-RozTPSNs4RerZ4DQMBcGmvREjoRtH1G69xjhccYjIOk=" [mod."go.etcd.io/bbolt"] version = "v1.3.6" hash = "sha256-DenVAmyN22xUiivk6fdJp4C9ZnUJXCMDUf8E0goRRV4=" @@ -489,14 +488,14 @@ schema = 3 version = "v0.23.0" hash = "sha256-R3O9GyNtv6j0ic7s+2xkLLaLzbJEop0Otj1nJDFBjsg=" [mod."golang.org/x/crypto"] - version = "v0.1.0" - hash = "sha256-0oZWBSiW5Pd/2a1p2beuoelDe0CpfXZhrg/qPduJlYs=" + version = "v0.2.0" + hash = "sha256-7xbZm2rKYVl71Hcm4HIT8lN4ZxpcbaOt8a7vkq13VM0=" [mod."golang.org/x/exp"] version = "v0.0.0-20220722155223-a9213eeb770e" hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4=" [mod."golang.org/x/net"] - version = "v0.1.0" - hash = "sha256-SrThFBg6sqGYpiN1E3d1SilJxbKkQhSZXPmAFoMAA/I=" + version = "v0.2.0" + hash = "sha256-0MqnHDdLkkau6k7hlWD9MzIoAFROvxulyT+KzZkSXOs=" [mod."golang.org/x/oauth2"] version = "v0.0.0-20220909003341-f21342109be1" hash = "sha256-c+jWUXyCr6YJLRSQmA4GiuGqQaC88ZeiGCLpWOoSsyo=" @@ -504,11 +503,11 @@ schema = 3 version = "v0.0.0-20220929204114-8fcdb60fdcc0" hash = "sha256-Hygjq9euZ0qz6TvHYQwOZEjNiTbTh1nSLRAWZ6KFGR8=" [mod."golang.org/x/sys"] - version = "v0.1.0" - hash = "sha256-nZbEJ/2PuWrDLD4ujeVvcFGoIsfVoIH/Lcp4FjD7hpU=" + version = "v0.2.0" + hash = "sha256-N6yfQH7R2gfcvyWTQZbxWuSNyVy6hAxiab2WFzgAykI=" [mod."golang.org/x/term"] - version = "v0.1.0" - hash = "sha256-UWnNsJIj5nXsuzlPWQ1NyHQuHStaDacMVkFbJ4pnxXk=" + version = "v0.2.0" + hash = "sha256-azcllZ0o/9TurqX9udaJ0o9yxqSoI0/bSJsvQQLYIQc=" [mod."golang.org/x/text"] version = "v0.4.0" hash = "sha256-JvyMygdmTvWg7xhbnUB9MMk6WcYXJt8DAj4DYl82Pys=" From d231638966c22fa2d4707159d0ec29274d78c043 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 14 Dec 2022 10:54:52 +0800 Subject: [PATCH 2/7] Update CHANGELOG.md Signed-off-by: yihuang --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80906e02d9..985b9d0801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Improvements - [#781](/~https://github.com/crypto-org-chain/cronos/pull/781) Add prune command. -- [#]() Update cosmos-sdk to `v0.46.7`, it fix a gov migration issue. +- [#790 ](/~https://github.com/crypto-org-chain/cronos/pull/790) Update cosmos-sdk to `v0.46.7`, it fix a gov migration issue which affects query old proposals's votes. *Nov 22, 2022* From 49565884cd7fc71aa617be85d52db57731061355 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 10:58:42 +0800 Subject: [PATCH 3/7] use sdk streamers config --- app/app.go | 35 +++++++---------------------------- client/flags.go | 3 --- cmd/cronosd/cmd/root.go | 2 -- 3 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 client/flags.go diff --git a/app/app.go b/app/app.go index 8c92ba5d51..b23d21175a 100644 --- a/app/app.go +++ b/app/app.go @@ -1,11 +1,11 @@ package app import ( + "fmt" "io" "net/http" "os" "path/filepath" - "sync" "github.com/crypto-org-chain/cronos/x/cronos/middleware" @@ -20,13 +20,12 @@ import ( dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store/streaming/file" + "github.com/cosmos/cosmos-sdk/store/streaming" storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -121,7 +120,7 @@ import ( gravitytypes "github.com/peggyjv/gravity-bridge/module/v2/x/gravity/types" // this line is used by starport scaffolding # stargate/app/moduleImport - cronosappclient "github.com/crypto-org-chain/cronos/client" + "github.com/crypto-org-chain/cronos/x/cronos" cronosclient "github.com/crypto-org-chain/cronos/x/cronos/client" cronoskeeper "github.com/crypto-org-chain/cronos/x/cronos/keeper" @@ -347,30 +346,10 @@ func New( tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - // configure state listening capabilities using AppOptions - // we are doing nothing with the returned streamingServices and waitGroup in this case - // Only support file streamer right now. - if cast.ToString(appOpts.Get(cronosappclient.FlagStreamers)) == "file" { - streamingDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", FileStreamerDirectory) - if err := os.MkdirAll(streamingDir, os.ModePerm); err != nil { - panic(err) - } - - // default to exposing all - exposeStoreKeys := make([]storetypes.StoreKey, 0, len(keys)) - for _, storeKey := range keys { - exposeStoreKeys = append(exposeStoreKeys, storeKey) - } - service, err := file.NewStreamingService(streamingDir, "", exposeStoreKeys, appCodec) - if err != nil { - panic(err) - } - bApp.SetStreamingService(service) - - wg := new(sync.WaitGroup) - if err := service.Stream(wg); err != nil { - panic(err) - } + // load state streaming if enabled + if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, keys); err != nil { + fmt.Printf("failed to load state streaming: %s", err) + os.Exit(1) } app := &App{ diff --git a/client/flags.go b/client/flags.go deleted file mode 100644 index 96926045f6..0000000000 --- a/client/flags.go +++ /dev/null @@ -1,3 +0,0 @@ -package client - -const FlagStreamers = "streamers" diff --git a/cmd/cronosd/cmd/root.go b/cmd/cronosd/cmd/root.go index 49886e9232..dded42544f 100644 --- a/cmd/cronosd/cmd/root.go +++ b/cmd/cronosd/cmd/root.go @@ -46,7 +46,6 @@ import ( ethermint "github.com/evmos/ethermint/types" "github.com/crypto-org-chain/cronos/app" - cronosclient "github.com/crypto-org-chain/cronos/client" // this line is used by starport scaffolding # stargate/root/import ) @@ -150,7 +149,6 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) cronos.AddModuleInitFlags(startCmd) - startCmd.Flags().String(cronosclient.FlagStreamers, "", "Enable streamers, only file streamer is supported right now") // this line is used by starport scaffolding # stargate/root/initFlags } From 6815641dca3ce4c7188e6d865ed2f190a2a419f7 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 11:08:06 +0800 Subject: [PATCH 4/7] fix streamer test --- integration_tests/configs/cosmovisor.jsonnet | 1 + .../configs/cosmovisor_gravity.jsonnet | 1 + integration_tests/configs/default.jsonnet | 5 +- integration_tests/test_streamer.py | 66 ++++++------------- 4 files changed, 26 insertions(+), 47 deletions(-) diff --git a/integration_tests/configs/cosmovisor.jsonnet b/integration_tests/configs/cosmovisor.jsonnet index f9e546e7d5..f6a8e644a1 100644 --- a/integration_tests/configs/cosmovisor.jsonnet +++ b/integration_tests/configs/cosmovisor.jsonnet @@ -4,6 +4,7 @@ config { 'cronos_777-1'+: { 'app-config'+: { 'minimum-gas-prices': '100000000000basetcro', + store:: super.store, }, genesis+: { app_state+: { diff --git a/integration_tests/configs/cosmovisor_gravity.jsonnet b/integration_tests/configs/cosmovisor_gravity.jsonnet index 2645fa5aae..5068816d39 100644 --- a/integration_tests/configs/cosmovisor_gravity.jsonnet +++ b/integration_tests/configs/cosmovisor_gravity.jsonnet @@ -4,6 +4,7 @@ config { 'cronos_777-1'+: { 'app-config'+: { 'minimum-gas-prices': '100000000000basetcro', + store:: super.store, }, genesis+: { app_state+: { diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index 12ca83f47d..3d745867d3 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -2,7 +2,7 @@ dotenv: '../../scripts/.env', 'cronos_777-1': { cmd: 'cronosd', - 'start-flags': '--trace --streamers file', + 'start-flags': '--trace', config: { mempool: { version: 'v1', @@ -20,6 +20,9 @@ 'block-range-cap': 10000, 'logs-cap': 10000, }, + store: { + streamers: ['file'], + }, }, validators: [{ coins: '1000000000000000000stake,10000000000000000000000basetcro', diff --git a/integration_tests/test_streamer.py b/integration_tests/test_streamer.py index 208de45321..d003e4c0ed 100644 --- a/integration_tests/test_streamer.py +++ b/integration_tests/test_streamer.py @@ -1,4 +1,3 @@ -import pytest from cprotobuf import Field, ProtoEntity, decode_primitive from hexbytes import HexBytes @@ -14,71 +13,46 @@ class StoreKVPairs(ProtoEntity): value = Field("bytes", 4) -def decode_stream_file(data, body_cls=StoreKVPairs, header_cls=None, footer_cls=None): +def decode_stream_file(data, entry_cls=StoreKVPairs): """ - header, body*, footer + StoreKVPairs, StoreKVPairs, ... """ - header = footer = None - body = [] - offset = 0 - size, n = decode_primitive(data, "uint64") - offset += n + assert int.from_bytes(data[:8], "big") + 8 == len(data), "incomplete file" - # header - if header_cls is not None: - header = header_cls() - header.ParseFromString(data[offset : offset + size]) - offset += size - - while True: + items = [] + offset = 8 + while offset < len(data): size, n = decode_primitive(data[offset:], "uint64") offset += n - if offset + size == len(data): - # footer - if footer_cls is not None: - footer = footer_cls() - footer.ParseFromString(data[offset : offset + size]) - offset += size - break - else: - # body - if body_cls is not None: - item = body_cls() - item.ParseFromString(data[offset : offset + size]) - body.append(item) - offset += size - return header, body, footer + item = entry_cls() + item.ParseFromString(data[offset : offset + size]) + items.append(item) + offset += size + return items -@pytest.mark.skip( - reason=( - "state streamers in current 0.46.x version is broken, " - "ref: /~https://github.com/cosmos/cosmos-sdk/issues/13457" - ) -) def test_streamers(cronos): """ - check the streaming files are created - try to parse the state change sets """ # inspect the first state change of the first tx in genesis - path = cronos.node_home(0) / "data/file_streamer/block-0-tx-0" - _, body, _ = decode_stream_file(open(path, "rb").read()) + # the InitChainer is committed together with the first block. + path = cronos.node_home(0) / "data/file_streamer/block-1-data" + items = decode_stream_file(open(path, "rb").read()) # creation of the validator account - assert body[0].store_key == "acc" - # the order in gen_txs is undeterministic, could be either one. - assert body[0].key in ( - b"\x01" + HexBytes(ADDRS["validator"]), - b"\x01" + HexBytes(ADDRS["validator2"]), - ) + assert items[0].store_key == "acc" + # the writes are sorted by key, find the minimal address + min_addr = min(ADDRS.values()) + assert items[0].key == b"\x01" + HexBytes(min_addr) if __name__ == "__main__": import binascii import sys - _, body, _ = decode_stream_file(open(sys.argv[1], "rb").read()) - for item in body: + items = decode_stream_file(open(sys.argv[1], "rb").read()) + for item in items: print( item.store_key, item.delete, From 3c14a20088ed90c7646ab26a59a71bd08ac59d27 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 11:31:15 +0800 Subject: [PATCH 5/7] fix file streamer integration test --- integration_tests/configs/cosmovisor.jsonnet | 1 + integration_tests/configs/cosmovisor_gravity.jsonnet | 1 + integration_tests/configs/default.jsonnet | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/integration_tests/configs/cosmovisor.jsonnet b/integration_tests/configs/cosmovisor.jsonnet index f6a8e644a1..9958866b1e 100644 --- a/integration_tests/configs/cosmovisor.jsonnet +++ b/integration_tests/configs/cosmovisor.jsonnet @@ -5,6 +5,7 @@ config { 'app-config'+: { 'minimum-gas-prices': '100000000000basetcro', store:: super.store, + streamers:: super.streamers, }, genesis+: { app_state+: { diff --git a/integration_tests/configs/cosmovisor_gravity.jsonnet b/integration_tests/configs/cosmovisor_gravity.jsonnet index 5068816d39..8d5581c712 100644 --- a/integration_tests/configs/cosmovisor_gravity.jsonnet +++ b/integration_tests/configs/cosmovisor_gravity.jsonnet @@ -5,6 +5,7 @@ config { 'app-config'+: { 'minimum-gas-prices': '100000000000basetcro', store:: super.store, + streamers:: super.streamers, }, genesis+: { app_state+: { diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index 3d745867d3..be04701a44 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -23,6 +23,11 @@ store: { streamers: ['file'], }, + streamers: { + file: { + write_dir: 'data/file_streamer', + }, + }, }, validators: [{ coins: '1000000000000000000stake,10000000000000000000000basetcro', From 68e055467d8c893db6f959a18d5cd8e4320fe498 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 11:33:57 +0800 Subject: [PATCH 6/7] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 985b9d0801..1339577e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ### Improvements - [#781](/~https://github.com/crypto-org-chain/cronos/pull/781) Add prune command. -- [#790 ](/~https://github.com/crypto-org-chain/cronos/pull/790) Update cosmos-sdk to `v0.46.7`, it fix a gov migration issue which affects query old proposals's votes. +- [#790](/~https://github.com/crypto-org-chain/cronos/pull/790) Update cosmos-sdk to `v0.46.7`, it fix a migration issue which affects pending proposals's votes during upgrade, + it also adds the config entries for file streamer. *Nov 22, 2022* From a65b2fc51db79137f7dce3feaa4ee80e84d52bc9 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 14 Dec 2022 11:40:16 +0800 Subject: [PATCH 7/7] bump to v1.0.1 --- CHANGELOG.md | 4 +++- default.nix | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1339577e60..3c252a8e84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog -## UNRELEASED +*December 14, 2022* + +## v1.0.1 ### Improvements diff --git a/default.nix b/default.nix index 77cdb5cdc5..e5378a9fa9 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ , rev ? "dirty" }: let - version = "v1.0.0"; + version = "v1.0.1"; pname = "cronosd"; tags = [ "ledger" "netgo" network ] ++ lib.lists.optionals (rocksdb != null) [ "rocksdb" "rocksdb_build" ];