-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 #652
Conversation
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information |
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.
Missing changelog in module: consensus/
Missing changelog in module: shared/
Missing changelog in module: utility/
Changelog verification failed. See error messages for more detail.
Please update the relevant CHANGELOG.md files and ensure they follow the correct format.
AI-Generated Pull Request Summary: This pull request introduces various changes to improve code consistency, readability, error handling, and logging across multiple files. The primary modification is refactoring the |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information |
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.
Missing changelog in module: consensus/
Missing changelog in module: shared/
Missing changelog in module: utility/
Changelog verification failed. See error messages for more detail.
Please update the relevant CHANGELOG.md files and ensure they follow the correct format.
AI-Generated Pull Request Summary: This pull request introduces updates and improvements to several files, primarily focusing on renaming the
These changes help improve transaction processing, error handling, and maintainability in the creation of a proposal block and contribute to the overall robustness and efficiency of the system. |
Sweet |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information |
The check succeeded, dismissing the review comment.
- Added `stateHash` validation against `proposalBlock` | ||
- Added feature flag for `stateHash` validation (for testing purposes) | ||
- Updated tests accordingly | ||
|
||
## [0.0.0.34] - 2023-04-06 | ||
|
||
- Updated to reflect pools address changes |
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.
Here's a brief review of the provided code patch:
- It seems that you are updating the project's changelog with a new version (0.0.0.35) and its main changes.
- You have renamed a function
CreateAndApplyProposalBlock
toCreateProposalBlock
, which is clearer if it only creates proposal blocks without applying them. - Two new error types were added:
GetPrevBlockByzantineValidators
andProposalBlockNotSet
. Make sure they are caught and handled correctly. - Several log statements were added for instrumentation, this will help in debugging and understanding the application flow.
- Refactoring was done to improve readability and modularity of the code. This suggests a cleaner codebase but requires proper testing to ensure functionality hasn't been compromised.
- TODOs were added indicating additional refactoring plans. Be sure to follow up on these to continue improving the codebase.
- A variable was renamed
u
touow
for consistency. Ensure all references to the old name have been updated. stateHash
validation againstproposalBlock
has been added, which should improve security for the block. However, make sure that no incorrect validations throw unexpected errors.- A feature flag was introduced for
stateHash
validation for testing purposes. Remember to remove this when appropriate or decide whether to toggle it in production. - Lastly, tests have been updated accordingly. Confirm that all tests still pass after the above changes have been made.
Overall, the patch seems focused on increasing code readability and improving functionality. Testing the updated code thoroughly, both automatically and manually, is critical to ensure correctness and stability. Additionally, prompt action on the TODOs mentioned would be ideal for continuous improvement.
AI-Generated Summary: This pull request includes changes across multiple files, refactoring and updating the codebase for better readability, maintainability, and functionality. Key updates include:
Overall, this pull request enhances the code clarity, error handling, and modularization in the codebase, making it more maintainable and better for future development. |
@Olshansk I believe I tackled everything |
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.
Can you just rerun tests & localnet on your machine to make sure that the failure in consensus/e2e_tests/state_sync_test.go was a one-off flaky issue?
Otherwise, just see my suggestion and
## [0.0.0.48] - 2023-04-06 | ||
|
||
- Renamed `CreateAndApplyProposalBlock` to `CreateProposalBlock` | ||
|
||
## [0.0.0.47] - 2023-04-06 | ||
|
||
- Updated to reflect pools address changes |
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.
This actually isn't bad
Co-authored-by: Daniel Olshansky <olshansky@pokt.network>
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information |
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.
Latest date in consensus/doc/CHANGELOG.md is incorrect.
Latest: 2023-04-07, Current: 2023-04-06
Latest date in shared/CHANGELOG.md is incorrect.
Latest: 2023-04-07, Current: 2023-04-06
Latest date in utility/doc/CHANGELOG.md is incorrect.
Latest: 2023-04-07, Current: 2023-04-06
Changelog verification failed. See error messages for more detail.
Please update the relevant CHANGELOG.md files and ensure they follow the correct format.
AI-Generated Summary: This pull request includes changes in multiple files related to the refactoring of blockchain and consensus code, improving readability and consistency. Key changes involve renaming the function |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables for this repo. you could follow readme for more information |
- Update state_sync module with additional function definitions | ||
- Update state_sync module with additional function definitions | ||
|
||
## [0.0.0.41] - 2023-03-30 | ||
|
||
- Improve & simplify `utilityUnitOfWork` management |
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.
Based on the given code patch, here's a brief code review:
-
The changes in versioning and release notes are well-documented and clear.
-
Renaming
CreateAndApplyProposalBlock
toCreateProposalBlock
potentially reflects better separation of concerns in your application. -
Updating to use the new
ApplyBlock
signature andGetStateHash()
function fromutilityUnitOfWork
ensures consistency across the project. -
Removing the duplicate import means the code will be cleaner and more efficient.
-
Formatting inconsistencies are fixed by adding line breaks before and after listing updates for [0.0.0.42].
Overall, the changes appear beneficial and I don't see any obvious bugs or risks. However, it's important to ensure these changes are covered by appropriate tests and don't introduce unintended behavior throughout the project.
The check succeeded, dismissing the review comment.
AI-Generated Summary: This pull request introduces various changes across multiple files, primarily focusing on refactoring the |
test.mp4👍 |
* pokt/main: [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622) [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652) [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654) [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533) Update reviewpad.yml Added ChatGPT-CodeReview workflow (#649) Update reviewpad.yml Added default reviewpad.yml file (#648) [DevNet] tweaks for remote environments (#601) [Documentation] Swap validator and non-validator triggers when finished synching (#646) [Consensus] Configuration entry point state sync (#528)
…p-modules * pokt/main: [Utility][RPC][CLI] Querying governance parameters (Issue pokt-network#619) (pokt-network#622) [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue pokt-network#508 (pokt-network#652) [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (pokt-network#654) [PERSISTENCE] SavePoints and Rollbacks design document (Issue pokt-network#493) (pokt-network#533) Update reviewpad.yml Added ChatGPT-CodeReview workflow (pokt-network#649) Update reviewpad.yml Added default reviewpad.yml file (pokt-network#648) [DevNet] tweaks for remote environments (pokt-network#601) [Documentation] Swap validator and non-validator triggers when finished synching (pokt-network#646) [Consensus] Configuration entry point state sync (pokt-network#528)
…p-modules * pokt/main: update pocket repo read.me (#667) Update reviewpad.yml [KEYBASE] Add improve comment on keybase config (#665) [E2E] Chore: Doc updates (#663) [E2E] Adds staking, unstaking, and sending tests (#653) [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622) [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652) [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654) [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533) Update reviewpad.yml Added ChatGPT-CodeReview workflow (#649) Update reviewpad.yml Added default reviewpad.yml file (#648) [DevNet] tweaks for remote environments (#601) [Documentation] Swap validator and non-validator triggers when finished synching (#646) [Consensus] Configuration entry point state sync (#528)
…p-modules * pokt/main: update pocket repo read.me (#667) Update reviewpad.yml [KEYBASE] Add improve comment on keybase config (#665) [E2E] Chore: Doc updates (#663) [E2E] Adds staking, unstaking, and sending tests (#653) [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622) [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652) [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654) [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533) Update reviewpad.yml Added ChatGPT-CodeReview workflow (#649) Update reviewpad.yml Added default reviewpad.yml file (#648) [DevNet] tweaks for remote environments (#601) [Documentation] Swap validator and non-validator triggers when finished synching (#646) [Consensus] Configuration entry point state sync (#528)
Description
This PR tends to the deliverables in the parent issue
Issue
Fixes #508
Type of change
Please mark the relevant option(s):
List of changes
Consensus
ApplyBlock
signature fromutilityUnitOfWork
utilityUnitOfWork.GetStateHash()
CreateAndApplyProposalBlock
toCreateProposalBlock
Shared
CreateAndApplyProposalBlock
toCreateProposalBlock
GetStateHash
toUtilityUnitOfWork
Utility
CreateAndApplyProposalBlock
toCreateProposalBlock
GetPrevBlockByzantineValidators
andProposalBlockNotSet
errorsCreateProposalBlock
andApplyBlock
with log statementsu
touow
for consistencystateHash
validation againstproposalBlock
stateHash
validation (for testing purposes)Testing
make develop_test
; if any code changes were madeRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)