Skip to content

Commit

Permalink
Avoid updating the block gap when it's unchanged (#5540)
Browse files Browse the repository at this point in the history
There are basically three commits in this PR. Since all these commits
essentially have no logical changes, I packed them into one PR. Review
by per-commit is recommended.
- The first commit avoids unnecessarily updating the block gap storage
when the value remains unchanged, as discovered when I worked on
#5406.
- The second commit is purely about format string style changes but
deletes ~10 lines of code, which slightly helps me look into this file
:P
- The third commit is added to avoid the unnecessary block gap update in
`BlockchainDb`.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>
  • Loading branch information
liuchengxu and davxy authored Sep 4, 2024
1 parent 89b41c5 commit 9b28a54
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 86 deletions.
12 changes: 12 additions & 0 deletions prdoc/pr_5540.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Avoid unnecessary block gap updates

doc:
- audience: Node Dev
description: |
Previously, the block gap storage in database and state in `BlockchainDb` could be updated even if no changes occurred.
This commit refines the logic to ensure updates only occur when the block gap value actually changes, reducing unnecessary
writes and enhancing overall efficiency.

crates:
- name: sc-client-db
bump: none
Loading

0 comments on commit 9b28a54

Please sign in to comment.