-
Notifications
You must be signed in to change notification settings - Fork 215
use account changes as int #7232
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
use account changes as int #7232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the representation of account changes from a struct with boolean fields to a uint32 bitmask representation to improve performance and memory usage.
- Changes
GetAccountChangesmethod signatures to returnuint32instead of*stateChange.AccountChanges - Updates account change detection logic to use bitwise operations instead of struct field assignments
- Modifies tests to use new bitmask constants and operations
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testscommon/state/stateChangesCollectorStub.go | Updates stub to return uint32 and use NoChange constant |
| state/stateAccesses/stateAccessesStorer.go | Minor formatting change adding blank line |
| state/stateAccesses/collector_test.go | Updates all tests to use new bitmask representation |
| state/stateAccesses/collector.go | Changes GetAccountChanges signature and removes mergeAccountChanges function |
| state/stateAccesses/accountChanges.go | Refactors getAccountChanges to use bitwise operations |
| state/interface.go | Updates StateAccessesCollector interface signature |
| state/disabled/disabledStateChangesCollector.go | Updates disabled implementation to return NoChange |
| go.mod | Updates mx-chain-core-go dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/state-changes #7232 +/- ##
===================================================
Coverage 75.03% 75.03%
===================================================
Files 812 812
Lines 134375 134358 -17
===================================================
- Hits 100826 100822 -4
+ Misses 27826 27817 -9
+ Partials 5723 5719 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return &disabledStateAccessesCollector{} | ||
| } | ||
|
|
||
| // GetAccountChanges returns nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
14f09f0
Reasoning behind the pull request
Proposed changes
accountChanges, encode the changes using anuint32Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?