Skip to content
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

[Utility] Session Interface - GetSession Implementation (1st iteration) #683

Merged
merged 58 commits into from
Apr 28, 2023

Conversation

Olshansk
Copy link
Member

@Olshansk Olshansk commented Apr 15, 2023

Description

The first implementation of the session interface; the GetSession UtilityModule function.

Issue

Fixes #569

AI-Generated Summary

This pull request includes updates and improvements to various files related to the configuration of local environments, setting up sessions and actors, and enhancing the test suite for several modules. Significant changes include the addition of new parameters and properties for fishermen, introduction of the Session message in the session.proto file, a new test file module_test.go for the utility package, and multiple updates to the gov.go file.

Additional enhancements encompass renaming files, removing unnecessary functions, adding and updating tests and test artifacts, implementing new methods and functions, and making minor formatting and optimization changes. Furthermore, ideas for future improvements and optimizations have been marked with TechDebt, suggesting potential refactoring or redesign later in development. Overall, these changes aim to make the codebase more maintainable, readable and efficient, while also extending the functionality of several modules.

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

Primary Changes

  • Added a new Session protobuf
  • Added a GetSession function to the Utility module interface
  • Implemented the GetSession function from the Utility module interface
  • Added a sessionHydrator structure used to populate a new session
  • Added a fisherman_per_session governance parameter

Supplementary Changes

  • Introduced testing helper to test the UtilityModule interface implementation
  • Added a GetActor function to the Persistence module interface
  • Implemented a new GetActor persistence modular function
  • Added an ability to add options to the NewGenesisState helper for more thorough testing

Secondary Changes

  • Updated the default blocks_per_session from 4 to 1
  • Consolidated files for defaults together
  • Minor code and comment cleanup

Testing

  • make develop_test; if any code changes were made
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • 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 on touched members (see: 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 diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@Olshansk Olshansk self-assigned this Apr 15, 2023
@reviewpad reviewpad bot added the large label Apr 15, 2023
@Olshansk Olshansk added utility Utility specific changes and removed large labels Apr 15, 2023
@reviewpad reviewpad bot added the large label Apr 15, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: build/

Missing changelog in module: persistence/

Missing changelog in module: runtime/

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: build/

Missing changelog in module: persistence/

Missing changelog in module: runtime/

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.

@Olshansk Olshansk removed the large label Apr 17, 2023
@reviewpad reviewpad bot added the large label Apr 17, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: build/

Missing changelog in module: persistence/

Missing changelog in module: runtime/

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: build/

Missing changelog in module: persistence/

Missing changelog in module: runtime/

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.

bryanchriswhite and others added 4 commits April 28, 2023 13:38
Removes the unneeded `stdnetwork` package.

Covers removal goal of #266. The simplification goal is tracked by #553.
TLDR; should close #266.

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

- Removed unneeded `stdnetwork` package
- Removed unneeded `use_rain_tree` P2P config field

- [ ] `make develop_test`; if any code changes were made
- [x] [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

- [ ] 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

- [ ] 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)
## Description

Refactors everything in the P2P module which previously referred to a
"network" to instead be thought of as a "router". This begins with the
`typesP2P.Network` interface and the changes propagates down from there,
through implementations and into variable names, tests, etc.

## Issue

Fixes #<issue_number>

## Type of change

Please mark the relevant option(s):

- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->

## List of changes

- Renamed `Network` interface to `Router`
- Shortened `Router#NetworkBroadcast` to `#Broadcast`
- Shortened `Router#NetworkSend` to `#Send`
- Shortened `Router#networkSendInternal` to `#sendInternal`
- Shortened `Router#networkBroadcastAtLevel` to `#broadcastAtLevel`
- Renamed `rainTreeNetwork` to `rainTreeRouter`
- Renamed `rainTreeNetwork` method receivers
- Renamed `p2pModule#network` to `#router`
- Renamed `p2pModule#setupNetwork()` to `#setupRouter()`
- Renamed config var in `rainTreeRouter#Create`
- Renamed router logger
- Renamed `NewRainTreeNetwork()` to `NewRainTreeRouter()`
- Refactored peers_manager_test.go
- Refactored network_test.go
- Simplified p2p module/router config handoff
- Updated debug logging

## Testing

- [ ] `make develop_test`; if any code changes were made
- [ ] [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

- [ ] 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)
Copy link
Contributor

@dylanlott dylanlott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor nits, nothing showstopping. Passes tests on my machine. ✅ Let's get this merged 🚀

Makefile Outdated Show resolved Hide resolved
shared/core/types/proto/actor.proto Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: logger/

Missing changelog in module: p2p/

Changelog verification failed. See error messages for more detail.

Please update the relevant CHANGELOG.md files and ensure they follow the correct format.

@github-actions github-actions bot dismissed stale reviews from themself April 28, 2023 21:23

The check succeeded, dismissing the review comment.

@bryanchriswhite bryanchriswhite dismissed their stale review April 28, 2023 21:46

don't want to block approval

@Olshansk Olshansk merged commit fb245bc into main Apr 28, 2023
@Olshansk Olshansk deleted the issues/569/session_impl branch April 28, 2023 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cl validate Run the changelog validation workflow utility Utility specific changes waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Utility] Session Protocol - Implement Interface
3 participants