Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing term change block took too much time #1993

Open
majecty opened this issue Sep 24, 2020 · 2 comments
Open

Executing term change block took too much time #1993

majecty opened this issue Sep 24, 2020 · 2 comments

Comments

@majecty
Copy link
Contributor

majecty commented Sep 24, 2020

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.

#164574181 2020-08-26 14:00:03.561690513 UTC Blocks Verifier #1 TRACE state  add_balance(0x263b…fcb1, 0): 1029374756
#164574181 2020-08-26 14:00:05.957492963 UTC Blocks Verifier #1 TRACE state  add_balance(0x6850…65e1, 2160): 1050470102

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.

@majecty
Copy link
Contributor Author

majecty commented Oct 5, 2020

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.

#1988

@majecty
Copy link
Contributor Author

majecty commented Oct 8, 2020

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.

@majecty majecty changed the title add_balance took much time Executing term change block took too much time Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant