Skip to content

Commit

Permalink
Merge remote-tracking branch 'pokt/main' into fix/zero-value-nonce
Browse files Browse the repository at this point in the history
* pokt/main:
  [P2P] Integrate background router (#732)
  Update main README.md
  [Bug] Fix CI linter errors (#885)
  [Tooling] Block `IN_THIS_*` comments from passing CI (#889)
  [Utility] Update E2E feature path template doc (#870)
  [IBC] Add nil check on proof for membership and non-membership proof creation (#877)
  Added git diff state to devlog10
  Devlog 10 (#872)
  • Loading branch information
bryanchriswhite committed Jul 11, 2023
2 parents 235e06c + 6b875ee commit 7aced4e
Show file tree
Hide file tree
Showing 35 changed files with 1,648 additions and 322 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Please mark the relevant option(s):
## List of changes

<!-- REMOVE this comment block after following the instructions
List out all the changes made
List out all the changes made.
A PR should, preferably, be about a single change and the corresponding tests
-->

- Change #1
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: golangci-lint
# Copied from https://github.com/golangci/golangci-lint-action

on:
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

env:
# Even though we can test against multiple versions, this one is considered a target version.
TARGET_GOLANG_VERSION: "1.19"
PROTOC_VERSION: "3.19.4"

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.TARGET_GOLANG_VERSION }}
cache: false
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: install CI dependencies
run: make install_ci_deps
- name: generate protobufs, RPC server, RPC client and mocks
run: make protogen_clean && make protogen_local && make mockgen && make generate_rpc_openapi
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=10m --build-tags=test
skip-cache: true
10 changes: 0 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ on:
# - "docs/**"
# - "**.md"


env:
# Even though we can test against multiple versions, this one is considered a target version.
TARGET_GOLANG_VERSION: "1.19"
Expand Down Expand Up @@ -87,14 +86,6 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: ./coverage.out
- name: golangci-lint
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=10m --build-tags=test
skip-cache: true
only-new-issues: true

# TODO(@okdas): reuse artifacts built by the previous job instead
# of going through the build process in container build job again
Expand Down Expand Up @@ -153,7 +144,6 @@ jobs:
build-args: |
TARGET_GOLANG_VERSION=${{ env.TARGET_GOLANG_VERSION }}
# Run e2e tests on devnet if the PR has a label "e2e-devnet-test"
e2e-tests:
runs-on: custom-runner
Expand Down
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ linters:
- govet
- ineffassign
- staticcheck
- typecheck
- unused

# Additional linters
- gosec
- misspell
- promlinter
- unparam
- goimports

# Gocritic allows to use ruleguard; custom linting rules
- gocritic

linters-settings:
# Gocritic settings; https://go-critic.com/overview
gocritic:
Expand Down
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,17 @@ go_fmt: ## Format all the .go files in the project in place.
gofmt -w -s .

.PHONY: install_cli_deps
install_cli_deps: ## Installs `protoc-gen-go`, `mockgen`, 'protoc-go-inject-tag' and other tooling
install_cli_deps: ## Installs `helm`, `tilt` and the underlying `ci_deps`
make install_ci_deps
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

.PHONY: install_ci_deps
install_ci_deps: ## Installs `protoc-gen-go`, `mockgen`, 'protoc-go-inject-tag' and other tools necessary for CI
go install "google.golang.org/protobuf/cmd/protoc-gen-go@v1.28" && protoc-gen-go --version
go install "github.com/golang/mock/mockgen@v1.6.0" && mockgen --version
go install "github.com/favadi/protoc-go-inject-tag@latest"
go install "github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.11.0"
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

.PHONY: develop_start
develop_start: ## Run all of the make commands necessary to develop on the project
Expand Down Expand Up @@ -297,7 +301,7 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the
$(PROTOC_SHARED) -I=./consensus/types/proto --go_out=./consensus/types ./consensus/types/proto/*.proto

# P2P
$(PROTOC_SHARED) -I=./p2p/raintree/types/proto --go_out=./p2p/types ./p2p/raintree/types/proto/*.proto
$(PROTOC_SHARED) -I=./p2p/types/proto --go_out=./p2p/types ./p2p/types/proto/*.proto

# echo "View generated proto files by running: make protogen_show"

Expand Down Expand Up @@ -588,4 +592,4 @@ ggshield_secrets_scan: ## Scans the project for secrets using ggshield

.PHONY: ggshield_secrets_add
ggshield_secrets_add: ## A helper that adds the last results from `make ggshield_secrets_scan`, store in `.cache_ggshield` to `.gitguardian.yaml`. See `ggshield for more configuratiosn`
ggshield secret ignore --last-found
ggshield secret ignore --last-found
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If you'd like to contribute to the Pocket V1 Protocol, start by:

- [Shared Architecture](shared/README.md)
- [Utility Architecture](utility/doc/README.md)
- _Coming Soon: Consensus Architecture_ // TODO(olshansky): needs a README file with proper code structure
- [Consensus Architecture](consensus/README.md)
- [Persistence Architecture](persistence/docs/README.md)
- [P2P Architecture](p2p/README.md)
- [APP Architecture](app/client/doc/README.md)
Expand Down
1 change: 1 addition & 0 deletions app/client/cli/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"fmt"

"github.com/spf13/cobra"

"github.com/pokt-network/pocket/app/client/cli/flags"
Expand Down
19 changes: 19 additions & 0 deletions build/linters/blockers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//nolint // it's not a Go code file
//go:build !codeanalysis
// +build !codeanalysis

// This file includes our custom linters.
// If you want to add/modify an existing linter, please check out ruleguard's documentation: https://github.com/quasilyte/go-ruleguard#documentation

package gorules

import (
"github.com/quasilyte/go-ruleguard/dsl"
)

// Blocks merge if IN_THIS_ comments are present
func BlockInThisCommitPRComment(m dsl.Matcher) {
m.MatchComment(`//.*IN_THIS_.*`).
Where(!m.File().Name.Matches(`Makefile`) && !m.File().Name.Matches(`blockers.go`)).
Report("'IN_THIS_' comments must be addressed before merging to main")
}
2 changes: 1 addition & 1 deletion build/linters/errs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/quasilyte/go-ruleguard/dsl"
)

// This is a custom linter that checks ensures a use of inline error checks
// This is a custom linter that ensures a use of inline error checks
func InlineErrCheck(m dsl.Matcher) {
m.Match(`$err := $x; if $err != nil { $*_ }`).
Where(m["err"].Type.Is(`error`)).
Expand Down
2 changes: 1 addition & 1 deletion build/linters/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/quasilyte/go-ruleguard/dsl"
)

// This is a custom linter that checks ensures a use of require.Equal
// This is a custom linter that ensures the use of require.Equal
func EqualInsteadOfTrue(m dsl.Matcher) {
m.Match(`require.True($t, $x == $y, $*args)`).
Suggest(`require.Equal($t, $x, $y, $args)`).
Expand Down
154 changes: 154 additions & 0 deletions docs/devlog/devlog10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Pocket V1 DevLog #10 <!-- omit in toc -->

**Date Published**: July 5th, 2023

We have kept the goals and details in this document short, but feel free to reach out to @Olshansk in the [core-dev-chat](https://discord.com/channels/553741558869131266/986789914379186226) for additional details, links & resources.

## Table of Contents <!-- omit in toc -->

- [Iteration 20 Goals \& Results](#iteration-20-goals--results)
- [V0](#v0)
- [M1: PoS](#m1-pos)
- [M2: DoS](#m2-dos)
- [M3: RoS](#m3-ros)
- [M7: IBC](#m7-ibc)
- [Contribute to V1 🧑‍💻](#contribute-to-v1-)
- [Links \& References](#links--references)
- [ScreenShots](#screenshots)
- [Iteration 19 - Completed](#iteration-19---completed)
- [Iteration 20 - Planned](#iteration-20---planned)

## Iteration 20 Goals & Results

**Iterate Dates**: June 15th - June 30th, 2023

🔥 The team frikkin killed it 🔥

```bash
git diff 2074a1b0c27ec2c73168b02852cc6145b657c0af --stat
# 107 files changed, 9032 insertions(+), 10508 deletions(-)
```

Note that this exclude the work we did on infrastructure support, internal documentation, v0 work, SMT repo, collaboration with other projects and a lot more that happens behind the scenes!

### V0

- 🟢 **TestNet Rehearsal**

- 100% completeness of TestNet Rehearsal
- **Grade**: 10 / 10
- Completed

- 🟢 **MainNet Rehearsal**
- Have 5% of MainNet run the latest beta (w/o protocol upgrade)
- **Grade**: 10 / 10
- Completed and found some bugs along the way too when synching from scratch

### M1: PoS

- 🔴 Consensus

- Attempt #1: Remove State Sync dependency on FSM
- Attempt #3: finish minimum viable state sync
- **Grade**: 1 / 10
- Very little time left to work on this

- 🟢 Persistence

- MVP of the full commit & rollback DEMO
- **Grade**: 7 / 10
- The test which was going to be the demo has fought me more than expected but good progress has been made, there’s a design document ready, and the test harness is there, the mocks and the submodule interactions have been the problem.

- 🟢 P2P
- Attempt #N: Finishing off and merging in everything related to gossip and background
- **Grade**: 8.5 / 10

### M2: DoS

- 🔴 **Primary focus: observability**
- Open question: need to identify issues w/ metric access
- Streamlining logging: Make structured logging system easily available to new devs w/ documentation part of LocalNet instructions
- Attach smaller tickets in a separate repo to V2
- **Grade**: 0 / 10
- Other infrastructure related maintenance issues took away time from being able to focus on observability

### M3: RoS

- 🟢 **Trustless Relay**

- Session caching on the client
- Finish all the PRs in flight (review, merge in)
- Provide an E2E test that works, blocks CI if it breaks, documented and visible (DEMO)
- **Grade**: 8 / 10

- 🟡 **Feature Flags**
- Scope out the work necessary and create an E2E Feature Path github ticket using the template we created
- **Grade**: 5 / 10
- Research and design doc made good progress w/ support from bigBoss bus still a lot to do.

### M7: IBC

- 🟢 **SMST**

- Get it reviewed & merged in
- Clean up the documentation & merge it in
- Visualizers: create a visualizer for the tree
- Present: Finish off the SMT presentation
- Stretch goal: potentially start storing trustless relays in it
- **Grade**: 8.5 / 10
- SMST merged (wrapper around SMT option)
- Visualiser is accurate but not pretty could do with some more work
- Presentation went well but definietly could improve on some packed slides
- Need to work closer with @Arash Deshmeh to get it in prod with M3

- 🟢 **ICS23**

- Put up the github ticket and PR for reivew to merge in the proof mechanisms
- Up to cosmos on ETA to review/merge
- **Grade**: 9 / 10
- ICS23 merged in our repo using my fork of `cosmos/ics23` as a dependency
- My explanations on why the exclusion proof is needed can improve as others find it hard to understand
- Cosmos PR is ready to merge pending review (probably take a while)

- 🟡 **ICS24**

- Put up event logging for review; stretch goal is to merge
- **Grade**: 6 / 10
- ICS-24 stores have made great progress
- Event logging unfortunately didnt make this fortnight
- Message onto/off of bus as transactions works well 👍🏻

- 🟡 **Light client spike**
- Start knowing where to head with research
- **Grade**: 5 / 10
- ICS-02 specced out well
- ICS-08 needs more work into its design
- Need to learn more about CosmWasm and WasmVM
- WIP document needs to be converted to ticket epic
- https://hackmd.io/0WVMarGpSIGqEyzvnygWpw

## Contribute to V1 🧑‍💻

### Links & References

- [V1 Specifications](https://github.com/pokt-network/pocket-network-protocol)
- [V1 Repo](https://github.com/pokt-network/pocket)
- [V1 Wiki](https://github.com/pokt-network/pocket/wiki)
- [V1 Project Dashboard](https://github.com/pokt-network/pocket/projects?query=is%3Aopen)

## ScreenShots

Please note that everything that was not `Done` in iteration19 is moving over to iteration20.

### Iteration 19 - Completed

![Iteration19_1](https://github.com/pokt-network/pocket/assets/1892194/93f033e9-a408-49bf-9531-9f84cc1bc254)
![Iteration19_2](https://github.com/pokt-network/pocket/assets/1892194/2c600d90-fe4c-496b-a4e4-66ef0afb4771)

### Iteration 20 - Planned

_tl;dr Aim to demo as much of the work from the previous iteration in action_

![Iteration20](![Screenshot 2023-07-05 at 1 35 07 PM](https://github.com/pokt-network/pocket-core/assets/1892194/8ae047ee-f186-4e1a-8ced-14764ec83886))

<!-- GITHUB_WIKI: devlog/2023_07_05 -->
5 changes: 2 additions & 3 deletions ibc/store/proofs_ics23.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func VerifyNonMembership(root ics23.CommitmentRoot, proof *ics23.CommitmentProof
// in the SMT provided
func createMembershipProof(tree *smt.SMT, key, value []byte) (*ics23.CommitmentProof, error) {
proof, err := tree.Prove(key)
if err != nil {
if err != nil || proof == nil {
return nil, coreTypes.ErrCreatingProof(err)
}
return convertSMPToExistenceProof(proof, key, value), nil
Expand All @@ -72,10 +72,9 @@ func createMembershipProof(tree *smt.SMT, key, value []byte) (*ics23.CommitmentP
// createNonMembershipProof generates a CommitmentProof object verifying the membership of an unrealted key at the given key in the SMT provided
func createNonMembershipProof(tree *smt.SMT, key []byte) (*ics23.CommitmentProof, error) {
proof, err := tree.Prove(key)
if err != nil {
if err != nil || proof == nil {
return nil, coreTypes.ErrCreatingProof(err)
}

return convertSMPToExclusionProof(proof, key), nil
}

Expand Down
Loading

0 comments on commit 7aced4e

Please sign in to comment.