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

refactor(daa): externalize block dependencies #895

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

glevco
Copy link
Contributor

@glevco glevco commented Dec 14, 2023

Depends on #909

Motivation

Change the DAA so it does not access the storage directly. Instead, block verification can pass pre-fetched dependencies through a new SimpleMemoryStorage. This will be useful for Multiprocess Verification.

Acceptance Criteria

  • Create new SimpleMemoryStorage class that will be used for storing pre-fetched verification dependencies in memory.
  • Change DAA methods calculate_block_difficulty and calculate_next_weight to accept a SimpleMemoryStorage, which is used to retrieve pre-fetched parent blocks.
  • Update block's verify_weight to pre-fetch DAA dependencies.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Dec 14, 2023
@glevco glevco force-pushed the refactor/daa-dependencies branch 2 times, most recently from 3444e20 to 869420e Compare December 14, 2023 21:26
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: Patch coverage is 84.05797% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 85.16%. Comparing base (443604f) to head (ae05d01).

Files Patch % Lines
...athor/transaction/storage/simple_memory_storage.py 75.55% 8 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #895      +/-   ##
==========================================
+ Coverage   85.02%   85.16%   +0.14%     
==========================================
  Files         294      295       +1     
  Lines       22801    22864      +63     
  Branches     3435     3443       +8     
==========================================
+ Hits        19386    19472      +86     
+ Misses       2726     2710      -16     
+ Partials      689      682       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glevco glevco force-pushed the refactor/daa-dependencies branch 2 times, most recently from d4b1031 to d7f0dd3 Compare December 19, 2023 18:26
@glevco glevco force-pushed the refactor/daa-dependencies branch 5 times, most recently from 5bb8188 to aeb3005 Compare December 22, 2023 16:24
@glevco glevco marked this pull request as ready for review December 22, 2023 16:28
@glevco glevco force-pushed the refactor/daa-dependencies branch 2 times, most recently from b64479b to 289059e Compare December 22, 2023 17:23
@glevco glevco force-pushed the refactor/daa-dependencies branch from 289059e to c4aa2b8 Compare December 27, 2023 18:19
@glevco glevco force-pushed the refactor/daa-dependencies branch 2 times, most recently from e774d52 to 103162b Compare January 9, 2024 15:06
@glevco glevco changed the base branch from master to feat/feature-activation/remove-enable-usage January 9, 2024 21:54
@glevco glevco force-pushed the feat/feature-activation/remove-enable-usage branch 3 times, most recently from 7e2e3ee to 522a33e Compare January 19, 2024 01:47
@glevco glevco force-pushed the feat/feature-activation/remove-enable-usage branch from 522a33e to 67326fd Compare January 19, 2024 17:24
Base automatically changed from feat/feature-activation/remove-enable-usage to master January 19, 2024 19:00
@glevco glevco force-pushed the refactor/daa-dependencies branch from 103162b to 204fa2c Compare January 23, 2024 02:58
@glevco glevco force-pushed the refactor/daa-dependencies branch from 204fa2c to b895832 Compare March 5, 2024 16:03
@glevco glevco force-pushed the refactor/daa-dependencies branch 2 times, most recently from 5a1aaf6 to 7eb1d79 Compare March 21, 2024 21:18
@glevco glevco force-pushed the refactor/daa-dependencies branch from 7eb1d79 to ae05d01 Compare March 22, 2024 15:57
@glevco glevco merged commit 466550d into master Mar 22, 2024
12 checks passed
@glevco glevco deleted the refactor/daa-dependencies branch March 22, 2024 17:05
@jansegre jansegre mentioned this pull request Apr 5, 2024
2 tasks
@jansegre jansegre mentioned this pull request May 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants