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

erl: Simplifications to public interfaces #5141

Closed

Conversation

algonautshant
Copy link
Contributor

I would like to propose these changes to ERL to simplify the calls from txHandler:

Based on my comments to:
#4797

and the proposed fixes here:
#5136

@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Merging #5141 (4b034e7) into master (4d14c9d) will decrease coverage by 0.07%.
The diff coverage is 43.47%.

@@            Coverage Diff             @@
##           master    #5141      +/-   ##
==========================================
- Coverage   53.47%   53.41%   -0.07%     
==========================================
  Files         431      431              
  Lines       54364    54368       +4     
==========================================
- Hits        29073    29041      -32     
- Misses      23038    23068      +30     
- Partials     2253     2259       +6     
Impacted Files Coverage Δ
util/erl/rateLimit.go 79.71% <40.00%> (ø)
data/txHandler.go 73.55% <50.00%> (+1.48%) ⬆️
network/wsPeer.go 65.97% <0.00%> (-2.53%) ⬇️
catchup/service.go 67.52% <0.00%> (-2.12%) ⬇️
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
ledger/tracker.go 74.26% <0.00%> (-0.85%) ⬇️
ledger/catchpointtracker.go 57.12% <0.00%> (-0.79%) ⬇️
network/wsNetwork.go 64.98% <0.00%> (-0.64%) ⬇️
ledger/acctonline.go 78.64% <0.00%> (-0.53%) ⬇️
ledger/acctupdates.go 69.48% <0.00%> (-0.13%) ⬇️
... and 1 more

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

if handler.checkAlreadyCommitted(wi) {
ac := handler.checkAlreadyCommitted(wi)
// mark the capacity as released, and as served too, if it's alreadyCommitted
wi.capguard.HandleCapguard()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not functionally equivalent to the original code: for each incoming wi Released is called in order to release capacity for a client. Then, Served called after some delay when wi gets actually queued into the verifier, so it could account for delays in batch verifier.
But I think this Served is misplaced and should be in case wi, ok := <-handler.postVerificationQueue: branch when we actually get wi verified by the batch signature verification.
@AlgoAxel @algonautshant opinions?

@algorandskiy
Copy link
Contributor

This makes the code more complex to understand

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.

3 participants