Skip to content

V1 Prototype Snapshot#27

Merged
Olshansk merged 51 commits intomilestone/v1-prototypefrom
integration/workshop2/attempt2
Feb 28, 2022
Merged

V1 Prototype Snapshot#27
Olshansk merged 51 commits intomilestone/v1-prototypefrom
integration/workshop2/attempt2

Conversation

@Olshansk
Copy link
Copy Markdown
Collaborator

@Olshansk Olshansk commented Feb 23, 2022

This PR is meant to address this issue: #22.

It is a functional snapshot of the V1 prototype that can be referenced and used as a baseline as V1 development continues.

Testing

0. Prerequisite

The development environment and instructions here are not expected to be complete since the development environment is still a work in progress, but the two following assumptions are made:

  1. Docker is installed and the daemon is running locally.
  2. protoc is installed and running locally.

1. Pull changes:

$ git clone git@github.com:pokt-network/pocket.git pocket_v1_proto_snapshot
$ cd pocket_v1_proto_snapshot
$ git checkout -b integration/workshop2/attempt2 origin/integration/workshop2/attempt2
$ cd prototype

2. Clean environment:

$ cd prototype
$ make docker_wipe # Press `y` if prompted
$ make v1_generate_protos # Note that this is not using the docker protos at the moment

3. Run localnet

Example video can be found here.

3.1 Shell 1:

$ make compose_and_watch

3.2 Shell 2:

$ make client_start
$ make client_connect

3.3. Run commands

In Shell:

  1. Select TogglePaceMakerManualMode
  2. Select TogglePaceMakerManualMode

luyzdeleon and others added 30 commits November 26, 2021 15:27
The first version of the HotPocket specification.
Next steps:
1. Network message
2. Initialize network module properly
3. Uncomment publishing in consensus

Tasks:
- Need to figure out why starting the network module fails: /Users/olshansky/workspace/pocket/pocket/consensus/pkg/pocket/node.go
- Uncomment publishing after figuring out the above: /Users/olshansky/workspace/pocket/pocket/consensus/pkg/consensus/leader_election/module.go

Top of the list:
1. Network message
2. Initialize network module properly
3. Uncomment publishing in consensus
Added:
- prep2p
- Delve
- ConsensusMessages / NetworkMessage

TODO:
- Need to revert proto & utility module changes
…ityContext(s) && updated utility interfaces accordingly
@Olshansk
Copy link
Copy Markdown
Collaborator Author

@luyzdeleon I created the PR but it was still a WIP, so I should've marked it as a draft. Ready for review now!

@Olshansk
Copy link
Copy Markdown
Collaborator Author

@andrewnguyen22 @derrandz Note that I tried to keep the codebase as close as possible to what was presented last Friday. The only changes I made to make the testing instructions above work are these:

497e559 Improve docker_wipe command
7c0d2f3 Updated Makefile to generate all the necessary protos
466be36 Removed 'build' directory from gitignore since it contains the Dockerfiles
63d26c0 Added helper to Makefile to remove all containers
4edb55b Removed root contribution guide
d8dad1d Merge branch 'main' into integration/workshop2/attempt2
8561ace Revert the README
a7078fd Reverted code in root directory since everything is in prototype
3013985 Added prototype README
3ee06f2 Moved all the prorotype code into a prototype directory
9c596be Fix Dockerfile paths

@Olshansk Olshansk mentioned this pull request Feb 23, 2022
@derrandz
Copy link
Copy Markdown
Contributor

@Olshansk Good for me, I tried running this locally and everything works 👍🏻

@Olshansk Olshansk self-assigned this Feb 24, 2022
This was referenced Feb 24, 2022
Copy link
Copy Markdown
Contributor

@derrandz derrandz left a comment

Choose a reason for hiding this comment

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

Just eyeballed this, the final judge for me was the working running result. I expect proper "code" review will happen when we will be shipping in the modules, for a prototype snapshot, this is good for me.

Comment thread prototype/CONTRIBUTING.md
Comment thread prototype/consensus/README.md
Comment thread prototype/consensus/debug_handlers.go
@Olshansk
Copy link
Copy Markdown
Collaborator Author

@derrandz Correct. The entire prototype directory is a way for us to take a snapshot of the prototype at the end of last week. Not code reviewed, but a reference we can diff against. This requires a proper code review though: #29.

@luyzdeleon @andrewnguyen22 PTAL (Please Take A Look) when you have a chance, just from a functionality perspective, because once we move this over into mainline via a handful of PRs, we'd be able to delete prototype altogether.

@derrandz
Copy link
Copy Markdown
Contributor

@Olshansk will look into giving it thorough review sometime in the weekend.

@Olshansk
Copy link
Copy Markdown
Collaborator Author

@derrandz I was trying to imply that you SHOULD NOT do a thorough review of the code under prototype. The purpose of it is to have a reference in case something breaks. Thorough reviews should be done on other things moving forward.

@iajrz iajrz requested review from iajrz and removed request for iajrz February 28, 2022 13:57
@iajrz
Copy link
Copy Markdown
Contributor

iajrz commented Feb 28, 2022

Expected version of protoc should be specified.

@andrewnguyen22
Copy link
Copy Markdown
Contributor

