skalenetwork / skale-consensus

Running the very core of SKL network, SKALE BFT consensus is universal, modern, modular, high-performance, asynchronous, provably-secure, agent-based Proof-of-Stake blockchain consensus engine in C++ 17. Includes provably secure embedded Oracle. Used by SKALE elastic blockchains. Easy and flexible enough to implement your own blockchain or smart contract platform. BLS signatures and Binary Asynchronous Consensus are main building blocks.
https://docs.skale.network/technology/consensus-spec
GNU Affero General Public License v3.0
78 stars 32 forks source link

Slow skaled start #787

Closed dimalit closed 7 months ago

dimalit commented 1 year ago

In a test environment (clean database), with 4-node schain, there is 20+ sec interval between skale start and ceation of 1st block:

2023-06-13 14:30:47.327042   Using 16 threads in task dispatcher
2023-06-13 14:31:09.154706   Block sealed #1 (#82f94f1e…)

2023-06-13 14:30:47.330987   Using 16 threads in task dispatcher
2023-06-13 14:31:09.147241   Block sealed #1 (#82f94f1e…)

2023-06-13 14:30:47.345571   Using 16 threads in task dispatcher
2023-06-13 14:31:09.137623   Block sealed #1 (#82f94f1e…)

2023-06-13 14:30:47.343606   Using 16 threads in task dispatcher
2023-06-13 14:31:09.138684   Block sealed #1 (#82f94f1e…)
dimalit commented 1 year ago

Most consuming part:


[2023-06-13 14:30:51.801] [1:main] [trace] 0:Started threads count:4
[2023-06-13 14:31:03.516] [1:main] [info] 0:Constructing OracleThreadPool
...
12 sec for some single opetation!
Nice to check what operation is it
kladkogex commented 1 year ago

This just creates threads

Looks like there is some problem in test environment

kladkogex commented 1 year ago

I think there is a problem with creating threads in test environment There is nothing particular in this thread creation function

PolinaKiporenko commented 1 year ago

Should be recheck, could be not longer relevant

DmytroNazarenko commented 7 months ago

skaled: 3.18.0-beta.0

oleksandrSydorenkoJ commented 7 months ago

Not actual for skaled: 3.18.0-beta.0

Core node - 3 seconds with an empty state

2024-02-02 16:22:55.146399   Using 16 threads in task dispatcher
[2024-02-02 16:22:56.322] [16:proposal] [info] 0:Constructing blockProposalPushAgent
[2024-02-02 16:22:56.945] [16:main] [info] 0:Constructing OracleThreadPool
2024-02-02 16:22:58.958202   Block sealed #58829 (#e077713f…)

and 10-12 seconds with 1 Gb state

2024-02-02 17:01:30.833872   Using 16 threads in task dispatcher
2024-02-02 17:01:39.927582   Block sealed #91288 (#133a75e1…)

Archival node long start caused by historical state check

2024-02-02 12:24:23.706259   Using 8 threads in task dispatcher
...
2024-02-02 12:24:26.005807   Ensuring permissions are set for path: "/data_dir/historic_state/28e07f34" <<<<30 seconds of historic state indexing 
2024-02-02 12:25:07.767010   Opened state DB.
2024-02-02 12:25:07.774293   Iterating over the entire LevelDB database: "/data_dir/28e07f34/12041/state"

2024-02-02 12:25:09.133316   Opened blockchain DB. Latest: #279f6a42… 86867
[2024-02-02 12:25:12.012] [9:main] [info] 86965:Last committed block in skaled:86964
2024-02-02 12:25:12.017116   createBlock ID = #86965
2024-02-02 12:25:16.987394   Block sealed #86965 (#59600ee7…)