-
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
[Consensus] Add MinBlockTime to delay mempool reaping #924
base: main
Are you sure you want to change the base?
Conversation
Thank you @red-0ne for this first contribution! |
@red-0ne Please make sure to update the issues & PR meta fields in the future. Updated it in this one for reference. |
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.
I did not review consensus/e2e_tests/pacemaker_test.go
yet.
Just minor comments / nits.
Interesting approach but I do want to look at it with fresh eyes tomorrow. Just want to see if we can make it a bit simpler.
Other than that, it's a fucking awesome start!
We can. True that this implementation is intricate. It's coupling timer registration with the client/listener logic which should not. I will split this into a timer registration function and a listening one. It would be much simpler to reason about. |
@Olshansk the logic should be more readable and ready to review now. Which makes me think about the nature of the delay. We are currently enforcing it at the leader level. Which means that if the leader wants to prepare the block earlier, there's nothing enforcing it not to do so. But if we place the delay at the new round message emission point. All (honest) replicas will delay their new round messages so that the leader could not reach the consensus and build the block earlier. This would mean that each block proposal time is enforced by the whole network instead of by its leader only. We could floor the delay imposed by replicas (eg. -10%) and let the leader that window to fine grain the timer. The problem I see with it, is that it makes reaching consensus always a hurry task, an adjustable offset could do the trick and even be dynamic. Also choreographing the replicas to distribute their deadlines over MinBlockTime period may also be worth digging. This should not be that much of a change 😄 Since at the new round construction level, any node knows if it's the leader of that round or not:
-- This may be overprotocoling too 🤣 |
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.
I will create pace maker documentation along the requested changes. |
Sounds great!
Note to self: Add the above to the code review guidelines. |
PaceMaker documentation added to PR#915 |
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.
@Olshansk , I resolved most of the change requests. Only remains these two discussions:
- Exposing
ProcessDelayedBlockPrepare
on/shared
which I don't think we should do. - Deferring
mutex.Unlock
Anything else to re-check before finalizing it?
…923) Co-authored-by: Daniel Olshansky <[email protected]>
## Description Add a client-side cache for sessions and use it in the `servicer` command. ## Issue Fixes #791 ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - A session cache in the client package - Use the new session cache in the servicer command ## Testing - [x] `make develop_test`; if any code changes were made - [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [x] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [x] I have tested my changes using the available tooling ### If Applicable Checklist - [ ] I have updated the corresponding README(s); local and/or global - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s) --------- Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: harry <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]>
## Description Add diagrams to describe validations done on trustless relays. Part of work on #918 ## Issue Fixes #918 ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [X] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Add a new markdown file to show trustless relay validations. ## Testing - [ ] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [ ] I have tested my changes using the available tooling - [ ] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [ ] I have updated the corresponding README(s); local and/or global - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
DevLog12 (iteration 21) update.
## Description This PR modifies servicer code to sign all the served relays. It also modified the servicer configuration to a) provide the required private key, and b) remove public key and address fields which are now driven from the private key. ## Issue Fixes #832 ## Type of change - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Updaed servicer config proto file. - Updated servicer module - Updated unit tests covering servicer module ## Testing - [x] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [x] I have tested my changes using the available tooling ### If Applicable Checklist - [ ] I have updated the corresponding README(s); local and/or global - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
## Description Fixes metrics scraping on LocalNet. After quite a few changes to the LocalNet infrastructure, the metrics collection appeared broken on LocalNet. <!-- reviewpad:summarize:start --> ### Summary generated by Reviewpad on 26 Jul 23 21:58 UTC This pull request fixes the issue with metrics scraping on LocalNet. It updates the Tiltfile and statefulset.yaml files to add pod annotations for Prometheus scraping and specify the port for scraping. <!-- reviewpad:summarize:end --> ## List of changes - Changed `podAnnotations` helm chart value to always "quote" values in case they are not strings (K8s API expects strings only in annotations) - Added annotations necessary for scraping of exporter endpoints by Prometheus on LocalNet
The delay is effectively applied when running in non-manual mode. Even if I had issues with block building (which seems to be coming from somewhere else). {"level":"info","module":"consensus","kind":"LEADER","height":0,"round":68,"step":1,"time":"2023-08-02T17:48:42Z","message":"📬 Received enough 📬 votes"}
{"level":"info","module":"consensus","kind":"LEADER","time":"2023-08-02T17:48:42Z","message":"Preparing a new block - no prepareQC found"}
{"level":"debug","module":"leader_utility_UOW","maxTxBytes":500000000,"proposer":"00104055c00bed7c983a48aac7dc6335d7c607a7","source":"CreateProposalBlock","time":"2023-08-02T17:48:47Z","message":"calling beginBlock"} |
That makes sense. This is intended for
Consider trying to revert to the |
You mean enable the feature only when manual is
Created an issue for that #965, it is not blocking this work. |
Yes. If |
## Description <!-- reviewpad:summarize:start --> ### Summary generated by Reviewpad on 03 Aug 23 20:11 UTC This pull request introduces several changes across multiple files. Here is a summary of the changes: 1. `go.mod`: - The `golang.org/x/text` dependency is now listed explicitly instead of being an indirect dependency. 2. `scenario_test.go`: - Added a new feature called "State Sync Namespace" that includes various commands and waits for specific amounts of time. - Code improvements and TODO comments have been added. 3. `FAQ.md`: - Updated an issue related to starting LocalNet with SELinux on an operating system. Replaced the command `make compose_and_watch` with `make lightweight_localnet` to avoid permission denied errors. 4. `.gitignore`: - Removed the entry "main" from the list of ignored files. - Removed the entries "rpc/server.gen.go" and "rpc/client.gen.go" from the list of ignored files. - Added the entry "**/gomock_reflect_*/" to ignore mock temporary files. 5. `e2e/README.md`: - Added a new section on `Keywords`. - Modified scenario descriptions and code examples to replace instances of "Validator" with "Node". - Included a flowchart depicting the E2E scenarios with updated terminology. 6. Consensus module files: - Added a new logging statement in the `HandleDebugMessage` function. - Simplified the handling of the `DEBUG_CONSENSUS_RESET_TO_GENESIS` action. 7. `.tiltignore`: - Removed the entry "main" from the list of ignored files. - Removed the entries "rpc/server.gen.go" and "rpc/client.gen.go" from the list of ignored files. 8. `CHANGELOG.md`: - Updated build commands and added a new section on `Keywords`. 9. `persistence/docs/CHANGELOG.md`: - Several changes related to deprecation, addition, and fixing of functions and issues. 10. `validator.feature`: - Renamed file from "valdator.feature" to "validator.feature". - Updated scenario titles and step descriptions to use more descriptive terminology. - Replaced references to "validator" with "node". 11. `tilt_helpers.go`: - Added a new file containing functions related to syncing network configuration and checking package installation. 12. `debug.go`: - Added new debug commands and subcommands. - Updated existing functions and added new functions for debug actions. 13. `account.feature`: - Added a new file containing scenarios for testing node account functionalities. 14. `README.md` files: - Updated sections, titles, dependencies, and instructions in various README.md files. 15. `build/config/README.md`: - Updated usage instructions, changing the command `make compose_and_watch` to `make lightweight_localnet`. 16. `iteration_3_end_to_end_tx.md`: - Updated commands to start LocalNet and consensus debugger. 17. Deleted files: - `validator.go` - `watch_build.sh` 18. New files added: - `debug.feature` - `tilt_helpers.go` - `account.feature` Please let me know if you need more information about any specific change. <!-- reviewpad:summarize:end --> ## Issue Fixes par of #579 ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - `s/compose_and_watch/lightweight_localnet` and all related helpers - `s/validator/node` in e2e tests for clarity - Add fire-and-forget `Debug` CLI w/ several useful initial subcommands - Add `keywords` to the `e2e` document - Add an `e2e debug` test to trigger views and track the blockchain increasing - Avoid rebuilding the actors if the CLI changes - Small miscellaneous improvements & code cleanup ## Testing - [x] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added, or updated, [`godoc` format comments](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://tip.golang.org/doc/comment)) - [ ] I have tested my changes using the available tooling - [ ] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [x] I have updated the corresponding README(s); local and/or global - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s) --- Co-authored-by: d7t <[email protected]>
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 PR has 106 lines changed relative to main. Please merge with main and resolve conflicts and re-request a review then.
Description
This PR implements delaying mempool reaping by
MinBlockTime
, resetting the timer at every new heightAll the logic lives in
consensus/pacemaker/module.go
, and the actual delay is happeningconsensus/hotstuff_leader.go
The mechanism ensures:
Concurrent requests
Late requests
Summary generated by Reviewpad on 02 Aug 23 18:00 UTC
This pull request introduces several changes across multiple files:
cli-client.yaml
file includes the addition of a new environment variable,POCKET_IBC_HOST_PRIVATE_KEY
, and changes to existing environment variables related to Postgres.block.go
file has changes related to package imports and modifications to various functions.uow_leader.go
file includes changes to import statements and modifications in theCreateProposalBlock
andreapMempool
functions.ibc/module.go
file has a small modification relating to a function call change.ibc_handle_event_test.go
file has a change related to the substitution of a method call.db.go
file has changes related to comments, function additions, and modifications.utility/unit_of_work/block.go
file includes changes to function implementations and comments.ibc_handler.go
file introduces a new interface and associated methods.transaction.go
file has changes related to theHandleTransaction
function and import statements.pacemaker_test.go
file introduces new unit tests.Tiltfile
file includes changes relating to configurations and values.consensus_config.proto
file has an addition of a new field.persistence_module.go
file has changes relating to method modifications, interface additions, and a TODO implementation.runtime/manager.go
file includes a comment regarding technical debt.manager.go
file has import statement additions and a new function.bsc.go
file has changes related to function renaming and updates to function calls.README.md
file has information regarding the disabling of pre-commit changelog verification.Please review these changes in detail to ensure they meet the requirements of the codebase.
Issue
Fixes #705
Type of change
Please mark the relevant option(s):
List of changes
Testing
make develop_test
; if any code changes were mademake test_e2e
on k8s LocalNet; if any code changes were madee2e-devnet-test
passes tests on DevNet; if any code was changedRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)