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

[E2E relay test] Update to #178 #184

Merged
merged 156 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
29b9bdf
refactor: `MapFn`s receive context arg
bryanchriswhite Nov 9, 2023
b6c9c71
chore: add `ForEach` map shorthand operator
bryanchriswhite Nov 9, 2023
f257b46
chore: add `/pkg/observable/filter`
bryanchriswhite Nov 9, 2023
194cee5
chore: add `/pkg/observable/logging`
bryanchriswhite Nov 9, 2023
cca55c2
chore: add `/pkg/relayer/protocol`
bryanchriswhite Nov 9, 2023
c666542
chore: add `Miner` interface
bryanchriswhite Nov 9, 2023
ea8d848
feat: add `Miner` implementation
bryanchriswhite Nov 9, 2023
38329bb
test: `Miner` implementation
bryanchriswhite Nov 9, 2023
d2f9cb4
chore: fix comment
bryanchriswhite Nov 9, 2023
d502b75
chore: add godoc comments
bryanchriswhite Nov 9, 2023
48cef80
feat: Add Relayer struct
red-0ne Nov 9, 2023
f85a381
Merge remote-tracking branch 'pokt/main' into issues/13/feat/miner
bryanchriswhite Nov 9, 2023
cba145e
chore: Rename to RelayMiner
red-0ne Nov 9, 2023
c81c274
chore: Rename relay miner file
red-0ne Nov 9, 2023
0e38e7d
chore: Remove unused
red-0ne Nov 9, 2023
f9e1cbc
[Test] First step for automated E2E Relay test (#167)
Olshansk Nov 9, 2023
0e72490
[Relayer] refactor: simplify `RelayerSessionsManager` (#169)
bryanchriswhite Nov 9, 2023
107f6dd
chore: review feedback improvements
bryanchriswhite Nov 9, 2023
ccad087
chore: review feedback improvements
bryanchriswhite Nov 9, 2023
8737024
Merge remote-tracking branch 'pokt/main' into issues/13/feat/miner
bryanchriswhite Nov 9, 2023
e041472
chore: update start mining comment
red-0ne Nov 9, 2023
8cf0784
fix: Update Miner interface
red-0ne Nov 9, 2023
85a49b7
fix: import cycle & goimports
bryanchriswhite Nov 9, 2023
0788e1d
chore: review feedback improvements
bryanchriswhite Nov 9, 2023
e6a558b
chore: cleanup TODO_THIS_COMMIT comments
bryanchriswhite Nov 9, 2023
d04ea2a
Merge branch 'main' into issues/13/feat/miner
bryanchriswhite Nov 9, 2023
9c75b2c
chore: improve var & func names for clarity and consistency
bryanchriswhite Nov 10, 2023
286e1b2
Merge remote-tracking branch 'pokt/main' into issues/13/feat/miner
bryanchriswhite Nov 10, 2023
a0ffe9d
refactor: move claim/proof lifecycle concerns to `relayerSessionsMana…
bryanchriswhite Nov 10, 2023
2019637
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
709f661
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
394575b
refactor: `miner#hash()` method
bryanchriswhite Nov 10, 2023
1eae9d2
chore: tidy up
bryanchriswhite Nov 10, 2023
efb8a4e
chore: simplify
bryanchriswhite Nov 10, 2023
b38aa81
wip: relayer CLI
bryanchriswhite Nov 10, 2023
c1be2b5
chore: finish first pass
bryanchriswhite Nov 10, 2023
3b2022a
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
967dddc
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
f9a6fb2
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
7d23bd4
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
916c0dd
chore: review feedback improvements
bryanchriswhite Nov 10, 2023
04a79b2
chore: tidy up cmd creation
h5law Nov 10, 2023
55c8118
fix: incomplete refactor
bryanchriswhite Nov 10, 2023
c1784f5
chore: simplify
bryanchriswhite Nov 10, 2023
92925eb
Merge branch 'issues/13/feat/miner' into relayer/cli
bryanchriswhite Nov 10, 2023
0bfdc80
chore: add log lines
h5law Nov 10, 2023
c49394e
Merge remote-tracking branch 'pokt/relayer/cli' into relayer/cli
bryanchriswhite Nov 10, 2023
9efde4f
wip: react to miner, refactor, construct miner, refactor
bryanchriswhite Nov 10, 2023
3de8b3e
chore: cleanup
bryanchriswhite Nov 10, 2023
323b074
Merge remote-tracking branch 'origin/issues/13/feat/miner' into feat/…
red-0ne Nov 10, 2023
059b7df
chore: Reflect responsibility changes of session manager
red-0ne Nov 10, 2023
6460fa9
Merge remote-tracking branch 'origin/main' into feat/relayer
red-0ne Nov 10, 2023
9dfe585
Merge branch 'feat/relayer' into relayer/cli
red-0ne Nov 10, 2023
5f9bd5f
feat: Use relay miner to start
red-0ne Nov 10, 2023
0c4e353
[WIP] Updating relay.feature to run curl command
Olshansk Nov 10, 2023
1dcdbbe
chore: Improve comment about startig relayer proxy
red-0ne Nov 10, 2023
da46de7
wip: debugging
bryanchriswhite Nov 10, 2023
6835ce9
Merge remote-tracking branch 'origin/main' into relayer/cli
red-0ne Nov 10, 2023
4f9a74f
Continued implementation but still failing
Olshansk Nov 10, 2023
cc05bac
Getting an invalid request right now but figuring it out...
Olshansk Nov 10, 2023
f074f97
Merge branch 'main' into e2e_test/relay
Olshansk Nov 10, 2023
51bccfe
Merge remote-tracking branch 'origin/main' into relayer/cli
red-0ne Nov 10, 2023
47d8685
wip: debugging
bryanchriswhite Nov 11, 2023
a69b5f3
Merge remote-tracking branch 'pokt/relayer/cli' into relayer/cli
bryanchriswhite Nov 11, 2023
34e52f7
Added service and switched to AppGate
Olshansk Nov 11, 2023
beb0757
wip: debugging
bryanchriswhite Nov 11, 2023
ec1910f
chore: Rename falg variables
red-0ne Nov 11, 2023
ded793f
wip: debugging
bryanchriswhite Nov 11, 2023
9ba2dc1
Merge remote-tracking branch 'origin/relayer/cli' into relayer/cli
red-0ne Nov 11, 2023
bf936e6
revertme: disable tilt relayer service
bryanchriswhite Nov 11, 2023
c96e5c5
Merge remote-tracking branch 'origin/relayer/cli' into relayer/cli
red-0ne Nov 11, 2023
0d9edb9
chore: use arg not flag
h5law Nov 11, 2023
5c5eace
chore: rename command
red-0ne Nov 11, 2023
ee397d3
Debugging checkpoint
Olshansk Nov 11, 2023
a3a3635
wip: debugging - improvments
bryanchriswhite Nov 11, 2023
641d60a
Merge remote-tracking branch 'pokt/relayer/cli' into relayer/cli
bryanchriswhite Nov 11, 2023
71052b7
wip: debugging
bryanchriswhite Nov 11, 2023
fa8c2eb
wip: debugging
bryanchriswhite Nov 11, 2023
0638e8d
wip: debugging
bryanchriswhite Nov 11, 2023
bb87722
revert-or-fixme: add error log lines
bryanchriswhite Nov 12, 2023
bcfbef1
revert-or-fixme: add debug log lines
bryanchriswhite Nov 12, 2023
4019a17
fix: set relay server handle function
bryanchriswhite Nov 12, 2023
9c3cfb5
revert-or-fixme: add debug log lines
bryanchriswhite Nov 12, 2023
2c130ce
chore: rename some chan vars
bryanchriswhite Nov 12, 2023
8493b2c
feat: fix all bugs, e2e relay works
h5law Nov 12, 2023
c85f75b
Merge branch 'refactor_appgate' into relayer/cli
h5law Nov 12, 2023
dfd28f8
chore: add some todo comments
h5law Nov 12, 2023
5ab0e4c
wip: debugging
bryanchriswhite Nov 12, 2023
ff4997a
fix: use remote helm charts again
bryanchriswhite Nov 13, 2023
ac54c24
fix: put adequate proxied services endpoitns, prevent session republi…
red-0ne Nov 13, 2023
efc2ab5
chore: Refactor JSONRPCServer and server builder
red-0ne Nov 13, 2023
9c32675
Upate a couple small comments in the maketfile
Olshansk Nov 14, 2023
17597c4
revert: comment relayers out of tiltfile
bryanchriswhite Nov 14, 2023
23ac551
chore: fix subcmd name `relayerminer` -> `relayminer`
bryanchriswhite Nov 14, 2023
e13211e
chore: improve logging
bryanchriswhite Nov 14, 2023
cf5910f
chore: cleanup error messaging & logging in appgate server
bryanchriswhite Nov 14, 2023
eb56997
refactor: rename misnamed `jsonRPCServer` receiver var
bryanchriswhite Nov 14, 2023
5e60381
chore: remove appgate server debug log
bryanchriswhite Nov 14, 2023
0bd05ae
chore: unexport `relayMiner` struct
bryanchriswhite Nov 14, 2023
a031b92
refactor: interrupt signal handling
bryanchriswhite Nov 14, 2023
c05ba2b
chore: improve comments
bryanchriswhite Nov 14, 2023
aeb4ee8
chore: improve comments
bryanchriswhite Nov 14, 2023
6648a38
revert: tiltfile hot-reload dirs
bryanchriswhite Nov 14, 2023
e5a4d73
refactor: re-consolidate client contexts
bryanchriswhite Nov 14, 2023
95fc559
fix: typo
bryanchriswhite Nov 14, 2023
c3898e0
chore: remove todo
bryanchriswhite Nov 14, 2023
c61abaf
chore: add todo comment
bryanchriswhite Nov 14, 2023
839a3dc
revert: comment change
bryanchriswhite Nov 14, 2023
ff8fc6a
fix: error format strings
bryanchriswhite Nov 14, 2023
66bfba5
chore: remove comment
bryanchriswhite Nov 14, 2023
15948a8
Merge branch 'main' into relayer/cli
bryanchriswhite Nov 14, 2023
95a6dc9
fix: error format strings
bryanchriswhite Nov 14, 2023
890370d
Merge remote-tracking branch 'pokt/main' into wip/e2e_test/relay
bryanchriswhite Nov 14, 2023
9cfd8ff
Merge branch 'relayer/cli' into wip/e2e_test/relay
bryanchriswhite Nov 14, 2023
65ff2e4
chore: add `-features-path` flag to cucumber tests
bryanchriswhite Nov 14, 2023
5ec4514
fix: set the relayminer URL in the curl cmd
bryanchriswhite Nov 14, 2023
1160c0a
chore: remove redundant `-X` curl arg (says curl)
bryanchriswhite Nov 14, 2023
b7a66de
squash: fix relayminer url: reword: s/relayminer/appgateserver/
bryanchriswhite Nov 14, 2023
49ba416
chore: improve error messaging
bryanchriswhite Nov 14, 2023
7e400e4
fix: curl invocation
bryanchriswhite Nov 14, 2023
b52f046
test: implement step definition to assert agains relay response
bryanchriswhite Nov 14, 2023
7bc6a26
chore: improve error name & messaging
bryanchriswhite Nov 14, 2023
9d86294
Merge branch 'main' into e2e_test/relay
Olshansk Nov 14, 2023
700fd06
Self review
Olshansk Nov 14, 2023
3887759
Merge branch 'e2e_test/relay' into e2e_test/relay-update
bryanchriswhite Nov 15, 2023
122bec0
fixup: merge upstream
bryanchriswhite Nov 15, 2023
8c1f5b9
chore: review feedback improvements
bryanchriswhite Nov 15, 2023
5bfe151
chore: update anvil service port in make targets
bryanchriswhite Nov 15, 2023
86255b3
chore: review feedback improvements
bryanchriswhite Nov 15, 2023
0aaddc8
refactor: relayminer depinject helpers & godoc comments on all constr…
bryanchriswhite Nov 15, 2023
6ad6abe
refactor: separate tx and query client contexts 🙄
bryanchriswhite Nov 15, 2023
88e046d
fix: sessiontree store path check
bryanchriswhite Nov 15, 2023
9b83691
fix: sessiontree store path check
bryanchriswhite Nov 15, 2023
c865eb0
chore: review feedback improvements
bryanchriswhite Nov 15, 2023
fe9db58
chore: review feedback improvements
bryanchriswhite Nov 15, 2023
8d7e577
chore: add long command description
bryanchriswhite Nov 15, 2023
f945513
fix: supplier client test
bryanchriswhite Nov 15, 2023
0a53626
Merge branch 'main' into relayer/cli
bryanchriswhite Nov 15, 2023
3a178b2
Merge branch 'relayer/cli' into merge/e2e_test/relay_x_relayer_cli
bryanchriswhite Nov 15, 2023
98a1854
Merge branch 'merge/e2e_test/relay_x_relayer_cli' into e2e_test/relay…
bryanchriswhite Nov 15, 2023
4ce831b
chore: cleanup flags and dependencies for appgateserver cmd
h5law Nov 15, 2023
d83c1e7
chore: move shared dependency setup logic to shared pkg
h5law Nov 15, 2023
e58c848
chore: update comment
h5law Nov 15, 2023
75343bb
Update .gitignore
Olshansk Nov 15, 2023
1cc7085
Update OpenAPI spec
Olshansk Nov 15, 2023
a04ebfc
Updated comments for post 177+179 work for okdas
Olshansk Nov 15, 2023
59f863c
Update pkg/relayer/cmd/cmd.go
Olshansk Nov 15, 2023
753c27a
Update the names and references to queryNode/sequencerNode/fullNode etc
Olshansk Nov 15, 2023
966b874
Update some comments and TODOs
Olshansk Nov 15, 2023
c726dfc
Added a couple more comments
Olshansk Nov 15, 2023
b9c0d62
Merge with main
Olshansk Nov 15, 2023
c36db92
More tiny comment updates
Olshansk Nov 15, 2023
b885583
Merge branch 'relayer/cli' into merge/e2e_test/relay_x_relayer_cli
bryanchriswhite Nov 16, 2023
09de036
Merge remote-tracking branch 'pokt/main' into merge/e2e_test/relay_x_…
bryanchriswhite Nov 16, 2023
0498318
Merge branch 'merge/e2e_test/relay_x_relayer_cli' into e2e_test/relay…
bryanchriswhite Nov 16, 2023
27ddcff
chore: review feedback improvements
bryanchriswhite Nov 16, 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
Prev Previous commit
Next Next commit
[Test] First step for automated E2E Relay test (#167)
- Fixed helpers for localnet regenesis
- Added an application & supplier to the genesis file
- Initializing appMap & supplierMap in E2E tests
- Add support for the app's codec (for unmarshaling responses) in E2E tests
- Adding a placeholder for `e2e/tests/relay.feature`

---

Co-authored-by: harry <53987565+h5law@users.noreply.github.com>
2 people authored and bryanchriswhite committed Nov 9, 2023
commit f9e1cbc5b4a11c4e622d62bc9a30b74529b6898d
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -114,9 +114,9 @@ localnet_regenesis: ## Regenerate the localnet genesis file
# NOTE: intentionally not using --home <dir> flag to avoid overwriting the test keyring
ignite chain init
mkdir -p $(POKTROLLD_HOME)/config/
cp -r ${HOME}/.pocket/keyring-test $(POKTROLLD_HOME)
cp ${HOME}/.pocket/config/*_key.json $(POKTROLLD_HOME)/config/
cp ${HOME}/.pocket/config/genesis.json $(POKTROLLD_HOME)/config/
cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME)
cp ${HOME}/.poktroll/config/*_key.json $(POKTROLLD_HOME)/config/
cp ${HOME}/.poktroll/config/genesis.json $(POKTROLLD_HOME)/config/

###############
### Linting ###
@@ -135,7 +135,9 @@ go_imports: check_go_version ## Run goimports on all go files

.PHONY: test_e2e
test_e2e: ## Run all E2E tests
export POCKET_NODE=$(POCKET_NODE) POKTROLLD_HOME=../../$(POKTROLLD_HOME) && go test -v ./e2e/tests/... -tags=e2e
export POCKET_NODE=$(POCKET_NODE) && \
POKTROLLD_HOME=../../$(POKTROLLD_HOME) && \
go test -v ./e2e/tests/... -tags=e2e

.PHONY: go_test
go_test: check_go_version ## Run all go tests
@@ -392,7 +394,7 @@ supplier3_unstake: ## Unstake supplier3

.PHONY: get_session
get_session: ## Retrieve the session given the following env vars: (APP_ADDR, SVC, HEIGHT)
pocketd --home=$(POCKETD_HOME) q session get-session $(APP) $(SVC) $(HEIGHT) --node $(POCKET_NODE)
poktrolld --home=$(POKTROLLD_HOME) q session get-session $(APP) $(SVC) $(HEIGHT) --node $(POCKET_NODE)

.PHONY: get_session_app1_anvil
get_session_app1_anvil: ## Retrieve the session for (app1, anvil, latest_height)
73 changes: 24 additions & 49 deletions config.yml
Original file line number Diff line number Diff line change
@@ -81,52 +81,27 @@ genesis:
- amount: "10000"
denom: upokt
application:
params:
maxDelegatedGateways: 7
applicationList:
- address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4
stake:
amount: "1000"
denom: upokt
# TODO(@Olshansk): Update genesis to include services
# services:
# - id: svc1
# name: TODO
# - id: svc2
# name: TODO
# params: {}
# TODO(@Olshansk): Update genesis to include suppliers
# supplier:
# params: {}
# suppliersList:
# - address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
# services:
# - endpoints:
# - configs:
# - key: TIMEOUT
# value: 30s
# metadata:
# entries: {}
# rpc_type: WEBSOCKET
# url: ws://localhost:8546/
# id:
# id: svc1
# name: Pocket Network Service 1
# metadata:
# entries: {}
# - endpoints:
# - configs:
# - key: TIMEOUT
# value: 60s
# metadata:
# entries: {}
# rpc_type: JSON_RPC
# url: http://localhost:8545
# id:
# id: svc2
# name: Pocket Network Service 2
# metadata:
# entries: {}
# stake:
# amount: "1000000"
# denom: upokt
applicationList:
- address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4
delegatee_gateway_addresses: []
service_configs:
- service:
id: anvil
name: ""
stake:
amount: "1000"
denom: upokt
supplier:
supplierList:
- address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
services:
- endpoints:
- configs: []
rpc_type: JSON_RPC
url: http://anvil:8547
service:
id: anvil
name: ""
stake:
amount: "1000"
denom: upokt
126 changes: 122 additions & 4 deletions e2e/tests/init_test.go
Original file line number Diff line number Diff line change
@@ -10,15 +10,28 @@ import (
"testing"
"time"

tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/regen-network/gocuke"
"github.com/stretchr/testify/require"

"github.com/pokt-network/poktroll/app"
apptypes "github.com/pokt-network/poktroll/x/application/types"
sessiontypes "github.com/pokt-network/poktroll/x/session/types"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
suppliertypes "github.com/pokt-network/poktroll/x/supplier/types"
)

var (
addrRe *regexp.Regexp
amountRe *regexp.Regexp
accNameToAddrMap = make(map[string]string)
keyRingFlag = "--keyring-backend=test"
addrRe *regexp.Regexp
amountRe *regexp.Regexp

accNameToAddrMap = make(map[string]string)
accAddrToNameMap = make(map[string]string)
accNameToAppMap = make(map[string]apptypes.Application)
accNameToSupplierMap = make(map[string]sharedtypes.Supplier)

keyRingFlag = "--keyring-backend=test"
)

func init() {
@@ -30,12 +43,16 @@ type suite struct {
gocuke.TestingT
pocketd *pocketdBin
scenarioState map[string]any // temporary state for each scenario
cdc codec.Codec
}

func (s *suite) Before() {
s.pocketd = new(pocketdBin)
s.scenarioState = make(map[string]any)
s.cdc = app.MakeEncodingConfig().Marshaler
s.buildAddrMap()
s.buildAppMap()
s.buildSupplierMap()
}

// TestFeatures runs the e2e tests specified in any .features files in this directory
@@ -175,6 +192,64 @@ func (s *suite) TheForAccountIsStakedWithUpokt(actorType, accName string, amount
}
}

func (s *suite) TheApplicationIsStakedForService(appName string, serviceId string) {
for _, serviceConfig := range accNameToAppMap[appName].ServiceConfigs {
if serviceConfig.Service.Id == serviceId {
return
}
}
s.Fatalf("application %s is not staked for service %s", appName, serviceId)
}

func (s *suite) TheSupplierIsStakedForService(supplierName string, serviceId string) {
for _, serviceConfig := range accNameToSupplierMap[supplierName].Services {
if serviceConfig.Service.Id == serviceId {
return
}
}
s.Fatalf("supplier %s is not staked for service %s", supplierName, serviceId)
}

func (s *suite) TheSessionForApplicationAndServiceContainsTheSupplier(appName string, serviceId string, supplierName string) {
app, found := accNameToAppMap[appName]
if !found {
s.Fatalf("application %s not found", appName)
}
expectedSupplier, found := accNameToSupplierMap[supplierName]
if !found {
s.Fatalf("supplier %s not found", supplierName)
}
argsAndFlags := []string{
"query",
"session",
"get-session",
app.Address,
serviceId,
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
}
res, err := s.pocketd.RunCommandOnHost("", argsAndFlags...)
if err != nil {
s.Fatalf("error getting session for app %s and service %s: %s", appName, serviceId, err)
}
var resp sessiontypes.QueryGetSessionResponse
responseBz := []byte(strings.TrimSpace(res.Stdout))
s.cdc.MustUnmarshalJSON(responseBz, &resp)
for _, supplier := range resp.Session.Suppliers {
if supplier.Address == expectedSupplier.Address {
return
}
}
s.Fatalf("session for app %s and service %s does not contain supplier %s", appName, serviceId, supplierName)
}

func (s *suite) TheApplicationSendsTheSupplierARelayRequestForService(appName string, supplierName string, requestName string, serviceId string) {
// TODO(#126, @Olshansk): Implement this step
}

func (s *suite) TheApplicationReceivesASuccessfulRelayResponseSignedBy(appName string, supplierName string) {
// TODO(#126, @Olshansk): Implement this step
}

func (s *suite) getStakedAmount(actorType, accName string) (bool, int) {
s.Helper()
args := []string{
@@ -216,6 +291,49 @@ func (s *suite) buildAddrMap() {
name := match[2]
address := match[1]
accNameToAddrMap[name] = address
accAddrToNameMap[address] = name
}
}

func (s *suite) buildAppMap() {
s.Helper()
argsAndFlags := []string{
"query",
"application",
"list-application",
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
}
res, err := s.pocketd.RunCommandOnHost("", argsAndFlags...)
if err != nil {
s.Fatalf("error getting application list: %s", err)
}
s.pocketd.result = res
var resp apptypes.QueryAllApplicationResponse
responseBz := []byte(strings.TrimSpace(res.Stdout))
s.cdc.MustUnmarshalJSON(responseBz, &resp)
for _, app := range resp.Application {
accNameToAppMap[accAddrToNameMap[app.Address]] = app
}
}

func (s *suite) buildSupplierMap() {
s.Helper()
argsAndFlags := []string{
"query",
"supplier",
"list-supplier",
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
}
res, err := s.pocketd.RunCommandOnHost("", argsAndFlags...)
if err != nil {
s.Fatalf("error getting supplier list: %s", err)
}
s.pocketd.result = res
var resp suppliertypes.QueryAllSupplierResponse
responseBz := []byte(strings.TrimSpace(res.Stdout))
s.cdc.MustUnmarshalJSON(responseBz, &resp)
for _, supplier := range resp.Supplier {
accNameToSupplierMap[accAddrToNameMap[supplier.Address]] = supplier
}
}

4 changes: 3 additions & 1 deletion e2e/tests/node.go
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ import (
"strings"
)

// TODO_TECHDEBT(https://github.com/ignite/cli/issues/3737): We're using a combination
// of `pocketd` (legacy) and `poktrolld` (current) because of an issue of how ignite works.
var (
// defaultRPCURL used by pocketdBin to run remote commands
defaultRPCURL = os.Getenv("POCKET_NODE")
@@ -26,7 +28,7 @@ func init() {
defaultRPCURL = fmt.Sprintf("tcp://%s:%d", defaultRPCHost, defaultRPCPort)
}
if defaultHome == "" {
defaultHome = "../../localnet/pocketd"
defaultHome = "../../localnet/poktrolld"
}
}

19 changes: 19 additions & 0 deletions e2e/tests/relay.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Feature: Relay Namespace

Scenario: App can send relay to Supplier
Given the user has the pocketd binary installed
And the application "app1" is staked for service "anvil"
And the supplier "supplier1" is staked for service "anvil"
And the session for application "app1" and service "anvil" contains the supplier "supplier1"
When the application "app1" sends the supplier "supplier1" a "getBlock" relay request for service "anvil"
Then the application "app1" receives a successful relay response signed by "supplier1"

# TODO_TEST(@Olshansk):
# - Successful relay if using a gateway to proxy the relay
# - Succeedful relays when using multiple suppliers for app in some session
# - Successful deduction of app's balance after claim & proof lifecycle (requires querying claims, proofs, session start/end)
# - Successful inflatino of supplier's balance after claim & proof lifecycle (requires querying claims, proofs, session start/end)
# - Error if app1 is not staked for svc1 but relay is sent
# - Error if supplier is not staked for svc1 but relay is sent
# - Error if claiming the session too early
# - Error if proving the session too early
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ require (
cosmossdk.io/math v1.0.1
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.1.0
@@ -29,7 +28,6 @@ require (
go.uber.org/multierr v1.11.0
golang.org/x/crypto v0.12.0
golang.org/x/sync v0.3.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.56.1
gopkg.in/yaml.v2 v2.4.0
)
@@ -73,6 +71,7 @@ require (
github.com/containerd/cgroups v1.1.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.20.0 // indirect
@@ -268,6 +267,7 @@ require (
gonum.org/v1/gonum v0.11.0 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
2 changes: 1 addition & 1 deletion x/session/client/cli/query_get_session.go
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ func CmdGetSession() *cobra.Command {
This is a query operation that will not result in a state transition but simply gives a view into the chain state.

Example:
$ pocketd --home=$(POCKETD_HOME) q session get-session pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 svc1 42 --node $(POCKET_NODE)`,
$ poktrolld --home=$(POKTROLLD_HOME) q session get-session pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 svc1 42 --node $(POCKET_NODE)`,
Args: cobra.RangeArgs(2, 3),
RunE: func(cmd *cobra.Command, args []string) (err error) {
appAddressString := args[0]
2 changes: 1 addition & 1 deletion x/session/keeper/session_hydrator_test.go
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ func TestSession_HydrateSession_Metadata(t *testing.T) {
},
{
desc: "blockHeight > contextHeight",
blockHeight: 9001, // block height over 9000 is too height given that the context height is 100
blockHeight: 9001, // block height over 9000 is too high given that the context height is 100

errExpected: types.ErrSessionHydration,
},