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

feat: claim/proof messages, relayer, & genesis #24

Merged
merged 140 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
f39df3a
WIP: Separate client and server commands
red-0ne Sep 15, 2023
707abb5
fix: re-generation artifacts
bryanchriswhite Sep 18, 2023
b119ce3
chore: update `Proof` and `Claim` types
bryanchriswhite Sep 18, 2023
de6d5ac
chore: update SMT dep with go.mod replace
bryanchriswhite Sep 18, 2023
be3fa80
feat: implement `ServicerClient#SubmitProof()` & `#SubmitClaim()`
bryanchriswhite Sep 18, 2023
5dc911b
Merge remote-tracking branch 'pokt/main' into relayminer
bryanchriswhite Sep 18, 2023
5844282
chore: refactor relayer & new blocks WS client
red-0ne Sep 18, 2023
249f41c
refactor: relayer session type as interface
bryanchriswhite Sep 18, 2023
d7d946a
debug: newBlocks observable
bryanchriswhite Sep 18, 2023
6fefe10
feat: Add new block event constructor
red-0ne Sep 18, 2023
d5265ab
feat: Source servicer params from viper flags
red-0ne Sep 18, 2023
48c9a35
fix: Observable relying on nil channel
red-0ne Sep 18, 2023
9705345
fix: New blocks not getting reacted to
red-0ne Sep 18, 2023
d4dad85
fix: handle websocket closed error in servicer client listener
bryanchriswhite Sep 19, 2023
6967f7d
fix: update defalut websocket URL port to poktrolld (not celestia)
bryanchriswhite Sep 19, 2023
3c7b53c
fix: restructure `tendermintBlockEvent` to match
bryanchriswhite Sep 19, 2023
191d01e
chore: close servicer client websocket conn on teardown
bryanchriswhite Sep 19, 2023
c6cbabc
refactor: relayer command
bryanchriswhite Sep 19, 2023
e8666c6
WIP: proxy sign replies
red-0ne Sep 19, 2023
c027161
Merge remote-tracking branch 'pokt/relayer-with-ws' into relayminer
bryanchriswhite Sep 19, 2023
ecfa7fb
refactor: `Proxy#ServeHTTP()`
bryanchriswhite Sep 19, 2023
9d1c664
chore: add `keyring-backend` flag to relayer cmd
bryanchriswhite Sep 19, 2023
31185fd
chore: add node flag to relayer subcommand
bryanchriswhite Sep 19, 2023
37dec27
chore: add "regenesis" make target
bryanchriswhite Sep 19, 2023
f263635
chore: add mnemonics to test accounts
bryanchriswhite Sep 19, 2023
10c182f
chore: update localnet genesis
bryanchriswhite Sep 19, 2023
946633f
wip: add debug & error logging
bryanchriswhite Sep 19, 2023
a89c474
refactor: update `MsgProof#ProofBz` to `#Proof` & use protobuf type
bryanchriswhite Sep 19, 2023
8d53bd1
chore: add `Block` runtime interface assertion
bryanchriswhite Sep 19, 2023
91e80e8
chore: remove duplicate AddCommand
red-0ne Sep 19, 2023
a9bc3f2
fixup: update proof types
bryanchriswhite Sep 19, 2023
384f7a6
chore: remove unused interface type
bryanchriswhite Sep 19, 2023
d3cdef1
chore: add godoc comment
bryanchriswhite Sep 19, 2023
6e3adfe
refactor: `Proxy#ServeHTTP()`
bryanchriswhite Sep 19, 2023
0dcda55
chore: add/update TODOs
bryanchriswhite Sep 19, 2023
5cb5f09
chore: cleanup
bryanchriswhite Sep 19, 2023
b2c7a97
chore: more TODOs
bryanchriswhite Sep 19, 2023
757c8ab
chore: cleanup & add error log
bryanchriswhite Sep 19, 2023
8cb5a36
fix: github commit fail
bryanchriswhite Sep 20, 2023
2c05cfe
chore: untrack ts-client dir
bryanchriswhite Sep 20, 2023
c42fd33
Merge branch 'main' into relayminer
bryanchriswhite Sep 20, 2023
16f7a23
chore: regenerate openapi.yml (on build)
bryanchriswhite Sep 20, 2023
8c3fd44
wip: recover from panic to demo relaying
bryanchriswhite Sep 20, 2023
6b5b2ee
chore: update config.yml to include necessary actors
bryanchriswhite Sep 20, 2023
030131a
chore: `make regenesis` replaces entire poktrolld home dir contents
bryanchriswhite Sep 20, 2023
13e78f6
chore: regenesis
bryanchriswhite Sep 20, 2023
62479ce
chore: rename regenesis make target to localnet_regenesis
bryanchriswhite Sep 20, 2023
d7d444b
Revert "chore: regenesis"
bryanchriswhite Sep 20, 2023
b61002c
chore: update localnet keyring post regenesis
bryanchriswhite Sep 20, 2023
3b39a50
chore: regenesis
bryanchriswhite Sep 20, 2023
597f78f
fix: `make localnet_regenesis` should not modify configs
bryanchriswhite Sep 20, 2023
7fe742f
fix: update app addresses in make targets
bryanchriswhite Sep 20, 2023
cd20cca
fixup: use the hasher the correct way
red-0ne Sep 19, 2023
daf0127
chore: stub genesis params in config.yml
red-0ne Sep 20, 2023
67eb2e7
fixup: use smt (un)marshal for proof serialization
red-0ne Sep 20, 2023
6cf12b0
Merge pull request #26 from pokt-network/proof-serialization
red-0ne Sep 20, 2023
6d02ad7
fixup: argSum should be uint64
red-0ne Sep 20, 2023
feb5cef
refactor: websocket message handling & listen for committed claims
red-0ne Sep 21, 2023
3d00926
chore: add `EventClaimed` type to servicer module
bryanchriswhite Sep 21, 2023
c38cfac
chore: update `ServicerClient` interface
bryanchriswhite Sep 21, 2023
463e0a0
fix: initialize `committedClaims` map
bryanchriswhite Sep 21, 2023
3624d25
chore: regenerate openapi.yml
bryanchriswhite Sep 21, 2023
a761ed8
chore: refactor rename `EventClaimed#root` to `EventClaimed#smd_root_…
bryanchriswhite Sep 21, 2023
2e7f7ba
refactor: reorganize servicer client implementation across multiple f…
bryanchriswhite Sep 21, 2023
928d0d1
refactor: rename relayer/client/block.go to blocks.go
bryanchriswhite Sep 21, 2023
3bfb918
refactor: move unexported helpers below methods
bryanchriswhite Sep 21, 2023
d3ec69f
chore: add `committedClaimsMutex` to protect from concurrent reads/wr…
bryanchriswhite Sep 21, 2023
893aaab
chore: factor out smt root hash string key
bryanchriswhite Sep 21, 2023
23074c6
refactor: client block impl./usage
bryanchriswhite Sep 22, 2023
a4bd536
chore: remove unnecessary token balanes
bryanchriswhite Sep 22, 2023
e1f9203
WIP: implement websockets and claim/proof lifecycle
red-0ne Sep 23, 2023
a865cef
chore: add named return args to `ServicerClient` interface
bryanchriswhite Sep 23, 2023
f20087f
refactor: rename `servicerClient#broadcastMessageTx()` to `#signAndBr…
bryanchriswhite Sep 23, 2023
b8646b6
fix: websocket error handling
bryanchriswhite Sep 23, 2023
90983a2
fix: empty ws msg error check
bryanchriswhite Sep 23, 2023
ce0d0b9
chore: add `ServicerClient#LatestBlock()`
bryanchriswhite Sep 23, 2023
47b06cb
chore: listen for txs by hash instead of claim events
bryanchriswhite Sep 23, 2023
6a1a1f1
chore: add logs
bryanchriswhite Sep 23, 2023
00e0023
chore: cleanup
bryanchriswhite Sep 23, 2023
3fd26fc
fix: move goroutine calls to appropriate method
bryanchriswhite Sep 23, 2023
26c23b6
fix: call tx `#ValidateBasic()` method
bryanchriswhite Sep 23, 2023
8ee27ab
chore: add godoc comments
bryanchriswhite Sep 23, 2023
5c4fe0b
refactor: simplify servicer client txs err channel usage
bryanchriswhite Sep 23, 2023
a2862b7
Merge branch 'ws-relay-tree-mgmt' into fix/servicer-client-txs
bryanchriswhite Sep 24, 2023
9761013
fix: interrupt signal not exiting
bryanchriswhite Sep 24, 2023
b5d5887
fix: rename post-merge
bryanchriswhite Sep 24, 2023
22ab472
fix: post-merge
bryanchriswhite Sep 24, 2023
99e4947
fix: app2 & app3 addresses in make targets
bryanchriswhite Sep 25, 2023
f1de953
chore: validate endpoint URLs on servicer staking
bryanchriswhite Sep 25, 2023
5aca45d
refactor: working http proxy
red-0ne Sep 25, 2023
17fb277
chore: add comment, log, lower-case tx hash consistently, & add `come…
bryanchriswhite Sep 25, 2023
78603f4
fix: block until latestBlock is initially populated
red-0ne Sep 25, 2023
5529083
feat: add GetSessionEndHeight method to Session
red-0ne Sep 25, 2023
3aadba4
refactor: sessionmanager's session cleanup
red-0ne Sep 25, 2023
b7a059f
feat: store claim on-chain
bryanchriswhite Sep 25, 2023
69502de
feat: generate claims query & persist claims in `MsgClaim` handler
bryanchriswhite Sep 25, 2023
a7321e6
chore: rename proof & claim msg `smstRootHash` fields
bryanchriswhite Sep 25, 2023
69c2fbb
fix: some proto field names to conform to convention
bryanchriswhite Sep 25, 2023
be84c79
chore: add TODOs for `MsgClaim` handling validation
bryanchriswhite Sep 25, 2023
4ac4001
refactro: rename `servicerClient` local var
bryanchriswhite Sep 25, 2023
4ba4ce9
chore: break observable subscription loops on context cancellation
bryanchriswhite Sep 25, 2023
31da353
chore: use http request context
bryanchriswhite Sep 25, 2023
fcbaae7
chore: remove redundant error logs
bryanchriswhite Sep 25, 2023
d47c8da
chore: tidy up after review
bryanchriswhite Sep 25, 2023
872b133
Merge pull request #28 from pokt-network/fix/servicer-client-txs
bryanchriswhite Sep 25, 2023
712bf46
fixup: rename missing MsgClaim ServicerAddress references
red-0ne Sep 25, 2023
a3fbd96
chore: add comment
bryanchriswhite Sep 26, 2023
57f7c51
refactor: rename events.proto to event.proto & its `smt_root_hash` fi…
bryanchriswhite Sep 26, 2023
b99a47b
refactor: `EventClaim` usage
bryanchriswhite Sep 26, 2023
4c032bb
refactor: rename `sessionWithTree#removeFromSessionMap` to `#onDelete`
bryanchriswhite Sep 26, 2023
e7586eb
refactor: rename `MsgProof#Sum` to `#SmstSum`
bryanchriswhite Sep 26, 2023
855d2c4
chore: add `MsgClaim#ExpirationHeight` & comment
bryanchriswhite Sep 26, 2023
13d8267
chore: cleanup imports & aliases
bryanchriswhite Sep 26, 2023
8e67f78
refactor: move `WaitGroupContextKey` into client pkg
bryanchriswhite Sep 26, 2023
5313afc
refactor: move ServicerClient interface to relayer pkg
bryanchriswhite Sep 26, 2023
c769173
refactor: rename `ServicerClient#Blocks()` to `#BlocksNotifee()`
bryanchriswhite Sep 26, 2023
fffe75b
chore: add comments
bryanchriswhite Sep 26, 2023
c00daf7
chore: remove unused blocks-per-session flag
bryanchriswhite Sep 26, 2023
89db148
chore: add comments
bryanchriswhite Sep 26, 2023
a9c5fc3
feat: stub out on-chain proof verification & msg handling
bryanchriswhite Sep 26, 2023
6516f68
refactor: simplify claim keys & claims query pagination filter
bryanchriswhite Sep 26, 2023
bb01047
chore: add incomplete comment
bryanchriswhite Sep 26, 2023
731afe0
chore: add `SessionWithTree#GetSessionId()`
bryanchriswhite Sep 26, 2023
6c31aa5
fix: include session ID in claim msg
bryanchriswhite Sep 26, 2023
42e3a92
chore: add TODO comment
bryanchriswhite Sep 26, 2023
8f02bc9
chore: protect session writes with mutexs
red-0ne Sep 26, 2023
805c3de
Merge pull request #32 from pokt-network/relay-sockets
red-0ne Sep 26, 2023
f7afa36
Added TODO in relay.proto
Olshansk Sep 26, 2023
e0c7de7
fixup: remove useless mutex
red-0ne Sep 27, 2023
f069034
Added helpers from the PR description to the Makefile
Olshansk Sep 26, 2023
52f022a
Minor nits and TODOs
Olshansk Sep 27, 2023
4406c32
s/handleBlocksFactory/blocksFactorHandler
Olshansk Sep 27, 2023
b039f9f
s/handleTxsFactory/txsFactoryHandler
Olshansk Sep 27, 2023
a1f9877
Finished reviewing relayer/client subdirectory
Olshansk Sep 27, 2023
89bd295
Reviewed relayer/miner/miner.go
Olshansk Sep 27, 2023
d944ee8
s/signResponse/signResponseFn
Olshansk Sep 27, 2023
68e6883
Trying to get things working
Olshansk Sep 27, 2023
aad716d
Autoformat
Olshansk Sep 27, 2023
43687b6
Remove fallthrough
Olshansk Sep 27, 2023
1e7105f
update claims_query
Olshansk Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,9 @@ ignite_regenerate: ## Regenerate the ignite boilerplate
.PHONY: ignite_acc_list
ignite_acc_list: ## List all the accounts in the ignite boilerplate
ignite account list --keyring-dir $(POKTROLLD_HOME) --keyring-backend test

