Skip to content

ParseVersion: optimize#20374

Merged
sudeepdino008 merged 4 commits intorelease/3.4from
alex/more_test_34
Apr 7, 2026
Merged

ParseVersion: optimize#20374
sudeepdino008 merged 4 commits intorelease/3.4from
alex/more_test_34

Conversation

@AskAlexSharov
Copy link
Copy Markdown
Collaborator

return static err instead of errorf - to reduce allocations

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Optimizes snapshot file version parsing by reducing allocations and standardizing invalid-version errors within db/version.

Changes:

  • Introduces ErrInvalidVersion sentinel error for invalid version strings.
  • Rewrites ParseVersion to avoid strings.Split and fmt.Errorf in the hot path (uses index-based parsing and returns a static error).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread db/version/file_version.go Outdated
Comment thread db/version/file_version.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread db/version/file_version.go Outdated
Copy link
Copy Markdown
Member

@sudeepdino008 sudeepdino008 left a comment

Choose a reason for hiding this comment

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

shld add copilot's suggestion

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread db/version/file_version.go
Comment thread db/version/file_version_test.go
@sudeepdino008 sudeepdino008 merged commit cbc70e2 into release/3.4 Apr 7, 2026
22 checks passed
@sudeepdino008 sudeepdino008 deleted the alex/more_test_34 branch April 7, 2026 11:08
AskAlexSharov added a commit that referenced this pull request Apr 8, 2026
return static err instead of errorf - to reduce allocations
github-merge-queue bot pushed a commit that referenced this pull request Apr 10, 2026
## Summary
Cherry-pick of release/3.4 PRs:
- #20368 rpc: use synctest for TestClientCancelHTTP to fix CI flakiness
- #20373 integrity: blk/sec fix
- #20372 execution/state: use index-based range over log topics to avoid
copy
- #20367 fix: preserve stored chain config when genesis hash doesn't
match known chain
- #20374 ParseVersion: optimize
- #20369 batchSize: more precise estimate
- #20399 hive: pin more things

---------

Co-authored-by: erigon-copilot[bot] <265817861+erigon-copilot[bot]@users.noreply.github.com>
Co-authored-by: root <giulio.rebuffo@gmail.com>
Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Muzry <muzrry@gmail.com>
Co-authored-by: muzry.li <muzry.li1@ambergroup.io>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: info@weblogix.biz <admin@10gbps.weblogix.it>
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