Skip to content

[r3.4] commitment, execctx: fix InsertBlocks failure during block catch-up#20555

Merged
sudeepdino008 merged 1 commit into
release/3.4from
cherry-pick-20546-to-3.4
Apr 15, 2026
Merged

[r3.4] commitment, execctx: fix InsertBlocks failure during block catch-up#20555
sudeepdino008 merged 1 commit into
release/3.4from
cherry-pick-20546-to-3.4

Conversation

@sudeepdino008

Copy link
Copy Markdown
Member

Cherry-pick of #20546.

InsertBlocks on 3.4 uses BeginRw directly (not SharedDomains), so the inserters.go portion of #20546 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 at the construction boundary.

…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.

func IsDomainAheadOfBlocks(ctx context.Context, tx kv.TemporalRwTx, logger log.Logger) bool {
doms, err := NewSharedDomains(ctx, tx, logger)
if doms != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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).

@sudeepdino008 sudeepdino008 merged commit d647f4e into release/3.4 Apr 15, 2026
21 checks passed
@sudeepdino008 sudeepdino008 deleted the cherry-pick-20546-to-3.4 branch April 15, 2026 01:50
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.

3 participants