[r3.4] commitment, execctx: fix InsertBlocks failure during block catch-up#20555
Merged
Conversation
…ch-up Cherry-pick of #20546 from main. InsertBlocks on 3.4 uses BeginRw directly (not SharedDomains), so the inserters.go portion of the main PR is a no-op here. This cherry-pick keeps the general SharedDomains contract improvement: SeekCommitment always fully restores the SD, and NewSharedDomains attaches ErrBehindCommitment as an environmental signal probed via TxNums.Last.
awskii
reviewed
Apr 14, 2026
|
|
||
| func IsDomainAheadOfBlocks(ctx context.Context, tx kv.TemporalRwTx, logger log.Logger) bool { | ||
| doms, err := NewSharedDomains(ctx, tx, logger) | ||
| if doms != nil { |
Member
There was a problem hiding this comment.
do we return non-nil domains with error?
|
|
||
| func IsDomainAheadOfBlocks(ctx context.Context, tx kv.TemporalRwTx, logger log.Logger) bool { | ||
| doms, err := NewSharedDomains(ctx, tx, logger) | ||
| if doms != nil { |
Collaborator
There was a problem hiding this comment.
this is anti-pattern: it's responsibility of NewSharedDomains() func to close object - if error happened.
But we do return non-nil now - I forgot why (I did it). Probably because constructor has biz-logic now and we want threat some errors as non-critical, but keep existing sd object - beceause now sd object is quite long-living (mark made it survive between blocks as i remember).
AskAlexSharov
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #20546.
InsertBlocks on 3.4 uses
BeginRwdirectly (notSharedDomains), so theinserters.goportion of #20546 is a no-op here. This cherry-pick keeps the generalSharedDomainscontract improvement:SeekCommitmentalways fully restores the SD, andNewSharedDomainsattachesErrBehindCommitmentas an environmental signal probed viaTxNums.Lastat the construction boundary.