Skip to content

Commit 843c5c4

Browse files
Merge remote-tracking branch 'pokt/main' into refactor/nonce-deduper
* pokt/main: [P2P] refactor: message handling (#763) Remove coverage prep stage as this corrupts the coverage report (#792) [Utility] E2E Feature Path Template (#734)
2 parents afec03c + fba11c3 commit 843c5c4

5 files changed

Lines changed: 217 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ jobs:
8282
uses: guyarb/[email protected]
8383
with:
8484
test-results: test_results.json
85-
- name: Prepare code coverage report
86-
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
87-
run: go tool cover -func=coverage.out -o=coverage.out
8885
- name: Upload coverage to Codecov
8986
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
9087
uses: codecov/codecov-action@v3
88+
with:
89+
files: ./coverage.out
9190
- name: golangci-lint
9291
if: ${{ always() && env.TARGET_GOLANG_VERSION == matrix.go }}
9392
uses: golangci/golangci-lint-action@v3

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,3 +560,15 @@ send_local_tx: ## A hardcoded send tx to make LocalNet debugging easier
560560
.PHONY: query_chain_params
561561
query_chain_params: ## A hardcoded ChainParams query to make LocalNet debugging easier
562562
go run app/client/main.go Query AllChainParams
563+
564+
.PHONY: search_structs
565+
search_structs: ## Greps and outputs all of the structs in the project (excluding vendor or proto generated files)
566+
grep -r "type .* struct" --exclude-dir="vendor" --exclude="*.gen.go" --exclude="*.pb.go" .
567+
568+
.PHONY: search_interfaces
569+
search_interfaces: ## Greps and outputs all of the structs in the project (excluding vendor or proto generated files)
570+
grep -r "type .* interface" --exclude-dir="vendor" --exclude="*.gen.go" --exclude="*.pb.go" .
571+
572+
.PHONY: search_protos
573+
search_protos: ## Finds all of the proto files in the project (excluding vendor)
574+
find . -name "*.proto" -not -path "./vendor/*"

p2p/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Move NonceDeduper (and related types) from p2p/raintree to p2p/utils pkg
1515
- Move NonceDeduper usage out of RainTreeRouter and into p2pModule
1616

17-
## [0.0.0.52] - 2023-05-26
17+
## [0.0.0.52] - 2023-05-31
1818

1919
- Added `Handler` field to `RainTreeConfig` & `BackgroundConfig`
2020
- Refactored `rainTreeRouter` logging methods

utility/doc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.0.0.41] - 2023-05-30
11+
12+
- Added the E2E Feature Path Template to document, present and explain how to go about defining and scoping utility level features
13+
1014
## [0.0.0.40] - 2023-05-04
1115

