From b80ac885e81f2864c368b047687cd040e089c932 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 17:05:50 +0900 Subject: [PATCH 01/14] deps: use forked wasmvm, update Dockerfile --- bin/v0.34.x/Dockerfile | 5 +++-- bin/v0.34.x/go.mod | 2 ++ bin/v0.34.x/go.sum | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/v0.34.x/Dockerfile b/bin/v0.34.x/Dockerfile index 75bd578..24db699 100644 --- a/bin/v0.34.x/Dockerfile +++ b/bin/v0.34.x/Dockerfile @@ -15,12 +15,13 @@ WORKDIR /code COPY . /code/ # See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.16.3/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +ADD https://github.com/terra-money/wasmvm/releases/download/v0.16.4-drop-order-fix/libwasmvm_muslc.a /lib/libwasmvm_muslc.a # use mimalloc for musl RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install -ENV MIMALLOC_LARGE_OS_PAGES=1 +ENV MIMALLOC_VERBOSE=1 +ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4 # force it to use static lib (from above) not standard libgo_cosmwasm.so file RUN LEDGER_ENABLED=false go build -work -tags muslc,linux -mod=readonly -ldflags="-extldflags '-L/code/mimalloc/build -lmimalloc'" -o build/mantlemint ./sync.go diff --git a/bin/v0.34.x/go.mod b/bin/v0.34.x/go.mod index 27b21cd..f37343f 100644 --- a/bin/v0.34.x/go.mod +++ b/bin/v0.34.x/go.mod @@ -114,3 +114,5 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + +replace github.com/CosmWasm/wasmvm => github.com/terra-money/wasmvm v0.16.4 diff --git a/bin/v0.34.x/go.sum b/bin/v0.34.x/go.sum index a6287f6..2f6b6a3 100644 --- a/bin/v0.34.x/go.sum +++ b/bin/v0.34.x/go.sum @@ -57,8 +57,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v0.16.3 h1:hUf33EHRmyyvKMhwVl7nMaAOY0vYJVB4bhU+HPfHfBM= -github.com/CosmWasm/wasmvm v0.16.3/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= @@ -780,6 +778,8 @@ github.com/terra-money/core v0.5.16 h1:iLP+guLzd9gOjYMYURzBmwu6bdlsfJflYUFoQCZsb github.com/terra-money/core v0.5.16/go.mod h1:MEpq9DsEr2lBs8P7GiIJLfBqCZZKHfdl5qEs0nOcQkg= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= +github.com/terra-money/wasmvm v0.16.4 h1:7zPlIV9zFy4NH+kfV2Yu9o5pMuD6rK36Fmdw4/CLur0= +github.com/terra-money/wasmvm v0.16.4/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= From 74b1a9f2635c0946d0877578d68e1e1ae77398ea Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 17:10:14 +0900 Subject: [PATCH 02/14] deps: use forked tm-db --- bin/v0.34.x/go.mod | 10 ++++++---- bin/v0.34.x/go.sum | 22 ++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/v0.34.x/go.mod b/bin/v0.34.x/go.mod index f37343f..ee3bad6 100644 --- a/bin/v0.34.x/go.mod +++ b/bin/v0.34.x/go.mod @@ -3,7 +3,6 @@ module github.com/terra-money/mantlemint-provider-v0.34.x go 1.17 require ( - github.com/CosmWasm/wasmvm v0.16.3 // indirect github.com/cosmos/cosmos-sdk v0.44.5 github.com/cosmos/iavl v0.17.3 github.com/gogo/protobuf v1.3.3 @@ -23,6 +22,7 @@ require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/CosmWasm/wasmvm v0.16.3 // indirect github.com/DataDog/zstd v1.4.5 // indirect github.com/armon/go-metrics v0.3.9 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -33,6 +33,7 @@ require ( github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/ibc-go v1.1.5 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect @@ -87,8 +88,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/btcd v0.1.1 // indirect github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -100,7 +100,7 @@ require ( golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.6 // indirect google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect - google.golang.org/grpc v1.42.0 // indirect + google.golang.org/grpc v1.44.0 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -116,3 +116,5 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 replace github.com/CosmWasm/wasmvm => github.com/terra-money/wasmvm v0.16.4 + +replace github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 diff --git a/bin/v0.34.x/go.sum b/bin/v0.34.x/go.sum index 2f6b6a3..22631c5 100644 --- a/bin/v0.34.x/go.sum +++ b/bin/v0.34.x/go.sum @@ -175,6 +175,8 @@ github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiO 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= +github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= +github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/ibc-go v1.1.5 h1:H+q6G0szM5lePgLDQbTAaKQU5UR28ZjOIA3JJjNhuPQ= @@ -228,12 +230,12 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= -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/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/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/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/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= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= @@ -757,10 +759,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= @@ -770,14 +771,12 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4= -github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= -github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= github.com/terra-money/core v0.5.16 h1:iLP+guLzd9gOjYMYURzBmwu6bdlsfJflYUFoQCZsbuc= github.com/terra-money/core v0.5.16/go.mod h1:MEpq9DsEr2lBs8P7GiIJLfBqCZZKHfdl5qEs0nOcQkg= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= +github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 h1:SRTmFwbfR2+uirbUxwXqSbKMCFOCD8rUxtpCqNomCC4= +github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20/go.mod h1:K6twQf1PGDxC6K6V+G2l0nrYsQAxsypb4PpbJnyzwJw= github.com/terra-money/wasmvm v0.16.4 h1:7zPlIV9zFy4NH+kfV2Yu9o5pMuD6rK36Fmdw4/CLur0= github.com/terra-money/wasmvm v0.16.4/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= @@ -811,7 +810,6 @@ github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/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= From 6bec8d3047557d7453b740b5ef34bfba18ae866f Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 17:11:17 +0900 Subject: [PATCH 03/14] fix: run indexer before batch flush --- bin/v0.34.x/sync.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/v0.34.x/sync.go b/bin/v0.34.x/sync.go index 140bcc4..ce8726a 100644 --- a/bin/v0.34.x/sync.go +++ b/bin/v0.34.x/sync.go @@ -237,6 +237,12 @@ func main() { rollbackBatch = nil } + // run indexer BEFORE batch flush + if indexerErr := indexerInstance.Run(feed.Block, feed.BlockID, mm.GetCurrentEventCollector()); indexerErr != nil { + debug.PrintStack() + panic(indexerErr) + } + // flush db batch // returns rollback batch that reverts current block injection if rollback, flushErr := batchedOrigin.Flush(); flushErr != nil { @@ -248,12 +254,6 @@ func main() { hldb.ClearWriteHeight() - // run indexer - if indexerErr := indexerInstance.Run(feed.Block, feed.BlockID, mm.GetCurrentEventCollector()); indexerErr != nil { - debug.PrintStack() - panic(indexerErr) - } - cacheInvalidateChan <- feed.Block.Height } } From 30cfe2797a005e81745bafb216f791bca1453cf0 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 17:12:57 +0900 Subject: [PATCH 04/14] fix: use viper-provided app.toml for wasmconfig --- bin/v0.34.x/sync.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/v0.34.x/sync.go b/bin/v0.34.x/sync.go index ce8726a..49e36d3 100644 --- a/bin/v0.34.x/sync.go +++ b/bin/v0.34.x/sync.go @@ -92,11 +92,7 @@ func main() { 0, codec, simapp.EmptyAppOptions{}, - &wasmconfig.Config{ - ContractQueryGasLimit: 3000000, - ContractDebugMode: false, - ContractMemoryCacheSize: 1024, - }, + wasmconfig.GetConfig(viper.GetViper()), fauxMerkleModeOpt, func(ba *baseapp.BaseApp) { ba.SetCMS(cms) From db5a488fdd9092bad349a5967eda60c8566a6186 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 19:12:26 +0900 Subject: [PATCH 05/14] feat: support FlagSkipGenesisInvariants --- bin/v0.34.x/config/config.go | 41 +++++++++++++++++++++++++++--------- bin/v0.34.x/go.mod | 2 +- bin/v0.34.x/go.sum | 5 +++-- bin/v0.34.x/sync.go | 18 ++++------------ 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/bin/v0.34.x/config/config.go b/bin/v0.34.x/config/config.go index e777441..35c9a1f 100644 --- a/bin/v0.34.x/config/config.go +++ b/bin/v0.34.x/config/config.go @@ -2,30 +2,34 @@ package config import ( "fmt" + "github.com/cosmos/cosmos-sdk/x/crisis" + "github.com/spf13/pflag" + "github.com/spf13/viper" terra "github.com/terra-money/core/app" "os" + "path/filepath" "strings" ) type Config struct { - GenesisPath string - Home string - ChainID string - RPCEndpoints []string - WSEndpoints []string - MantlemintDB string - IndexerDB string - DisableSync bool + GenesisPath string + Home string + ChainID string + RPCEndpoints []string + WSEndpoints []string + MantlemintDB string + IndexerDB string + DisableSync bool } // NewConfig converts envvars into consumable config chunks func NewConfig() Config { - return Config{ + cfg := Config{ // GenesisPath sets the location of genesis GenesisPath: getValidEnv("GENESIS_PATH"), // Home sets where the default terra home is. - Home: getValidEnv("HOME"), + Home: getValidEnv("MANTLEMINT_HOME"), // ChainID sets expected chain id for this mantlemint instance ChainID: getValidEnv("CHAIN_ID"), @@ -61,6 +65,23 @@ func NewConfig() Config { return disableSync == "true" }(), } + + viper.SetConfigType("toml") + viper.SetConfigName("app") + viper.AutomaticEnv() + viper.AddConfigPath(filepath.Join(cfg.Home, "config")) + + pflag.Bool(crisis.FlagSkipGenesisInvariants, false, "Skip x/crisis invariants check on startup") + pflag.Parse() + if bindErr := viper.BindPFlags(pflag.CommandLine); bindErr != nil { + panic(bindErr) + } + + if err := viper.MergeInConfig(); err != nil { + panic(fmt.Errorf("failed to merge configuration: %w", err)) + } + + return cfg } func (cfg Config) Print() { diff --git a/bin/v0.34.x/go.mod b/bin/v0.34.x/go.mod index ee3bad6..1d7a8c9 100644 --- a/bin/v0.34.x/go.mod +++ b/bin/v0.34.x/go.mod @@ -115,6 +115,6 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 -replace github.com/CosmWasm/wasmvm => github.com/terra-money/wasmvm v0.16.4 +replace github.com/CosmWasm/wasmvm => github.com/CosmWasm/wasmvm v0.16.5 replace github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 diff --git a/bin/v0.34.x/go.sum b/bin/v0.34.x/go.sum index 22631c5..a2f5739 100644 --- a/bin/v0.34.x/go.sum +++ b/bin/v0.34.x/go.sum @@ -57,6 +57,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/CosmWasm/wasmvm v0.16.5 h1:kB1oLoiWpUPnIu5jDqCSYZm+HpXU4si9xfZKgKHKp+8= +github.com/CosmWasm/wasmvm v0.16.5/go.mod h1:saGLYYSj6rRVFL6EaWZHzXbLD3Rgn8ZEK+0H+UjKOE4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= @@ -759,6 +761,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -777,8 +780,6 @@ github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9M github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 h1:SRTmFwbfR2+uirbUxwXqSbKMCFOCD8rUxtpCqNomCC4= github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20/go.mod h1:K6twQf1PGDxC6K6V+G2l0nrYsQAxsypb4PpbJnyzwJw= -github.com/terra-money/wasmvm v0.16.4 h1:7zPlIV9zFy4NH+kfV2Yu9o5pMuD6rK36Fmdw4/CLur0= -github.com/terra-money/wasmvm v0.16.4/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/bin/v0.34.x/sync.go b/bin/v0.34.x/sync.go index 49e36d3..d778c0f 100644 --- a/bin/v0.34.x/sync.go +++ b/bin/v0.34.x/sync.go @@ -4,12 +4,6 @@ import ( "crypto/sha1" "encoding/hex" "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "runtime/debug" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -32,6 +26,10 @@ import ( "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" "github.com/terra-money/mantlemint-provider-v0.34.x/rpc" "github.com/terra-money/mantlemint-provider-v0.34.x/store/rootmulti" + "io/ioutil" + "log" + "os" + "runtime/debug" tmdb "github.com/tendermint/tm-db" ) @@ -41,14 +39,6 @@ func main() { mantlemintConfig := config.NewConfig() mantlemintConfig.Print() - viper.SetConfigType("toml") - viper.SetConfigName("app") - viper.AddConfigPath(filepath.Join(mantlemintConfig.Home, "config")) - - if err := viper.MergeInConfig(); err != nil { - panic(fmt.Errorf("failed to merge configuration: %w", err)) - } - sdkConfig := sdk.GetConfig() sdkConfig.SetCoinType(core.CoinType) sdkConfig.SetFullFundraiserPath(core.FullFundraiserPath) From 4a7eff8c5ac08bd8492e116f1d72ffd880fe4396 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 19:29:06 +0900 Subject: [PATCH 06/14] docs: explain shared/static --- README.md | 39 ++++++++++++++++++++++++++++++++++----- bin/v0.34.x/Makefile | 9 +++++---- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f732559..a337c71 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Mantlemint is a fast core optimized for serving massive user queries. -Native query performance on RPC is very slow and is not suitable for massive query handling, due to the inefficiencies introduced by IAVL tree. Mantlemint is running on `fauxMerkleTree` mode, basically removing the IAVL inefficiencies while using the same core to compute the same module outputs. +Native query performance on RPC is slow and is not suitable for massive query handling, due to the inefficiencies introduced by IAVL tree. Mantlemint is running on `fauxMerkleTree` mode, basically removing the IAVL inefficiencies while using the same core to compute the same module outputs. If you are looking to serve any kind of public node accepting varying degrees of end-user queries, it is recommended that you run a mantlemint instance alongside of your RPC. While mantlemint is indeed faster at resolving queries, due to the absence of IAVL tree and native tendermint, it cannot join p2p network by itself. Rather, you would have to relay finalized blocks to mantlemint, using RPC's websocket. @@ -51,6 +51,22 @@ Mantlemint internally runs the same Terra Core, therefore you need to provide th It is __required__ to run mantlemint in a separate `$HOME` directory than RPC; while mantlemint maintains its own database, some of the data may be overwritten by either mantlemint or RPC and may cause trouble. + +### Building + +#### 1. As a statically-linked application +```sh +$ make build-static # results in build/mantlemint +``` + + +#### 2. As a dynamically-linked application +```sh +$ make build # results in build/mantlemint +$ make install # results in $GOPATH/bin/mantlemint +``` + + ### Running Mantlemint depends on 2 configs: @@ -82,18 +98,31 @@ WS_ENDPOINTS=ws://rpc1:26657/websocket,ws://rpc2:26657/websocket \ INDEXER_DB=indexer \ # Flag to enable/disable mantlemint sync, mainly for debugging -DISABLE_SYNC=true \ +DISABLE_SYNC=false \ # Run sync binary sync ``` - ## Default Indexes - `/index/tx/by_height/{height}`: List all transactions and their responses in a block. Equivalent to `tendermint/block?height=xxx`, with tx responses base64-decoded for better usability. - `/index/tx/by_hash/{txHash}`: Get transaction and its response by hash. Equivalent to `lcd/txs/{hash}`, but without hitting RPC. -# LICENSE +## Community + +- [Offical Website](https://terra.money) +- [Discord](https://discord.gg/e29HWwC2Mz) +- [Telegram](https://t.me/terra_announcements) +- [Twitter](https://twitter.com/terra_money) +- [YouTube](https://goo.gl/3G4T1z) + +## Contributing + +If you are interested in contributing to Terra Core source, please review our [code of conduct](./CODE_OF_CONDUCT.md). + +# License + +This software is licensed under the Apache 2.0 license. Read more about it here. -Apache 2.0 +© 2021 Terraform Labs, PTE LTD diff --git a/bin/v0.34.x/Makefile b/bin/v0.34.x/Makefile index ce5d4b9..934e066 100644 --- a/bin/v0.34.x/Makefile +++ b/bin/v0.34.x/Makefile @@ -10,12 +10,13 @@ else endif -build-linux: +build-static: mkdir -p $(BUILDDIR) - docker buildx build --platform=linux/amd64 --tag terramoney/mantlemint ./ - docker create --platform=linux/amd64 --name temp terramoney/mantlemint:latest + docker buildx build --tag terramoney/mantlemint ./ + docker create --name temp terramoney/mantlemint:latest docker cp temp:/usr/local/bin/mantlemint $(BUILDDIR)/ docker rm temp install: go.sum - go install -mod=readonly $(BUILD_FLAGS) ./ \ No newline at end of file + go install -mod=readonly $(BUILD_FLAGS) ./ + mv $(GOPATH)/bin/mantlemint-provider-v0.34.x $(GOPATH)/bin/mantlemint From 39b5b5024da74f64e8b23a717cd4540c821297a8 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 19:36:38 +0900 Subject: [PATCH 07/14] docs: specify notable differences from core --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index a337c71..5e71567 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,14 @@ sync - `/index/tx/by_height/{height}`: List all transactions and their responses in a block. Equivalent to `tendermint/block?height=xxx`, with tx responses base64-decoded for better usability. - `/index/tx/by_hash/{txHash}`: Get transaction and its response by hash. Equivalent to `lcd/txs/{hash}`, but without hitting RPC. +## Notable Differences from [core](https://github.com/terra-money/core) + +- Uses a forked [tendermint/tm-db](https://github.com/terra-money/tm-db/commit/c71e8b6e9f20d7f5be32527db4a92ae19ac0d2b2): Disables unncessary mutexes in `prefixdb` methods +- Replaces ABCIClient with [NewConcurrentQueryClient](https://github.com/terra-money/mantlemint/blob/main/bin/v0.34.x/mantlemint/client.go#L110): Removal of mutexes allow better concurrency, even during block injection +- Uses single batch-protected db: All state changes are flushed at once, making it safe to read from db during block injection +- Automatic failover: In case of block injection failure, mantlemint reverts back to the previous known state and retry + + ## Community - [Offical Website](https://terra.money) From ca2598d94b850634d72143d281d2a3c55dca2c22 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 20:35:03 +0900 Subject: [PATCH 08/14] docs: mention healthcheck --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5e71567..8032c5d 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,16 @@ DISABLE_SYNC=false \ sync ``` +## Health check + +`mantlemint` implements a separate `/health` endpoint. It is particularly useful if you want to suppress traffics being routed to `mantlemint` nodes still syncing or unavailable due to whatever reason. + +The endpoint will response: +- `200 OK` if mantlemint sync status is up-to date (i.e. syncing using websocket from RPC) +- `400 NOK` if mantlemint is still syncing past blocks, and is not ready to serve the latest state yet. + +Please note that mantlemint still is able to serve queries while `/health` returns `NOK`. + ## Default Indexes - `/index/tx/by_height/{height}`: List all transactions and their responses in a block. Equivalent to `tendermint/block?height=xxx`, with tx responses base64-decoded for better usability. From 4779ea83b0a6b546836d24a6fecc6f63e521b51a Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 20:44:41 +0900 Subject: [PATCH 09/14] fix: wasmvm artefact url --- bin/v0.34.x/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v0.34.x/Dockerfile b/bin/v0.34.x/Dockerfile index 24db699..7acef8c 100644 --- a/bin/v0.34.x/Dockerfile +++ b/bin/v0.34.x/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /code COPY . /code/ # See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/terra-money/wasmvm/releases/download/v0.16.4-drop-order-fix/libwasmvm_muslc.a /lib/libwasmvm_muslc.a +ADD https://github.com/terra-money/wasmvm/releases/download/v0.16.4/libwasmvm_muslc.a /lib/libwasmvm_muslc.a # use mimalloc for musl RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install From 01e17ae030673ff36e7790d0d29716c3b1824a56 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 20:49:00 +0900 Subject: [PATCH 10/14] chore: flatten directory structure --- bin/v0.34.x/Dockerfile => Dockerfile | 0 bin/v0.34.x/Makefile => Makefile | 1 - .../block_feed => block_feed}/aggregate.go | 0 .../block_feed => block_feed}/helpers.go | 0 {bin/v0.34.x/block_feed => block_feed}/rpc.go | 0 .../block_feed => block_feed}/types.go | 0 .../block_feed => block_feed}/websocket.go | 0 {bin/v0.34.x/config => config}/config.go | 0 {bin/v0.34.x/db => db}/heleveldb/config.go | 0 .../db => db}/heleveldb/leveldb_batch.go | 4 ++-- .../db => db}/heleveldb/leveldb_driver.go | 4 ++-- .../db => db}/heleveldb/leveldb_iterator.go | 2 +- {bin/v0.34.x/db => db}/heleveldb/types.go | 2 +- {bin/v0.34.x/db => db}/hld/cluster_utils.go | 0 .../db => db}/hld/height_limited_db.go | 2 +- .../db => db}/hld/height_limited_iterator.go | 0 {bin/v0.34.x/db => db}/hld/types.go | 0 .../rollbackable/rollbackable_batch.go | 0 .../db => db}/safe_batch/safe_batch.go | 2 +- .../safe_batch/safe_batch_nullify.go | 0 {bin/v0.34.x/db => db}/snappy/snappy_batch.go | 0 {bin/v0.34.x/db => db}/snappy/snappy_db.go | 0 .../db => db}/snappy/snappy_db_test.go | 0 {bin/v0.34.x/db => db}/types.go | 0 bin/v0.34.x/go.mod => go.mod | 4 ++-- bin/v0.34.x/go.sum => go.sum | 0 .../indexer => indexer}/block/block.go | 4 ++-- .../indexer => indexer}/block/block_test.go | 0 .../indexer => indexer}/block/client.go | 2 +- .../indexer => indexer}/block/types.go | 4 ++-- .../fixtures/block_4724005_raw.json | 0 .../fixtures/block_4814775.json | 0 .../fixtures/response_4814775.json | 0 .../indexer => indexer}/height/client.go | 0 .../indexer => indexer}/height/height.go | 4 ++-- .../indexer => indexer}/height/types.go | 0 {bin/v0.34.x/indexer => indexer}/indexer.go | 4 ++-- {bin/v0.34.x/indexer => indexer}/tx/client.go | 2 +- {bin/v0.34.x/indexer => indexer}/tx/tx.go | 4 ++-- .../v0.34.x/indexer => indexer}/tx/tx_test.go | 2 +- {bin/v0.34.x/indexer => indexer}/tx/types.go | 2 +- {bin/v0.34.x/indexer => indexer}/types.go | 2 +- {bin/v0.34.x/lib => lib}/bytes.go | 0 .../mantlemint => mantlemint}/appcreator.go | 0 .../mantlemint => mantlemint}/client.go | 0 .../mantlemint => mantlemint}/event.go | 0 .../mantlemint => mantlemint}/executor.go | 0 .../mantlemint => mantlemint}/reactor.go | 0 .../mantlemint => mantlemint}/types.go | 0 {bin/v0.34.x/rpc => rpc}/cache.go | 0 {bin/v0.34.x/rpc => rpc}/cache_test.go | 0 {bin/v0.34.x/rpc => rpc}/client.go | 0 {bin/v0.34.x/rpc => rpc}/register.go | 0 .../store => store}/rootmulti/dbadapter.go | 0 .../store => store}/rootmulti/proof.go | 0 .../store => store}/rootmulti/store.go | 2 +- bin/v0.34.x/sync.go => sync.go | 22 +++++++++---------- 57 files changed, 37 insertions(+), 38 deletions(-) rename bin/v0.34.x/Dockerfile => Dockerfile (100%) rename bin/v0.34.x/Makefile => Makefile (86%) rename {bin/v0.34.x/block_feed => block_feed}/aggregate.go (100%) rename {bin/v0.34.x/block_feed => block_feed}/helpers.go (100%) rename {bin/v0.34.x/block_feed => block_feed}/rpc.go (100%) rename {bin/v0.34.x/block_feed => block_feed}/types.go (100%) rename {bin/v0.34.x/block_feed => block_feed}/websocket.go (100%) rename {bin/v0.34.x/config => config}/config.go (100%) rename {bin/v0.34.x/db => db}/heleveldb/config.go (100%) rename {bin/v0.34.x/db => db}/heleveldb/leveldb_batch.go (93%) rename {bin/v0.34.x/db => db}/heleveldb/leveldb_driver.go (96%) rename {bin/v0.34.x/db => db}/heleveldb/leveldb_iterator.go (96%) rename {bin/v0.34.x/db => db}/heleveldb/types.go (94%) rename {bin/v0.34.x/db => db}/hld/cluster_utils.go (100%) rename {bin/v0.34.x/db => db}/hld/height_limited_db.go (99%) rename {bin/v0.34.x/db => db}/hld/height_limited_iterator.go (100%) rename {bin/v0.34.x/db => db}/hld/types.go (100%) rename {bin/v0.34.x/db => db}/rollbackable/rollbackable_batch.go (100%) rename {bin/v0.34.x/db => db}/safe_batch/safe_batch.go (96%) rename {bin/v0.34.x/db => db}/safe_batch/safe_batch_nullify.go (100%) rename {bin/v0.34.x/db => db}/snappy/snappy_batch.go (100%) rename {bin/v0.34.x/db => db}/snappy/snappy_db.go (100%) rename {bin/v0.34.x/db => db}/snappy/snappy_db_test.go (100%) rename {bin/v0.34.x/db => db}/types.go (100%) rename bin/v0.34.x/go.mod => go.mod (98%) rename bin/v0.34.x/go.sum => go.sum (100%) rename {bin/v0.34.x/indexer => indexer}/block/block.go (82%) rename {bin/v0.34.x/indexer => indexer}/block/block_test.go (100%) rename {bin/v0.34.x/indexer => indexer}/block/client.go (95%) rename {bin/v0.34.x/indexer => indexer}/block/types.go (75%) rename {bin/v0.34.x/indexer => indexer}/fixtures/block_4724005_raw.json (100%) rename {bin/v0.34.x/indexer => indexer}/fixtures/block_4814775.json (100%) rename {bin/v0.34.x/indexer => indexer}/fixtures/response_4814775.json (100%) rename {bin/v0.34.x/indexer => indexer}/height/client.go (100%) rename {bin/v0.34.x/indexer => indexer}/height/height.go (82%) rename {bin/v0.34.x/indexer => indexer}/height/types.go (100%) rename {bin/v0.34.x/indexer => indexer}/indexer.go (92%) rename {bin/v0.34.x/indexer => indexer}/tx/client.go (97%) rename {bin/v0.34.x/indexer => indexer}/tx/tx.go (95%) rename {bin/v0.34.x/indexer => indexer}/tx/tx_test.go (95%) rename {bin/v0.34.x/indexer => indexer}/tx/types.go (97%) rename {bin/v0.34.x/indexer => indexer}/types.go (92%) rename {bin/v0.34.x/lib => lib}/bytes.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/appcreator.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/client.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/event.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/executor.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/reactor.go (100%) rename {bin/v0.34.x/mantlemint => mantlemint}/types.go (100%) rename {bin/v0.34.x/rpc => rpc}/cache.go (100%) rename {bin/v0.34.x/rpc => rpc}/cache_test.go (100%) rename {bin/v0.34.x/rpc => rpc}/client.go (100%) rename {bin/v0.34.x/rpc => rpc}/register.go (100%) rename {bin/v0.34.x/store => store}/rootmulti/dbadapter.go (100%) rename {bin/v0.34.x/store => store}/rootmulti/proof.go (100%) rename {bin/v0.34.x/store => store}/rootmulti/store.go (99%) rename bin/v0.34.x/sync.go => sync.go (90%) diff --git a/bin/v0.34.x/Dockerfile b/Dockerfile similarity index 100% rename from bin/v0.34.x/Dockerfile rename to Dockerfile diff --git a/bin/v0.34.x/Makefile b/Makefile similarity index 86% rename from bin/v0.34.x/Makefile rename to Makefile index 934e066..0cd1f10 100644 --- a/bin/v0.34.x/Makefile +++ b/Makefile @@ -19,4 +19,3 @@ build-static: install: go.sum go install -mod=readonly $(BUILD_FLAGS) ./ - mv $(GOPATH)/bin/mantlemint-provider-v0.34.x $(GOPATH)/bin/mantlemint diff --git a/bin/v0.34.x/block_feed/aggregate.go b/block_feed/aggregate.go similarity index 100% rename from bin/v0.34.x/block_feed/aggregate.go rename to block_feed/aggregate.go diff --git a/bin/v0.34.x/block_feed/helpers.go b/block_feed/helpers.go similarity index 100% rename from bin/v0.34.x/block_feed/helpers.go rename to block_feed/helpers.go diff --git a/bin/v0.34.x/block_feed/rpc.go b/block_feed/rpc.go similarity index 100% rename from bin/v0.34.x/block_feed/rpc.go rename to block_feed/rpc.go diff --git a/bin/v0.34.x/block_feed/types.go b/block_feed/types.go similarity index 100% rename from bin/v0.34.x/block_feed/types.go rename to block_feed/types.go diff --git a/bin/v0.34.x/block_feed/websocket.go b/block_feed/websocket.go similarity index 100% rename from bin/v0.34.x/block_feed/websocket.go rename to block_feed/websocket.go diff --git a/bin/v0.34.x/config/config.go b/config/config.go similarity index 100% rename from bin/v0.34.x/config/config.go rename to config/config.go diff --git a/bin/v0.34.x/db/heleveldb/config.go b/db/heleveldb/config.go similarity index 100% rename from bin/v0.34.x/db/heleveldb/config.go rename to db/heleveldb/config.go diff --git a/bin/v0.34.x/db/heleveldb/leveldb_batch.go b/db/heleveldb/leveldb_batch.go similarity index 93% rename from bin/v0.34.x/db/heleveldb/leveldb_batch.go rename to db/heleveldb/leveldb_batch.go index 7268d02..2506c0d 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_batch.go +++ b/db/heleveldb/leveldb_batch.go @@ -4,8 +4,8 @@ import ( "fmt" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/rollbackable" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/db/rollbackable" ) var _ hld.HeightLimitEnabledBatch = (*LevelBatch)(nil) diff --git a/bin/v0.34.x/db/heleveldb/leveldb_driver.go b/db/heleveldb/leveldb_driver.go similarity index 96% rename from bin/v0.34.x/db/heleveldb/leveldb_driver.go rename to db/heleveldb/leveldb_driver.go index c1cbc54..ac3420a 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_driver.go +++ b/db/heleveldb/leveldb_driver.go @@ -5,8 +5,8 @@ import ( "math" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/lib" ) type Driver struct { diff --git a/bin/v0.34.x/db/heleveldb/leveldb_iterator.go b/db/heleveldb/leveldb_iterator.go similarity index 96% rename from bin/v0.34.x/db/heleveldb/leveldb_iterator.go rename to db/heleveldb/leveldb_iterator.go index 2a02495..2b770f7 100644 --- a/bin/v0.34.x/db/heleveldb/leveldb_iterator.go +++ b/db/heleveldb/leveldb_iterator.go @@ -4,7 +4,7 @@ import ( "bytes" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" + "github.com/terra-money/mantlemint/db/hld" ) var _ hld.HeightLimitEnabledIterator = (*Iterator)(nil) diff --git a/bin/v0.34.x/db/heleveldb/types.go b/db/heleveldb/types.go similarity index 94% rename from bin/v0.34.x/db/heleveldb/types.go rename to db/heleveldb/types.go index e99f447..50cc185 100644 --- a/bin/v0.34.x/db/heleveldb/types.go +++ b/db/heleveldb/types.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "math" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" ) const ( diff --git a/bin/v0.34.x/db/hld/cluster_utils.go b/db/hld/cluster_utils.go similarity index 100% rename from bin/v0.34.x/db/hld/cluster_utils.go rename to db/hld/cluster_utils.go diff --git a/bin/v0.34.x/db/hld/height_limited_db.go b/db/hld/height_limited_db.go similarity index 99% rename from bin/v0.34.x/db/hld/height_limited_db.go rename to db/hld/height_limited_db.go index a42cb1a..6436b4f 100644 --- a/bin/v0.34.x/db/hld/height_limited_db.go +++ b/db/hld/height_limited_db.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" tmdb "github.com/tendermint/tm-db" ) diff --git a/bin/v0.34.x/db/hld/height_limited_iterator.go b/db/hld/height_limited_iterator.go similarity index 100% rename from bin/v0.34.x/db/hld/height_limited_iterator.go rename to db/hld/height_limited_iterator.go diff --git a/bin/v0.34.x/db/hld/types.go b/db/hld/types.go similarity index 100% rename from bin/v0.34.x/db/hld/types.go rename to db/hld/types.go diff --git a/bin/v0.34.x/db/rollbackable/rollbackable_batch.go b/db/rollbackable/rollbackable_batch.go similarity index 100% rename from bin/v0.34.x/db/rollbackable/rollbackable_batch.go rename to db/rollbackable/rollbackable_batch.go diff --git a/bin/v0.34.x/db/safe_batch/safe_batch.go b/db/safe_batch/safe_batch.go similarity index 96% rename from bin/v0.34.x/db/safe_batch/safe_batch.go rename to db/safe_batch/safe_batch.go index 1e1e2f7..8979be9 100644 --- a/bin/v0.34.x/db/safe_batch/safe_batch.go +++ b/db/safe_batch/safe_batch.go @@ -4,7 +4,7 @@ import ( "fmt" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/rollbackable" + "github.com/terra-money/mantlemint/db/rollbackable" ) var _ tmdb.DB = (*SafeBatchDB)(nil) diff --git a/bin/v0.34.x/db/safe_batch/safe_batch_nullify.go b/db/safe_batch/safe_batch_nullify.go similarity index 100% rename from bin/v0.34.x/db/safe_batch/safe_batch_nullify.go rename to db/safe_batch/safe_batch_nullify.go diff --git a/bin/v0.34.x/db/snappy/snappy_batch.go b/db/snappy/snappy_batch.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_batch.go rename to db/snappy/snappy_batch.go diff --git a/bin/v0.34.x/db/snappy/snappy_db.go b/db/snappy/snappy_db.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_db.go rename to db/snappy/snappy_db.go diff --git a/bin/v0.34.x/db/snappy/snappy_db_test.go b/db/snappy/snappy_db_test.go similarity index 100% rename from bin/v0.34.x/db/snappy/snappy_db_test.go rename to db/snappy/snappy_db_test.go diff --git a/bin/v0.34.x/db/types.go b/db/types.go similarity index 100% rename from bin/v0.34.x/db/types.go rename to db/types.go diff --git a/bin/v0.34.x/go.mod b/go.mod similarity index 98% rename from bin/v0.34.x/go.mod rename to go.mod index 1d7a8c9..5f561ea 100644 --- a/bin/v0.34.x/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/terra-money/mantlemint-provider-v0.34.x +module github.com/terra-money/mantlemint go 1.17 @@ -11,6 +11,7 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/hashicorp/golang-lru v0.5.4 github.com/pkg/errors v0.9.1 + github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tendermint/tendermint v0.34.14 @@ -86,7 +87,6 @@ require ( github.com/spf13/cast v1.3.1 // indirect github.com/spf13/cobra v1.2.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/btcd v0.1.1 // indirect diff --git a/bin/v0.34.x/go.sum b/go.sum similarity index 100% rename from bin/v0.34.x/go.sum rename to go.sum diff --git a/bin/v0.34.x/indexer/block/block.go b/indexer/block/block.go similarity index 82% rename from bin/v0.34.x/indexer/block/block.go rename to indexer/block/block.go index f9a499f..6d6ec0f 100644 --- a/bin/v0.34.x/indexer/block/block.go +++ b/indexer/block/block.go @@ -5,8 +5,8 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var IndexBlock = indexer.CreateIndexer(func(indexerDB tmdb.Batch, block *tm.Block, blockID *tm.BlockID, _ *mantlemint.EventCollector) error { diff --git a/bin/v0.34.x/indexer/block/block_test.go b/indexer/block/block_test.go similarity index 100% rename from bin/v0.34.x/indexer/block/block_test.go rename to indexer/block/block_test.go diff --git a/bin/v0.34.x/indexer/block/client.go b/indexer/block/client.go similarity index 95% rename from bin/v0.34.x/indexer/block/client.go rename to indexer/block/client.go index c8f1aa7..a4b4563 100644 --- a/bin/v0.34.x/indexer/block/client.go +++ b/indexer/block/client.go @@ -9,7 +9,7 @@ import ( "github.com/gorilla/mux" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" + "github.com/terra-money/mantlemint/indexer" ) var ( diff --git a/bin/v0.34.x/indexer/block/types.go b/indexer/block/types.go similarity index 75% rename from bin/v0.34.x/indexer/block/types.go rename to indexer/block/types.go index c7df9ab..4fb02fb 100644 --- a/bin/v0.34.x/indexer/block/types.go +++ b/indexer/block/types.go @@ -2,7 +2,7 @@ package block import ( tm "github.com/tendermint/tendermint/types" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" ) var prefix = []byte("block/height:") @@ -12,5 +12,5 @@ var getKey = func(height uint64) []byte { type BlockRecord struct { BlockID *tm.BlockID `json:"block_id""` - Block *tm.Block `json:"block"` + Block *tm.Block `json:"block"` } diff --git a/bin/v0.34.x/indexer/fixtures/block_4724005_raw.json b/indexer/fixtures/block_4724005_raw.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/block_4724005_raw.json rename to indexer/fixtures/block_4724005_raw.json diff --git a/bin/v0.34.x/indexer/fixtures/block_4814775.json b/indexer/fixtures/block_4814775.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/block_4814775.json rename to indexer/fixtures/block_4814775.json diff --git a/bin/v0.34.x/indexer/fixtures/response_4814775.json b/indexer/fixtures/response_4814775.json similarity index 100% rename from bin/v0.34.x/indexer/fixtures/response_4814775.json rename to indexer/fixtures/response_4814775.json diff --git a/bin/v0.34.x/indexer/height/client.go b/indexer/height/client.go similarity index 100% rename from bin/v0.34.x/indexer/height/client.go rename to indexer/height/client.go diff --git a/bin/v0.34.x/indexer/height/height.go b/indexer/height/height.go similarity index 82% rename from bin/v0.34.x/indexer/height/height.go rename to indexer/height/height.go index 9b51cf6..d6a8d98 100644 --- a/bin/v0.34.x/indexer/height/height.go +++ b/indexer/height/height.go @@ -5,8 +5,8 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var IndexHeight = indexer.CreateIndexer(func(indexerDB tmdb.Batch, block *tm.Block, _ *tm.BlockID, _ *mantlemint.EventCollector) error { diff --git a/bin/v0.34.x/indexer/height/types.go b/indexer/height/types.go similarity index 100% rename from bin/v0.34.x/indexer/height/types.go rename to indexer/height/types.go diff --git a/bin/v0.34.x/indexer/indexer.go b/indexer/indexer.go similarity index 92% rename from bin/v0.34.x/indexer/indexer.go rename to indexer/indexer.go index ae4fe37..7cfbc25 100644 --- a/bin/v0.34.x/indexer/indexer.go +++ b/indexer/indexer.go @@ -5,8 +5,8 @@ import ( "github.com/gorilla/mux" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/snappy" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/db/snappy" + "github.com/terra-money/mantlemint/mantlemint" "time" ) diff --git a/bin/v0.34.x/indexer/tx/client.go b/indexer/tx/client.go similarity index 97% rename from bin/v0.34.x/indexer/tx/client.go rename to indexer/tx/client.go index 80d8028..bcb4cd5 100644 --- a/bin/v0.34.x/indexer/tx/client.go +++ b/indexer/tx/client.go @@ -8,7 +8,7 @@ import ( "github.com/gorilla/mux" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" + "github.com/terra-money/mantlemint/indexer" ) var ( diff --git a/bin/v0.34.x/indexer/tx/tx.go b/indexer/tx/tx.go similarity index 95% rename from bin/v0.34.x/indexer/tx/tx.go rename to indexer/tx/tx.go index 9344cd7..5030aae 100644 --- a/bin/v0.34.x/indexer/tx/tx.go +++ b/indexer/tx/tx.go @@ -7,8 +7,8 @@ import ( tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" terra "github.com/terra-money/core/app" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/mantlemint" ) var cdc = terra.MakeEncodingConfig() diff --git a/bin/v0.34.x/indexer/tx/tx_test.go b/indexer/tx/tx_test.go similarity index 95% rename from bin/v0.34.x/indexer/tx/tx_test.go rename to indexer/tx/tx_test.go index 0c9bb01..01bbf46 100644 --- a/bin/v0.34.x/indexer/tx/tx_test.go +++ b/indexer/tx/tx_test.go @@ -6,7 +6,7 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tendermint "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/mantlemint" "io/ioutil" "os" "testing" diff --git a/bin/v0.34.x/indexer/tx/types.go b/indexer/tx/types.go similarity index 97% rename from bin/v0.34.x/indexer/tx/types.go rename to indexer/tx/types.go index 4009e31..ab95543 100644 --- a/bin/v0.34.x/indexer/tx/types.go +++ b/indexer/tx/types.go @@ -3,7 +3,7 @@ package tx import ( "encoding/json" abci "github.com/tendermint/tendermint/abci/types" - "github.com/terra-money/mantlemint-provider-v0.34.x/lib" + "github.com/terra-money/mantlemint/lib" "time" ) diff --git a/bin/v0.34.x/indexer/types.go b/indexer/types.go similarity index 92% rename from bin/v0.34.x/indexer/types.go rename to indexer/types.go index 797ac29..bcaeb69 100644 --- a/bin/v0.34.x/indexer/types.go +++ b/indexer/types.go @@ -4,7 +4,7 @@ import ( "github.com/gorilla/mux" tm "github.com/tendermint/tendermint/types" tmdb "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" + "github.com/terra-money/mantlemint/mantlemint" "log" "net/http" "runtime" diff --git a/bin/v0.34.x/lib/bytes.go b/lib/bytes.go similarity index 100% rename from bin/v0.34.x/lib/bytes.go rename to lib/bytes.go diff --git a/bin/v0.34.x/mantlemint/appcreator.go b/mantlemint/appcreator.go similarity index 100% rename from bin/v0.34.x/mantlemint/appcreator.go rename to mantlemint/appcreator.go diff --git a/bin/v0.34.x/mantlemint/client.go b/mantlemint/client.go similarity index 100% rename from bin/v0.34.x/mantlemint/client.go rename to mantlemint/client.go diff --git a/bin/v0.34.x/mantlemint/event.go b/mantlemint/event.go similarity index 100% rename from bin/v0.34.x/mantlemint/event.go rename to mantlemint/event.go diff --git a/bin/v0.34.x/mantlemint/executor.go b/mantlemint/executor.go similarity index 100% rename from bin/v0.34.x/mantlemint/executor.go rename to mantlemint/executor.go diff --git a/bin/v0.34.x/mantlemint/reactor.go b/mantlemint/reactor.go similarity index 100% rename from bin/v0.34.x/mantlemint/reactor.go rename to mantlemint/reactor.go diff --git a/bin/v0.34.x/mantlemint/types.go b/mantlemint/types.go similarity index 100% rename from bin/v0.34.x/mantlemint/types.go rename to mantlemint/types.go diff --git a/bin/v0.34.x/rpc/cache.go b/rpc/cache.go similarity index 100% rename from bin/v0.34.x/rpc/cache.go rename to rpc/cache.go diff --git a/bin/v0.34.x/rpc/cache_test.go b/rpc/cache_test.go similarity index 100% rename from bin/v0.34.x/rpc/cache_test.go rename to rpc/cache_test.go diff --git a/bin/v0.34.x/rpc/client.go b/rpc/client.go similarity index 100% rename from bin/v0.34.x/rpc/client.go rename to rpc/client.go diff --git a/bin/v0.34.x/rpc/register.go b/rpc/register.go similarity index 100% rename from bin/v0.34.x/rpc/register.go rename to rpc/register.go diff --git a/bin/v0.34.x/store/rootmulti/dbadapter.go b/store/rootmulti/dbadapter.go similarity index 100% rename from bin/v0.34.x/store/rootmulti/dbadapter.go rename to store/rootmulti/dbadapter.go diff --git a/bin/v0.34.x/store/rootmulti/proof.go b/store/rootmulti/proof.go similarity index 100% rename from bin/v0.34.x/store/rootmulti/proof.go rename to store/rootmulti/proof.go diff --git a/bin/v0.34.x/store/rootmulti/store.go b/store/rootmulti/store.go similarity index 99% rename from bin/v0.34.x/store/rootmulti/store.go rename to store/rootmulti/store.go index 55b15b3..d3925cd 100644 --- a/bin/v0.34.x/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -16,7 +16,7 @@ import ( "github.com/pkg/errors" abci "github.com/tendermint/tendermint/abci/types" dbm "github.com/tendermint/tm-db" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" + "github.com/terra-money/mantlemint/db/hld" "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" diff --git a/bin/v0.34.x/sync.go b/sync.go similarity index 90% rename from bin/v0.34.x/sync.go rename to sync.go index d778c0f..83f2ac9 100644 --- a/bin/v0.34.x/sync.go +++ b/sync.go @@ -15,17 +15,17 @@ import ( terra "github.com/terra-money/core/app" core "github.com/terra-money/core/types" wasmconfig "github.com/terra-money/core/x/wasm/config" - blockFeeder "github.com/terra-money/mantlemint-provider-v0.34.x/block_feed" - "github.com/terra-money/mantlemint-provider-v0.34.x/config" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/heleveldb" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/hld" - "github.com/terra-money/mantlemint-provider-v0.34.x/db/safe_batch" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer/block" - "github.com/terra-money/mantlemint-provider-v0.34.x/indexer/tx" - "github.com/terra-money/mantlemint-provider-v0.34.x/mantlemint" - "github.com/terra-money/mantlemint-provider-v0.34.x/rpc" - "github.com/terra-money/mantlemint-provider-v0.34.x/store/rootmulti" + blockFeeder "github.com/terra-money/mantlemint/block_feed" + "github.com/terra-money/mantlemint/config" + "github.com/terra-money/mantlemint/db/heleveldb" + "github.com/terra-money/mantlemint/db/hld" + "github.com/terra-money/mantlemint/db/safe_batch" + "github.com/terra-money/mantlemint/indexer" + "github.com/terra-money/mantlemint/indexer/block" + "github.com/terra-money/mantlemint/indexer/tx" + "github.com/terra-money/mantlemint/mantlemint" + "github.com/terra-money/mantlemint/rpc" + "github.com/terra-money/mantlemint/store/rootmulti" "io/ioutil" "log" "os" From 87de1d4fd35df0b2017e4f519533b80acb285caa Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 20:54:15 +0900 Subject: [PATCH 11/14] deps: use terra-money/wasmvm for go.mod --- Makefile | 2 +- go.mod | 2 +- go.sum | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0cd1f10..df79f5d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ build: go.sum ifeq ($(OS),Windows_NT) exit 1 else - go build -mod=readonly $(BUILD_FLAGS) -o build/mantlemint ./sync + go build -mod=readonly $(BUILD_FLAGS) -o build/mantlemint ./sync.go endif diff --git a/go.mod b/go.mod index 5f561ea..0897204 100644 --- a/go.mod +++ b/go.mod @@ -115,6 +115,6 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 -replace github.com/CosmWasm/wasmvm => github.com/CosmWasm/wasmvm v0.16.5 +replace github.com/CosmWasm/wasmvm => github.com/terra-money/wasmvm v0.16.4 replace github.com/tendermint/tm-db => github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 diff --git a/go.sum b/go.sum index a2f5739..22631c5 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/CosmWasm/wasmvm v0.16.5 h1:kB1oLoiWpUPnIu5jDqCSYZm+HpXU4si9xfZKgKHKp+8= -github.com/CosmWasm/wasmvm v0.16.5/go.mod h1:saGLYYSj6rRVFL6EaWZHzXbLD3Rgn8ZEK+0H+UjKOE4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= @@ -761,7 +759,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -780,6 +777,8 @@ github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9M github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 h1:SRTmFwbfR2+uirbUxwXqSbKMCFOCD8rUxtpCqNomCC4= github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20/go.mod h1:K6twQf1PGDxC6K6V+G2l0nrYsQAxsypb4PpbJnyzwJw= +github.com/terra-money/wasmvm v0.16.4 h1:7zPlIV9zFy4NH+kfV2Yu9o5pMuD6rK36Fmdw4/CLur0= +github.com/terra-money/wasmvm v0.16.4/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= From 4017ebe7a2584360d6376c8b15a84668adae20a1 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 20:58:16 +0900 Subject: [PATCH 12/14] deps: bump terra-money/core --- go.mod | 2 +- go.sum | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0897204..28ba35a 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.7.0 github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.6 - github.com/terra-money/core v0.5.16 + github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0 ) require ( diff --git a/go.sum b/go.sum index 22631c5..2ff143b 100644 --- a/go.sum +++ b/go.sum @@ -773,6 +773,10 @@ github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5Y github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= github.com/terra-money/core v0.5.16 h1:iLP+guLzd9gOjYMYURzBmwu6bdlsfJflYUFoQCZsbuc= github.com/terra-money/core v0.5.16/go.mod h1:MEpq9DsEr2lBs8P7GiIJLfBqCZZKHfdl5qEs0nOcQkg= +github.com/terra-money/core v0.5.17-0.20220220061132-1b2707a3b8ec h1:0JBuRcQmUnCnkCo9sHsk5X/vbYAMxp7BKH82NeMNpGU= +github.com/terra-money/core v0.5.17-0.20220220061132-1b2707a3b8ec/go.mod h1:GzjTEGkbrw6BXyw3z0jlM5y5mswpLg/JhUr6GAlXp2w= +github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0 h1:40hUUCkXo31cSh9QsVzTj2BrDUoawKVIytzcPqcJNvQ= +github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0/go.mod h1:aUZfcVV4GP92baeM/XLFN3FOWzkMUrLjMs3B1+MDovY= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= github.com/terra-money/ledger-terra-go v0.11.2/go.mod h1:ClJ2XMj1ptcnONzKH+GhVPi7Y8pXIT+UzJ0TNt0tfZE= github.com/terra-money/tm-db v0.6.5-0.20220307182415-c71e8b6e9f20 h1:SRTmFwbfR2+uirbUxwXqSbKMCFOCD8rUxtpCqNomCC4= From 897d6987c8200b556b43af8f77c7a1910a452fbf Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 21:03:14 +0900 Subject: [PATCH 13/14] chore: go.sum --- go.sum | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go.sum b/go.sum index 2ff143b..1e321f6 100644 --- a/go.sum +++ b/go.sum @@ -771,10 +771,6 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/terra-money/core v0.5.16 h1:iLP+guLzd9gOjYMYURzBmwu6bdlsfJflYUFoQCZsbuc= -github.com/terra-money/core v0.5.16/go.mod h1:MEpq9DsEr2lBs8P7GiIJLfBqCZZKHfdl5qEs0nOcQkg= -github.com/terra-money/core v0.5.17-0.20220220061132-1b2707a3b8ec h1:0JBuRcQmUnCnkCo9sHsk5X/vbYAMxp7BKH82NeMNpGU= -github.com/terra-money/core v0.5.17-0.20220220061132-1b2707a3b8ec/go.mod h1:GzjTEGkbrw6BXyw3z0jlM5y5mswpLg/JhUr6GAlXp2w= github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0 h1:40hUUCkXo31cSh9QsVzTj2BrDUoawKVIytzcPqcJNvQ= github.com/terra-money/core v0.5.18-0.20220304040324-70c1ef6f11b0/go.mod h1:aUZfcVV4GP92baeM/XLFN3FOWzkMUrLjMs3B1+MDovY= github.com/terra-money/ledger-terra-go v0.11.2 h1:BVXZl+OhJOri6vFNjjVaTabRLApw9MuG7mxWL4V718c= From a68fe357a20eb0fe51d2af68d7d9ab5facc682a1 Mon Sep 17 00:00:00 2001 From: jess Date: Fri, 11 Mar 2022 21:49:03 +0900 Subject: [PATCH 14/14] chore: envvar name, dockerfile cleanup --- Dockerfile | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7acef8c..d53e394 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,6 @@ ADD https://github.com/terra-money/wasmvm/releases/download/v0.16.4/libwasmvm_mu # use mimalloc for musl RUN git clone --depth 1 https://github.com/microsoft/mimalloc; cd mimalloc; mkdir build; cd build; cmake ..; make -j$(nproc); make install -ENV MIMALLOC_VERBOSE=1 ENV MIMALLOC_RESERVE_HUGE_OS_PAGES=4 # force it to use static lib (from above) not standard libgo_cosmwasm.so file diff --git a/README.md b/README.md index 8032c5d..693b465 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ GENESIS_PATH=config/genesis.json \ # - create and maintain $HOME/mantlemint.db directory # - create and maintain $HOME/data/* for wasm blobs; (unsafe to share with RPC!) # - create and maintain $HOME/$(INDEXER_DB).db for mantle indexers -HOME=mantlemint \ +MANTLEMINT_HOME=mantlemint \ # Chain ID CHAIN_ID=columbus-5 \