Open majecty opened 4 years ago
Now we can regenerate the performance issue using ./codechain-debug execute-block -n 4649250 -d ./corgi_db/db
.
Executing block 4649250 takes 410ms.
Executing block 4649251 takes 9ms.
I found the cause of the slow issue.
Between two add_balance call, CodeChain was reading headers that generated in a term. It's about 1000 headers in the Corgi network.
In the Corgi network, executing term change block took too much time.
I copied the log from a Corgi node. Blocks Verifier #1's log message. "Blocks Verifier #1" thread does not print any log between two add_balance log. The gap is more than a second.
We can find this situation very frequently in Corgi. About 10 times in a day. It appears only in the term closing blocks.
The reason is that CodeChain reads all header in DB generated in a term. It is about 1000 headers.