1216
- Expose `HydrateIdxTx` for use outside of utility
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# E2E Feature Path <!-- omit in toc -->
2+
3+
_IMPROVE(olshansky): Once we've completed the entire process at least once, we'll add links to each step._
4+
5+
- [Introduction \& Goals](#introduction--goals)
6+
- [Developer Journey](#developer-journey)
7+
- [E2E Feature Specification](#e2e-feature-specification)
8+
- [Spot Feature](#spot-feature)
9+
- [Spike Feature](#spike-feature)
10+
- [Scope Feature](#scope-feature)
11+
- [1. GitHub Ticket](#1-github-ticket)
12+
- [2. Origin Document](#2-origin-document)
13+
- [E2E Feature Implementation](#e2e-feature-implementation)
14+
- [POC: Proof of Concept](#poc-proof-of-concept)
15+
- [MVC: Minimum Viable Change](#mvc-minimum-viable-change)
16+
- [PROD: Production](#prod-production)
17+
18+
## Introduction & Goals
19+
20+
The [Pocket Network Specification](https://github.com/pokt-network/pocket-network-protocol/tree/main/utility) implementation is driven by various [milestones](https://github.com/pokt-network/pocket/milestones) and protocol/module/component specific tasks. Each feature crosses the boundaries of business logic, data types, and interfaces for different components. Due to the complex nature of implementation, we've designed a streamlined "developer journey".
21+
22+
**The goal** of this document is to outline a well-defined process for incorporating an end-to-end feature path. This makes each feature/task easier to scope, reason about, design, and implement.
23+
24+
## Developer Journey
25+
26+
```mermaid
27+
%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%
28+
timeline
29+
title E2E Feature Path Developer Journey
30+
31+
section E2E Feature Specification
32+
Spot Feature:
33+
User research:
34+
Product management:
35+
Protocol intuition/experience:
36+
Addition/removal/selection of feature from the list
37+
Spike Feature:
38+
Research details:
39+
Identify pointers:
40+
Note dependencies:
41+
Find blockers
42+
Scope Feature:
43+
Define requirements:
44+
Document E2E implementation
45+
46+
section E2E Feature Implementation
47+
POC:
48+
POC Spike:
49+
Explore:
50+
Hack:
51+
Have fun!
52+
MVC:
53+
Data Structures:
54+
Interfaces:
55+
Implementation:
56+
Unit Tests:
57+
E2E Tests:
58+
Documentation
59+
PROD:
60+
Identify workarounds & hacks:
61+
Document future work:
62+
Ideate!
63+
```
64+
65+
## E2E Feature Specification
66+
67+
### Spot Feature
68+
69+
Choose or add a feature from the Utility E2E feature list [here](./E2E_FEATURE_LIST.md).
70+
71+
### Spike Feature
72+
73+
Create a SPIKE GitHub issue, like [this](<[http](https://github.com/pokt-network/pocket/issue/TODO_LINK_TO_ISSUE_ONCE_WE_HAVE_EXAMPLE)>) to scope the feature. This ticket is responsible for creating the ticket that'll track the work.
74+
75+
### Scope Feature
76+
77+
Leverage the results from the SPIKE to create an implementation GitHub issue, like [this](<[http](https://github.com/pokt-network/pocket/issue/TODO_LINK_TO_ISSUE_ONCE_WE_HAVE_EXAMPLE)>) to track the actual implementation.
78+
79+
#### 1. GitHub Ticket
80+
81+
Open a [new issue](https://github.com/pokt-network/pocket/issues/new?assignees=&labels=&projects=&template=issue.md&title=%5BREPLACE+ME%5D+with+a+descriptive+title) and populate its description, respectively, with the following additional elements:
82+
83+
**Objective**: `Implement MVC E2E Feature Path <Letter>.<Number>: <Name>`
84+
85+
**Origin Document**: _Specify the details from the [Origin Document](#origin-document) below_
86+
87+
**Goals**:
88+
89+
- Complete the MVC implementation of the E2E Feature Path outlined in the objective
90+
- Identify future tasks and test requirements to transition the feature to production
91+
92+
**Deliverables**:
93+
94+
**POC**:
95+
96+
- [ ] A POC SPIKE to be discarded, refactored, and/or restructured into multiple PRs
97+
98+
**MVC**:
99+
100+
- [ ] A PR that adds or modifies relevant structures and interfaces; such as [shared/core/types/proto](../../shared/core/types/proto), [shared/modules](../../shared/modules), etc
101+
- [ ] A PR that materializes an MVC of the feature along with unit tests
102+
- [ ] A PR that introduces a new E2E tests with **one or more happy** and **one or more sad** path scenarios as described in the origin document (refer to [e2e/README.md](../../e2e/README.md)); this may require additions to the [cli](https://github.com/pokt-network/pocket/tree/main/app/client)
103+
- [ ] A PR that updates all pertinent documentation
104+
105+
**PROD**:
106+
107+
- [ ] One or more subsequent GitHub issues that track future work including, but not limited to:
108+
- Enhancing test coverage
109+
- Adding subsequent features
110+
- Patching hacks or workarounds
111+
- Enabling your [imagination](https://github.com/pokt-network/pocket/assets/1892194/6aff9004-8d3b-48e8-b6d5-9b67ac266e3d)!
112+
113+
#### 2. Origin Document
114+
115+
**Purpose:** [Replace this with a single sentence that captures the intended purpose, behaviour and goal of the E2E feature]
116+
**Actors**: Check all of the protocol actors involved in the feature:
117+
118+
- [ ] Validator
119+
- [ ] Application
120+
- [ ] Servicer
121+
- [ ] Fisherman
122+
- [ ] Portal
123+
124+
**Data Structures**:
125+
126+
- A list of the core types (protobufs, structs, etc) that will be used, added or modified in this feature
127+
- Mention or link to specific files if applicable
128+
- See [shared/core/types/proto](../../shared/core/types/proto) as a reference as they will most likely, but not necessarily, be part of that package
129+
- _TIPS:_
130+
- _This will be non-exhaustive and will likely change during the POC or MVC stages_
131+
- You can find all other structs by running `make search_structs`
132+
- You can find all other protobufs by running `make search_protos`
133+
134+
**Interfaces**:
135+
136+
- A list of the interface (go interfaces, placeholder functions, grpc, etc) that will be used, added or modified in this feature
137+
- Mention or link to specific files if applicable
138+
- See [shared/modules](../../shared/modules) as a reference as they will most likely, but not necessarily, be part of that package
139+
- _TIPS:_
140+
- _This will be non-exhaustive and will likely change during the POC or MVC stages_
141+
- You can find all other structs by running `make search_interfaces`
142+
- You can find all other protobufs by running `make search_protos`
143+
144+
**Diagram**:
145+
146+
- One or more mermaid diagrams that will visualize the E2E feature
147+
- _TIPs:_
148+
- Use multiple diagrams if a single one ends up exceeding 7 or more core elements or steps
149+
- See if there’s anything in [pokt-network/pocket-network-protocol/tree/main/utility](../../utility/) or [pokt-network/pocket/tree/main/utility/doc](../../utility/doc) that you can use as a starting point
150+
151+
**User Stories as Tests**:
152+
153+
- Use natural language (long-form or bullet points) to define:
154+
- One (or more) HAPPY E2E path(s) from start to end with all the relevant details
155+
- One (or more) SAD E2E path(s) from start to end with all the relevant details
156+
- **[IMPROVE] Guiding template**: A [User | Actor | Source | etc] [performs an action] [where | when | at] [some specific context or state is guaranteed] and [the expected result is...].
157+
- **Example**: An Application requests the account balance of a specific address at a specific height when there is a Servicer staked for the Ethereum RelayChain in the same GeoZone, and receives a successful response.
158+
- _NOTE: Keep in mind that these tests will be used to:_
159+
- _Interact with our [CLI](../../app/client/cli/) and [E2E testing framework](../../e2e) but do not design it for that_
160+
- _Train ChatGPT to expand on the happy and sad E2E test cases_
161+
162+
**Blockers**:
163+
164+
- A list of other E2E feature paths (in the format `<Letter>.<Number>: <Name>`) that:
165+
- must be implemented prior to this
166+
- will be mocked or added as placeholders to unblock this work
167+
- Any other blockers, requirements or dependencies this will need and may need to be implemented as part of the feature implementation (e.g. infrastructure needs)
168+
169+
## E2E Feature Implementation
170+
171+
### POC: Proof of Concept
172+
173+
Create a single PR where you _"do everything"_ with the knowledge that it'll be closed without being merged in. This is an opportunity to get your hands dirty, understand the problem more deeply and have some fun. This PR may be split into multiple smaller PRs or just refactored altogether.
174+
175+
_TODO(example): Link to Alessandro's KISS or Bryan's P2P._
176+
177+
### MVC: Minimum Viable Change
178+
179+
This is the 🥩 (or 🥙) of the whole feature. In several PRs, you will implement, get feedback and merge in the feature to the main branch. Use your best judgment on how to split it so it's easier for the reviewer to give feedback without blocking yourself. It'll include some, or all, of the following PRs:
180+
181+
- Updates to data structures or protobufs
182+
- Updates to interfaces
183+
- The core implementation
184+
- Updates to the [CLI](../../app/client/cli/)
185+
- Updates to the [RPC](../../rpc/) service
186+
- Additions / modifications to the [E2E testing framework](../../e2e)
187+
- Additions / modifications to the documentation, code structure and diagrams
188+
189+
### PROD: Production
190+
191+
One or more follow-up GitHub issues that track follow-up work that my include, but not limited to:
192+
193+
- Increase the test coverage
194+
- Adding subsequent features
195+
- Fixing hacks
196+
- Your [imagination](https://github.com/pokt-network/pocket/assets/1892194/6aff9004-8d3b-48e8-b6d5-9b67ac266e3d)!
197+
198+
<!-- GITHUB_WIKI: utility/e2e_feature_path_template -->

0 commit comments

Comments
 (0)