I am unable to complete this step:

gco -b integration/workshop2/attempt2 origin/integration/workshop2/attempt2
cd prototype

-bash: gco: command not found
Also tried amending:

gcc -b integration/workshop2/attempt2 origin/integration/workshop2/attempt2
cd prototype
clang: error: unsupported option '-b integration/workshop2/attempt2'
clang: error: no such file or directory: 'origin/integration/workshop2/attempt2'
clang: error: no input files

@andrewnguyen22
Copy link
Copy Markdown
Contributor

After discussing with @iajrz it seems that is an alias for git checkout XD

Since this blocked me for 20 minutes, I must suggest you don't use alias' in your PRs

@andrewnguyen22
Copy link
Copy Markdown
Contributor

Failed at the proto generate step 2

Andrews-MacBook-Pro:prototype andrew$ protoc --version
libprotoc 3.12.4
Andrews-MacBook-Pro:prototype andrew$ make v1_generate_protos
protoc-gen-go: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go_out: protoc-gen-go: Plugin failed with status code 1.
make: *** [v1_generate_protos] Error 1
Andrews-MacBook-Pro:prototype andrew$ protoc version
Missing output directives.

Then I installed it: go install google.golang.org/protobuf/cmd/protoc-gen-go

Then I got the following:

message.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
make: *** [v1_generate_protos] Error 1

@andrewnguyen22
Copy link
Copy Markdown
Contributor

Functionality wise, seems good so approving

@Olshansk
Copy link
Copy Markdown
Collaborator Author

Olshansk commented Feb 28, 2022

@iajrz

Expected version of protoc should be specified.

I added a TODO in the Makefile: # TODO(team): Tested locally with 'protoc' version 'libprotoc 3.19.4'. In the near future, only the Dockerfiles will be used to compile protos.

@andrewnguyen22

gco: command not found

Sorry about that. I'll make sure to test with just plain bash in the future.

For context, it's an alias that's part of the ohmyzsh git plugin in case anyone is curious: https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh#L111

Failed at the proto generate step 2

Per the TODO I added above and since this is just prototype code, I will move forward with submitting it for now.

@Olshansk Olshansk merged commit 84d97b5 into milestone/v1-prototype Feb 28, 2022
@Olshansk Olshansk deleted the integration/workshop2/attempt2 branch February 28, 2022 18:05
Olshansk added a commit that referenced this pull request Feb 28, 2022
@Olshansk
Copy link
Copy Markdown
Collaborator Author

Olshansk commented Feb 28, 2022

@iajrz I accidentally forgot to push the protoc related TODO before merging...

Instead of creating the overhead of a PR for a one-line comment, just FYI that I'm adding it as a commit in the other PR.

Olshansk added a commit that referenced this pull request Mar 1, 2022
…n specific bus

# Context

This is the first of several PRs to address #21.

A lot of the code here was copied over from the `prototype` in #27, with some fixes, cleanup, modularization. 

**IMPORTANT NOTE TO THE REVIEWER**: Note that some code was deleted so just a skeleton is submitted and should be added back when the module-specific code is added back in.

## Details

- Various additions to the .gitignore file
- Makefile addition: temporary / experimental targets to enable V1 prototype development
- Add Dockerfiles for validator, debug client and Protobufs generation
- Add a 1st iteration version of the configuration file
- Add a 1st iteration version of the genesis file
- Add a docker-compose file for 4 validators and a debug client
- Add a debug client with a placeholder trigger
- Skeleton implementations of all 4 modules
- Update all go dependencies (go.mod, go.sum, etc…)
- Migrated first iteration of crypto library from pre-prototype to the prototype

## Next Steps
* Submit this PR as the foundation for pocket V1
* Prepare a small "design document" (< 1 page) on the structure of the bus and modules
* Write up a small document on how to use these (for contributors and new employees)

## TODOs as a result of the discussion PR
** (will create an issue and add these before submission)
- [ ] **[Small]** Remove makefile altogether
- [ ] **[Small]** Remove protobuf generation from host machine to Dockerfiles
- [ ] **[Small]** Add documentation for Goland & DLV debugging
- [ ] **[Medium]** Migrate all useful targets from Makefile to mage
- [ ] **[Large]** Discuss & design how `LoadConfig` should be implemented
- [ ] **[Ongoing]** Iterate on and define the structure of the configuration file
- [ ] **[Ongoing]** Iterate on and define the structure of the genesis file

## Testing

## 1. Pull changes (if not already local):
```
$ git clone git@github.com:pokt-network/pocket.git pocket
$ cd pocket
$ git checkout -b issue21/prototype/entrypoint origin/issue21/prototype/entrypoint
```

## [Optional] 2. View available commands:
```
$ make
```

## 3. Clean environment:
```
$ make docker_wipe # Press `y` if prompted
```

### 3.1 Shell 1:
```
$ make compose_and_watch
```

### 3.2 Shell 2:
```
$ make client_start
$ make client_connect
```

### 3.3. Run commands

Inspect that a placeholder events gets continually sent to the main bus

## [Optional] 4. Try running the other `make` targets:
```
$ make mockgen
$ make test_all
$ make protogen_local
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core infrastructure - protocol related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants