hiero-ledger / hiero-ledger/hiero-consensus-node
Use named constants for system account magic numbers
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
### Problem
Magic numbers 1000 and 750 are used in various places throughout the code to test whether a given account is a system account.
### Solution
Smart contract service has an AddressChecks interface that exposes isSystemAccount and other things to the smart contracts service, it uses the constant 1001. There's also the interesting constant 750. These two numbers - 1000 and 750 - and the concept of system accounts/user accounts behind it, should be a foundation thing that is declared in one place and used everywhere.
isHollow method should be more generally available and not hidden away - we currently have 5 <- count'em: 5 - separate implementations around.
### Alternatives
_No response_
Contributor guide
Research direction
Start at the AddressChecks interface and trace the isSystemAccount entry point, then locate the five isHollow implementations and all uses of 1000, 1001, and 750. The work is done when the system-account thresholds have one shared declaration and isHollow is generally available without duplicate implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, blockchain
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100