.PHONY: regenesis
regenesis:
# NOTE: intentionally not using --home <dir> flag to avoid overwriting the test keyring
Copy link
Member

Choose a reason for hiding this comment

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

Consider using --home=$(POKTROLLD_HOME) like we do in other places

ignite chain init --skip-proto
cp ${HOME}/.poktroll/config/*.json ./localnet/poktrolld/config/
2 changes: 2 additions & 0 deletions cmd/poktrolld/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (

"poktroll/app"
appparams "poktroll/app/params"
relayer "poktroll/relayer/cmd"
)

// NewRootCmd creates a new root command for a Cosmos SDK application
Expand Down Expand Up @@ -120,6 +121,7 @@ func initRootCmd(
),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
AddGenesisAccountCmd(app.DefaultNodeHome),
relayer.RelayerCmd(),
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
bryanchriswhite marked this conversation as resolved.
Show resolved Hide resolved
tmcli.NewCompletionCmd(rootCmd, true),
debug.Cmd(),
config.Cmd(),
Expand Down
2 changes: 2 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
version: 1
accounts:
- name: alice
mnemonic: "cable surround lemon legend river dizzy seek you camera concert orient nest sponsor process junk hub melt bar puzzle invite portion machine when strategy"
Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Sep 19, 2023

Choose a reason for hiding this comment

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

Adding mnemonics to the config.yml (see: ignite docs) so that localnet clients have a funded genesis account (run ignite chain init locally).

coins:
- 20000token
- 200000000stake
- name: bob
mnemonic: "visa test air predict head shoot mad syrup own craft mail spare better remember leg produce noodle humble glad social neck prize breeze fat"
coins:
- 10000token
- 100000000stake
Expand Down
4 changes: 4 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75954,6 +75954,10 @@ definitions:
description: params holds all the parameters of this module.
type: object
description: QueryParamsResponse is response type for the Query/Params RPC method.
poktroll.servicer.MsgClaimResponse:
type: object
poktroll.servicer.MsgProofResponse:
type: object
poktroll.servicer.MsgStakeServicerResponse:
type: object
poktroll.servicer.MsgUnstakeServicerResponse:
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ require (
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
github.com/pokt-network/smt v0.6.2-0.20230906162127-ef2341c474a0
github.com/pokt-network/smt v0.6.1
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -117,7 +118,6 @@ require (
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/rpc v1.2.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
Expand Down Expand Up @@ -275,3 +275,5 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021
replace github.com/cosmos/cosmos-sdk => github.com/rollkit/cosmos-sdk v0.47.3-rollkit-v0.10.2-no-fraud-proofs

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

replace github.com/pokt-network/smt => github.com/pokt-network/smt v0.6.2-0.20230918075555-6a633085c3da
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pokt-network/smt v0.6.2-0.20230906162127-ef2341c474a0 h1:EFkH0qu/MrmDgz0i9FiHRFTGQAx6fkqlYRnlg7NgKpY=
github.com/pokt-network/smt v0.6.2-0.20230906162127-ef2341c474a0/go.mod h1:IhNcYL5XOHTfagy8GBKM23Xhd2uvhgbTtsGSMQtCxR8=
github.com/pokt-network/smt v0.6.2-0.20230918075555-6a633085c3da h1:xPBVU+jMoeWWNq+SQz3dt9yL/uVOs09bQubpE22QUhc=
github.com/pokt-network/smt v0.6.2-0.20230918075555-6a633085c3da/go.mod h1:IhNcYL5XOHTfagy8GBKM23Xhd2uvhgbTtsGSMQtCxR8=
github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw=
github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA=
Expand Down
1 change: 1 addition & 0 deletions localnet/.poktrolld/config/client.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
keyring-backend = "test"
bryanchriswhite marked this conversation as resolved.
Show resolved Hide resolved
Loading