Merged
Conversation
It was not used anywhere. Presumably, it was written thinking that a StateDelta would be check after making it. But instead, each step of creating the StateDelta is checked.
a52c8c8 to
01aa06a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6324 +/- ##
==========================================
- Coverage 51.82% 51.81% -0.01%
==========================================
Files 652 652
Lines 87425 87425
==========================================
- Hits 45307 45300 -7
- Misses 39249 39255 +6
- Partials 2869 2870 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
01aa06a to
1e2a1d5
Compare
By moving bounds into their own package, it is both clearer (config.MaxTxGroupSize was never a _config_ value, really, it was a derived bound, based on config values.) and allows the `basic` to import only these limits, with importing `config`. In turn, that will mean that we can import `basic` into `config` so `ConsensusParams` can have types in it like `basics.Round`.
1e2a1d5 to
b92a804
Compare
e5f7f39 to
0b3a4db
Compare
0b3a4db to
8b15db9
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR decouples allocation bound constants from the config package by moving them into a new bounds package, clarifying their role and simplifying dependency relationships between packages. Key changes include:
- Updating import paths and references from config to config/bounds across multiple packages (transactions, bookkeeping, basics, appRateLimiter, etc.).
- Adjusting codec struct tags and size calculations in msgp generation functions to reference the new bounds constants.
- Updating tests and consensus parameter checks to work with the new bounds package.
Reviewed Changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| data/transactions/logic/eval_test.go | Updated import and require check for MaxTxGroupSize |
| data/transactions/logic/eval.go | Replaced config constants with bounds in constant definitions |
| data/transactions/application.go | Updated codec struct tags for application arguments and programs |
| data/bookkeeping/msgp_gen.go | Switched from config to bounds in error checks for genesis and log sizes |
| data/bookkeeping/block.go | Updated struct tags to use bounds constants for GenesisID and Payset |
| data/basics/userBalance_test.go | Removed an allocation bounds test referencing config constants |
| data/basics/userBalance.go | Updated codec tags on maps and programs to use bounds constants |
| data/basics/teal.go | Adjusted codec tags to reference bounds for TEAL key/value sizes |
| data/basics/msgp_gen.go | Replaced references from config to bounds in decoding overflow checks |
| data/appRateLimiter_test.go & data/appRateLimiter.go | Updated TxGroup size and pool pre-allocation constants to use bounds |
| daemon/algod/api/server/v2/handlers.go | Updated decodeTxGroup call to use bounds.MaxTxGroupSize |
| crypto/stateproof/weights_test.go | Updated tests to use bounds constants for state proof computations |
| crypto/stateproof/structs.go | Updated inline documentation to reference bounds constants |
| config/consensus.go | Updated bounds checks to use the new bounds package |
| config/config_test.go | Adjusted tests referencing allocation bounds to use bounds constants |
| config/config.go | No functional change; remains lower in priority after bounds migration |
| config/bounds/bounds.go | Introduced new package with all bound declarations and constants |
| agreement/msgp_gen.go & agreement/bundle.go | Updated codec tags and overflow checks to reference bounds constants |
algorandskiy
approved these changes
May 16, 2025
gmalouf
approved these changes
May 16, 2025
cce
pushed a commit
to cce/go-algorand
that referenced
this pull request
May 29, 2025
This was referenced Jul 31, 2025
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.
This is a first step to remove the use of the
configpackage in thebasicspackage.We use many constants, derived from ConsensusParams, or checked against ConsensusParams, as allocbounds. Therefore, types in
basicsend up needing to use theconfigpackage to access them, so theconfigpackage can't usebasicswhich prevents a lot of natural typing choices.This PR moves all such variables and constants to a
boundspackage. I think this also helps clearly separate them from the consensus parameters themselves, and they now appear asallocbound=bounds.Max....which seems clearer.Summary
Test Plan