refactor: Extract hardcoded constants into node and network config#123
Open
SIDDHANTCOOKIE wants to merge 1 commit into
Open
refactor: Extract hardcoded constants into node and network config#123SIDDHANTCOOKIE wants to merge 1 commit into
SIDDHANTCOOKIE wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
11 tasks
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.
Addressed Issues:
This PR refactors the Minichain codebase to decouple configuration parameters and hardcoded constants from the core logic files. It introduces two dedicated configuration files to manage constants moving forward.
Changes Made
node_config.py): Extracted parameters that individual node operators are free to adjust based on their system requirements:MALFORMED_THRESHOLD,FAILED_THRESHOLD, etc.)MEMPOOL_MAX_SIZE,MEMPOOL_TX_PER_BLOCK)MINING_MAX_NONCE)network_config.py): Extracted network-wide parameters that require strict conformity across all nodes to preserve consensus:PROTOCOL_ID,SUPPORTED_MESSAGE_TYPES,MAX_FRAME_BYTES)DEFAULT_MINING_REWARD)MAX_FUTURE_BLOCK_TIME_MS)chain.py,mempool.py,p2p.py,pow.py, andstate.pyto securely import these parameters rather than relying on internal hardcoded values.Screenshots/Recordings:
TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.
Additional Notes:
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist