Upstream's latest changes are causing mayhem in
the build pipelines. This change reverts upstream's
latest commit.
Upstream issue: rokroskar/workflow-run-cleanup-action#16
* Move all migration scripts to v043
* Fix permaling
* Fix test
* Fix test again
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Reduces CPU burn by using a typed List to avoid the expensive type
assertions from using an interface. This is the only option for now
until Go makes generics generally available.
The change brings time spent on the time assertion cummulatively to:
580ms down from 6.88s
Explanation:
The type assertions were showing up heavily in profiles:
* Before this commit
```shell
Total: 42.18s
ROUTINE ======================== github.com/cosmos/cosmos-sdk/store/cachekv.newMemIterator
in /Users/emmanuelodeke/go/src/github.com/cosmos/cosmos-sdk/store/cachekv/memiterator.go
14.01s 18.87s (flat, cum) 44.74% of Total
. . 17: items []*kv.Pair
. . 18: ascending bool
. . 19:}
. . 20:
. . 21:func newMemIterator(start, end []byte, items *list.List, ascending bool) *memIterator {
. 620ms 22: itemsInDomain := make([]*kv.Pair, 0, items.Len())
. . 23:
. . 24: var entered bool
. . 25:
510ms 870ms 26: for e := items.Front(); e != nil; e = e.Next() {
6.85s 6.88s 27: item := e.Value.(*kv.Pair)
5.71s 8.19s 28: if !dbm.IsKeyInDomain(item.Key, start, end) {
120ms 120ms 29: if entered {
. . 30: break
. . 31: }
. . 32:
. . 33: continue
. . 34: }
. . 35:
820ms 980ms 36: itemsInDomain = append(itemsInDomain, item)
. . 37: entered = true
. . 38: }
. . 39:
. 1.21s 40: return &memIterator{
. . 41: start: start,
. . 42: end: end,
. . 43: items: itemsInDomain,
. . 44: ascending: ascending,
. . 45: }
```
and given that the list only uses that type, it is only right to lift the
code from container/list.List, and only modify Element.Value's type.
For emphasis, the code is basically just a retrofit of
container/list/list.go but with a typing, and we'll keep it as is
until perhaps Go1.17 or Go1.18 or when everyone uses Go1.17+ after
generics have landed.
* After this commit
```shell
Total: 45.25s
ROUTINE ======================== github.com/cosmos/cosmos-sdk/store/cachekv.newMemIterator
in /Users/emmanuelodeke/go/src/github.com/cosmos/cosmos-sdk/store/cachekv/memiterator.go
4.84s 6.77s (flat, cum) 14.96% of Total
. . 16: items []*kv.Pair
. . 17: ascending bool
. . 18:}
. . 19:
. . 20:func newMemIterator(start, end []byte, items *kv.List, ascending bool) *memIterator {
. 330ms 21: itemsInDomain := make([]*kv.Pair, 0, items.Len())
. . 22:
. . 23: var entered bool
. . 24:
60ms 160ms 25: for e := items.Front(); e != nil; e = e.Next() {
580ms 580ms 26: item := e.Value
3.68s 4.78s 27: if !dbm.IsKeyInDomain(item.Key, start, end) {
80ms 80ms 28: if entered {
. . 29: break
. . 30: }
. . 31:
. . 32: continue
. . 33: }
. . 34:
440ms 580ms 35: itemsInDomain = append(itemsInDomain, item)
. . 36: entered = true
. . 37: }
. . 38:
. 260ms 39: return &memIterator{
. . 40: start: start,
. . 41: end: end,
. . 42: items: itemsInDomain,
. . 43: ascending: ascending,
. . 44: }
```
Fixes#8810
* Add back supply proto
* Add migration for supply
* Fix lint
* Update x/bank/spec/01_state.md
* Fix test
* Proto gen
* Update x/bank/spec/01_state.md
* Make proto gen
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
* enable secp256r1 in antehandlers
* Add sig verification benchamrk to find a sigverify fee
* adjust the gas fee
* enable secp256r1 in antehandlers
* Add sig verification benchamrk to find a sigverify fee
* adjust the gas fee
* Update the secp256r1 fee factor
* Update changelog
* regenerate docs
- BenchmarkAccAddressString must initialize the index less than ed25519.PubKeySize to avoid panics
- BenchmarkFullAppSimulation should be skipped as it has the same logic as tests
Fixes#8762
This benchmark examines how ValidateGenesis behaves.
In a follow-up issue, I'll show how it reveals an inefficiency
that'll affect trying to load repeatedly retrieve Validators'
ConsAddress values.
Updates #8744
* add zeroed custom fields check to tm client
* remove custom fields function from x/upgrade and fix tests
* use []byte in x/upgrade, move abci to 02-client
* remove x/ibc from types
* whoops, delete testing files
* fix upgrade tests
* fix tm tests
* fix tests
* update CHANGELOG
* revert proto breakage, use reserved field cc @amaurym
* add IBC Upgrade Proposal type
* remove IBC from upgrade types
* add IBC upgrade logic to 02-client
* fix all tests for x/upgrade
* Add CLI for IBC Upgrade Proposal
* Update x/ibc/core/02-client/types/proposal_test.go
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* add gRPC for upgraded client state
* test fixes
* add HandleUpgradeProposal tests
* update docs and remove unnecessary code
* self review bug and test fixes
* neatness
* construct empty rest handler
* fix tests
* fix stringer tests
* Update docs/core/proto-docs.md
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
* add key in ibc store tracking ibc upgrade heights
Add a new Key to the IBC client store to track the IBC Upgrade Height. This allows IBC upgrades to correctly remove old IBC upgrade states
* update abci and tests
* revert key storage after discussion with @AdityaSripal
Revert using a key to track IBC upgrades. By clearing any IBC state using an old plan in ScheduleUpgrade, IBC upgrades do not need to be tracked by IBC. This reduces code complexity and reduces potential for bugs.
* clear IBC states on cancelled upgrades
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
* Use x/auth/client for querying Txs
* Fix lint
* Fix small test
* Update todos
* Move QueryTx functions to x/auth/tx
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* Consolidating codec.go registrations. Moving Acknowledgement result/error to its own file
* Updating CHANGELOG.md with #7949 improvement as requested
* revert removing acknowledgement proto to its own file
* update changelog
* remove unnecessary pb.go file
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Fix `keys migrate` command (#8703)
crypto/keyring: reinstate the InfoImporter interface
InfoImporter is implemented by those Keyring implementations
that support import of Info objects.
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Previously, we set build_tags before updating the options for DB backend.
This does't work with BadgerDB - it BUILD_TAGS which must be included in build_tags.
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
After continuously profiling InitGensis with 100K accounts, it showed
pathologically slow code, that was the result of a couple of patterns:
* Unconditional and not always necessary map lookups
* O(n^2) sdk.AccAddressFromBech32 retrievals when the code is expensive,
during a quicksort
The remedy involved 4 parts:
* O(n) sdk.AccAddressFromBech32 invocations, down from O(n^2) in the quicksort
* Only doing map lookups when the domain key check has passed
* Using a black magic compiler technique of the map clearing idiom
* Zero allocation []byte<->string conversion
With 100K accounts, this brings InitGenesis down to ~6min, instead of
20+min, it reduces the sort code from ~7sec down to 50ms.
Also some simple benchmark reflect the change:
```shell
name old time/op new time/op delta
SanitizeBalances500-8 19.3ms ±10% 1.5ms ± 5% -92.46% (p=0.000 n=20+20)
SanitizeBalances1000-8 41.9ms ± 8% 3.0ms ±12% -92.92% (p=0.000 n=20+20)
name old alloc/op new alloc/op delta
SanitizeBalances500-8 9.05MB ± 6% 0.56MB ± 0% -93.76% (p=0.000 n=20+18)
SanitizeBalances1000-8 20.2MB ± 3% 1.1MB ± 0% -94.37% (p=0.000 n=20+19)
name old allocs/op new allocs/op delta
SanitizeBalances500-8 72.4k ± 6% 4.5k ± 0% -93.76% (p=0.000 n=20+20)
SanitizeBalances1000-8 162k ± 3% 9k ± 0% -94.40% (p=0.000 n=20+20)
```
The CPU profiles show the radical change as per
https://github.com/cosmos/cosmos-sdk/issues/7766#issuecomment-786671734
Later on, we shall do more profiling and fixes but for now this brings
down the run-time for InitGenesis.
Fixes#7766
Co-authored-by: Alessio Treglia <alessio@tendermint.com>