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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: memiavl more efficient snapshot setup is not used #1067

Merged
merged 13 commits into from
Jun 19, 2023

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Jun 16, 2023

Solution:

  • only export state-sync snapshot on a snapshot, which is more efficient than export an arbitrary version

馃懏馃徎馃懏馃徎馃懏馃徎 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 馃懏馃徎馃懏馃徎馃懏馃徎

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Solution:
- only export state-sync snapshot on a snapshot, which is more efficient than export an arbitrary version
@yihuang yihuang requested a review from a team as a code owner June 16, 2023 02:58
@yihuang yihuang requested review from JayT106 and thomas-nguy and removed request for a team June 16, 2023 02:58
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: yihuang <huang@crypto.com>
@yihuang yihuang requested a review from mmsqe June 16, 2023 03:00
memiavl/export.go Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #1067 (eafec05) into main (db62342) will increase coverage by 23.34%.
The diff coverage is 35.84%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1067       +/-   ##
===========================================
+ Coverage   22.74%   46.09%   +23.34%     
===========================================
  Files          50       82       +32     
  Lines        3025     7127     +4102     
===========================================
+ Hits          688     3285     +2597     
- Misses       2272     3492     +1220     
- Partials       65      350      +285     
Impacted Files Coverage 螖
app/memiavl.go 8.69% <0.00%> (-91.31%) 猬囷笍
memiavl/export.go 58.75% <34.78%> (酶)
memiavl/db.go 57.72% <68.75%> (酶)

... and 46 files with indirect coverage changes

memiavl/db.go Show resolved Hide resolved
@yihuang yihuang enabled auto-merge June 19, 2023 01:49
memiavl/export.go Fixed Show fixed Hide fixed
@@ -20,13 +20,31 @@
if height > math.MaxUint32 {
return fmt.Errorf("height overflows uint32: %d", height)
}
version := uint32(height)

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
if err != nil {
return fmt.Errorf("failed to load current version: %w", err)
}
if int64(version) > curVersion {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion Error

Potential integer overflow by integer type conversion
@yihuang yihuang added this pull request to the merge queue Jun 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 19, 2023
@yihuang yihuang added this pull request to the merge queue Jun 19, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants