diff --git a/go.mod b/go.mod index b624a5797f..114ab14817 100644 --- a/go.mod +++ b/go.mod @@ -223,8 +223,8 @@ require ( ) replace ( - github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.16.0-sdk-v0.46.13 + github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v1.16.1-sdk-v0.46.13 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.24.0-tm-v0.34.28 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.25.0-tm-v0.34.28 ) diff --git a/go.sum b/go.sum index c7c3592086..969b68e8f4 100644 --- a/go.sum +++ b/go.sum @@ -169,10 +169,10 @@ github.com/bufbuild/protocompile v0.1.0 h1:HjgJBI85hY/qmW5tw/66sNDZ7z0UDdVSi/5r4 github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/celestiaorg/celestia-core v1.24.0-tm-v0.34.28 h1:eXS3v26nob8Xs2+flKHVxcTzhzQW44KgTcooR3OxnK4= -github.com/celestiaorg/celestia-core v1.24.0-tm-v0.34.28/go.mod h1:J/GsBjoTZaFz71VeyrLZbG8rV+Rzi6oFEUZUipQ97hQ= -github.com/celestiaorg/cosmos-sdk v1.16.0-sdk-v0.46.13 h1:N1PrCWcYkaODeIQyyVBmDKDTwiQWZ31bgtTEYIGeby8= -github.com/celestiaorg/cosmos-sdk v1.16.0-sdk-v0.46.13/go.mod h1:xpBZc/OYZ736hp0IZlBGNUhEgCD9C+bKs8yNLZibyv0= +github.com/celestiaorg/celestia-core v1.25.0-tm-v0.34.28 h1:2/b6288LWPPJqb8vxdiafXvBwy/42Edp5rJIVxbBRvg= +github.com/celestiaorg/celestia-core v1.25.0-tm-v0.34.28/go.mod h1:J/GsBjoTZaFz71VeyrLZbG8rV+Rzi6oFEUZUipQ97hQ= +github.com/celestiaorg/cosmos-sdk v1.16.1-sdk-v0.46.13 h1:CxEQDQEQR1ypB+VUmCISIqFVmHfb+mx8x+zh7rHbyU8= +github.com/celestiaorg/cosmos-sdk v1.16.1-sdk-v0.46.13/go.mod h1:xpBZc/OYZ736hp0IZlBGNUhEgCD9C+bKs8yNLZibyv0= github.com/celestiaorg/knuu v0.8.2 h1:x63nYTO46j293VkNP7VcRHtYHSize6dM/h7xME2Vgi0= github.com/celestiaorg/knuu v0.8.2/go.mod h1:zBrMXhFl7irCPOVJyHS8sBg7K9Hux5dLy9VChA40LTo= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= diff --git a/pkg/square/builder.go b/pkg/square/builder.go index e67c0a3ea4..0d8e526879 100644 --- a/pkg/square/builder.go +++ b/pkg/square/builder.go @@ -135,7 +135,7 @@ func (b *Builder) Export() (Square, error) { // sort the blobs in order of namespace. We use slice stable here to respect the // order of multiple blobs within a namespace as per the priority of the PFB sort.SliceStable(b.Blobs, func(i, j int) bool { - return bytes.Compare(FullNamespace(b.Blobs[i].Blob), FullNamespace(b.Blobs[j].Blob)) < 0 + return bytes.Compare(b.Blobs[i].Blob.Namespace(), b.Blobs[j].Blob.Namespace()) < 0 }) // write all the regular transactions into compact shares @@ -366,11 +366,6 @@ func (b *Builder) IsEmpty() bool { return b.TxCounter.Size() == 0 && b.PfbCounter.Size() == 0 } -// TODO: celestia-core should provide this method for `Blob`s -func FullNamespace(blob core.Blob) []byte { - return append([]byte{byte(blob.NamespaceVersion)}, blob.NamespaceID...) -} - type Element struct { Blob core.Blob PfbIndex int diff --git a/scripts/build-run-single-node.sh b/scripts/build-run-single-node.sh index f15634d5e2..cffae86693 100755 --- a/scripts/build-run-single-node.sh +++ b/scripts/build-run-single-node.sh @@ -33,4 +33,4 @@ sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ${HOME_DIR}/con sed -i'.bak' 's#"null"#"kv"#g' ${HOME_DIR}/config/config.toml # Start the celestia-app -${BIN_PATH} start --home ${HOME_DIR} +${BIN_PATH} start --home ${HOME_DIR} --api.enable diff --git a/scripts/single-node.sh b/scripts/single-node.sh index 687c634288..372ed8fc6a 100755 --- a/scripts/single-node.sh +++ b/scripts/single-node.sh @@ -28,4 +28,4 @@ sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ${HOME_DIR}/con sed -i'.bak' 's#"null"#"kv"#g' ${HOME_DIR}/config/config.toml # Start the celestia-app -celestia-appd start --home ${HOME_DIR} +celestia-appd start --home ${HOME_DIR} --api.enable diff --git a/test/util/malicious/out_of_order_builder.go b/test/util/malicious/out_of_order_builder.go index 6293a62b8d..7fc1c42244 100644 --- a/test/util/malicious/out_of_order_builder.go +++ b/test/util/malicious/out_of_order_builder.go @@ -72,14 +72,14 @@ func OutOfOrderExport(b *square.Builder) (square.Square, error) { // sort the blobs in order of namespace. We use slice stable here to respect the // order of multiple blobs within a namespace as per the priority of the PFB sort.SliceStable(b.Blobs, func(i, j int) bool { - return bytes.Compare(square.FullNamespace(b.Blobs[i].Blob), square.FullNamespace(b.Blobs[j].Blob)) < 0 + return bytes.Compare(b.Blobs[i].Blob.Namespace(), b.Blobs[j].Blob.Namespace()) < 0 }) if len(b.Blobs) > 1 { // iterate through each blob and find the first two that have different // namespaces and swap them. for i := 0; i < len(b.Blobs)-1; i++ { - if !bytes.Equal(square.FullNamespace(b.Blobs[i].Blob), square.FullNamespace(b.Blobs[i+1].Blob)) { + if !bytes.Equal(b.Blobs[i].Blob.Namespace(), b.Blobs[i+1].Blob.Namespace()) { b.Blobs[i], b.Blobs[i+1] = b.Blobs[i+1], b.Blobs[i] break }