Skip to content

Commit 93176da

Browse files
committed
Merge remote-tracking branch 'origin/main' into top_tps
2 parents be6bbcd + 3c8be96 commit 93176da

File tree

23 files changed

+93
-826
lines changed

23 files changed

+93
-826
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/setup-go@v3
2424
with:
25-
go-version: '^1.22.0'
25+
go-version: '1.22.7'
2626
- uses: actions/checkout@v3
2727
- uses: cachix/install-nix-action@v23
2828
with:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## UNRELEASED
4+
5+
### Improvements
6+
7+
* [#1592](https://github.com/crypto-org-chain/cronos/pull/1592) Change the default parallelism of the block-stm to minimum between GOMAXPROCS and NumCPU
8+
39
*Sep 13, 2024*
410

511
## v1.4.0-rc0

app/app.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ func New(
987987
sdk.SetAddrCacheEnabled(false)
988988
workers := cast.ToInt(appOpts.Get(srvflags.EVMBlockSTMWorkers))
989989
if workers == 0 {
990-
workers = stdruntime.NumCPU()
990+
workers = maxParallelism()
991991
}
992992
preEstimate := cast.ToBool(appOpts.Get(srvflags.EVMBlockSTMPreEstimate))
993993
logger.Info("block-stm executor enabled", "workers", workers, "pre-estimate", preEstimate)
@@ -1369,3 +1369,7 @@ func (app *App) Close() error {
13691369
app.Logger().Info("Application gracefully shutdown", "error", err)
13701370
return err
13711371
}
1372+
1373+
func maxParallelism() int {
1374+
return min(stdruntime.GOMAXPROCS(0), stdruntime.NumCPU())
1375+
}

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
cronosd-testnet = mkApp packages.cronosd-testnet;
4545
stateless-testcase = {
4646
type = "app";
47-
program = "${pkgs.testground-testcase}/bin/stateless-testcase";
47+
program = "${pkgs.benchmark-testcase}/bin/stateless-testcase";
4848
};
4949
};
5050
defaultPackage = packages.cronosd;

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ require (
9898
github.com/creachadair/atomicfile v0.3.1 // indirect
9999
github.com/creachadair/tomledit v0.0.24 // indirect
100100
github.com/crypto-org-chain/cronos/memiavl v0.0.4 // indirect
101-
github.com/crypto-org-chain/go-block-stm v0.0.0-20240912024944-1cd89976aa5e // indirect
101+
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 // indirect
102102
github.com/danieljoos/wincred v1.2.0 // indirect
103103
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
104104
github.com/deckarep/golang-set/v2 v2.1.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1 h
433433
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
434434
github.com/crypto-org-chain/ethermint v0.6.1-0.20240913100216-dbc7eb41488c h1:pJJNL+ZganmfcxzEijVNqwNDhzXsTyMk/Of1/lUvxlM=
435435
github.com/crypto-org-chain/ethermint v0.6.1-0.20240913100216-dbc7eb41488c/go.mod h1:D2lnc8ARuVmgc2/2IWla2Ky1o8/pjmyrnIt+d46Clco=
436-
github.com/crypto-org-chain/go-block-stm v0.0.0-20240912024944-1cd89976aa5e h1:FFpE6+Y4o5GxkeGwUcETM6amgohh7msWvWf1MDqueVc=
437-
github.com/crypto-org-chain/go-block-stm v0.0.0-20240912024944-1cd89976aa5e/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
436+
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI=
437+
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
438438
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7 h1:V43F3JFcqG4MUThf9W/DytnPblpR6CcaLBw2Wx6zTgE=
439439
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240425065928-ebb09502e7a7/go.mod h1:+a8pUj1tOyJ2RinsNQD4326YS+leSoKGiG/uVVb0x6Y=
440440
github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE=

gomod2nix.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ schema = 3
216216
version = "v0.0.24"
217217
hash = "sha256-4vUukHONOjNn0qfQr4esK6TWfPWsIp+rbdz65og84lw="
218218
[mod."github.com/crypto-org-chain/go-block-stm"]
219-
version = "v0.0.0-20240912024944-1cd89976aa5e"
220-
hash = "sha256-rY8W4dSciOXT29MCySbH5sw0Fp15IQVgBK9QlMX0JeU="
219+
version = "v0.0.0-20240919080136-6c49aef68716"
220+
hash = "sha256-krCdJz96mpIgmpmRI64W2+W1ycNg+EdLaqeVtAuaW4A="
221221
[mod."github.com/danieljoos/wincred"]
222222
version = "v1.2.0"
223223
hash = "sha256-LHcvTJCc8++bFndbd8ZgMSTe4L5h2C4rN+cSWHCz54Y="

nix/testground-image.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ dockerTools, runCommandLocal, cronos-matrix, testground-testcase }:
1+
{ dockerTools, runCommandLocal, cronos-matrix, benchmark-testcase }:
22
let
33
patched-cronosd = cronos-matrix.cronosd.overrideAttrs (oldAttrs: {
44
patches = oldAttrs.patches or [ ] ++ [
@@ -15,13 +15,13 @@ dockerTools.buildLayeredImage {
1515
name = "cronos-testground";
1616
created = "now";
1717
contents = [
18-
testground-testcase
18+
benchmark-testcase
1919
patched-cronosd
2020
tmpDir
2121
];
2222
config = {
2323
Expose = [ 9090 26657 26656 1317 26658 26660 26659 30000 ];
24-
Cmd = [ "/bin/testground-testcase" ];
24+
Cmd = [ "/bin/stateless-testcase" ];
2525
Env = [
2626
"PYTHONUNBUFFERED=1"
2727
];

testground/benchmark/benchmark/context.py

Lines changed: 0 additions & 129 deletions
This file was deleted.

testground/benchmark/benchmark/main.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)