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

ledger: turn deferredCommitContext.newBase into a function #5093

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

cce
Copy link
Contributor

@cce cce commented Feb 1, 2023

Summary

Based on observations from #4419 it seems like deferredCommitContext.newBase is always set to the value of oldBase + offset, and is only stored on the DCC struct for code deduplication / convenience reasons. To enforce the invariant that newBase is always oldBase+offset and guard against bugs if this were not true, this turns it into a function rather than an assigned struct field.

Test Plan

Existing tests updated and should pass.

@cce cce added the Enhancement label Feb 1, 2023
@codecov
Copy link

codecov bot commented Feb 1, 2023

Codecov Report

Merging #5093 (0082feb) into master (4e652f2) will decrease coverage by 0.01%.
The diff coverage is 86.66%.

@@            Coverage Diff             @@
##           master    #5093      +/-   ##
==========================================
- Coverage   53.42%   53.41%   -0.01%     
==========================================
  Files         431      431              
  Lines       54356    54356              
==========================================
- Hits        29037    29033       -4     
- Misses      23057    23061       +4     
  Partials     2262     2262              
Impacted Files Coverage Δ
ledger/txtail.go 78.52% <75.00%> (ø)
ledger/catchpointtracker.go 57.90% <83.33%> (ø)
ledger/acctonline.go 78.64% <100.00%> (ø)
ledger/acctupdates.go 68.99% <100.00%> (-0.25%) ⬇️
ledger/tracker.go 74.26% <100.00%> (-0.85%) ⬇️
catchup/service.go 68.94% <0.00%> (-1.42%) ⬇️
cmd/tealdbg/debugger.go 71.65% <0.00%> (-0.79%) ⬇️
ledger/testing/randomAccounts.go 56.26% <0.00%> (-0.62%) ⬇️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@algorandskiy algorandskiy merged commit 7f7939d into algorand:master Feb 1, 2023
@cce cce deleted the func-dcc-newBase branch February 1, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants