Skip to content

Commit

Permalink
Checkpoint - uncomitted changes from friday
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Jan 20, 2025
1 parent c274e52 commit 7ec7084
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 36 deletions.
7 changes: 4 additions & 3 deletions api/poktroll/application/types.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions api/poktroll/shared/supplier.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion e2e/tests/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,11 @@ func (s *suite) getSupplierInfo(supplierOperatorName string) *sharedtypes.Suppli
supplierOperatorAddr,
"--output=json",
}

fmt.Println("OLSH1")
res, err := s.pocketd.RunCommandOnHostWithRetry("", numQueryRetries, args...)
require.NoError(s, err, "error getting supplier %s", supplierOperatorAddr)
s.pocketd.result = res
fmt.Println("OLSH2")

var resp suppliertypes.QueryGetSupplierResponse
responseBz := []byte(strings.TrimSpace(res.Stdout))
Expand Down
14 changes: 7 additions & 7 deletions e2e/tests/stake_supplier.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Feature: Stake Supplier Namespace
And the "supplier" for account "supplier2" is staked with "1000070" uPOKT
And an account exists for "supplier2"
When the user unstakes a "supplier" from the account "supplier2"
Then the user should be able to see standard output containing "txhash:"
And the user should be able to see standard output containing "code: 0"
And the pocketd binary should exit without error
# Then the user should be able to see standard output containing "txhash:"
# And the user should be able to see standard output containing "code: 0"
# And the pocketd binary should exit without error
And the supplier for account "supplier2" is unbonding
And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast
And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast
And the user verifies the "supplier" for account "supplier2" is not staked
And the account balance of "supplier2" should be "1000070" uPOKT "more" than before
# And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast
# And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast
# And the user verifies the "supplier" for account "supplier2" is not staked
# And the account balance of "supplier2" should be "1000070" uPOKT "more" than before

# TODO_MAINNET(@olshansk, #1033): Since the "to become active for service" step
# requires reading "ServicesActivationHeightsMap", which is temporarily set to nil,
Expand Down
4 changes: 2 additions & 2 deletions localnet/poktrolld/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ timeout_broadcast_tx_commit = "10s"
max_request_batch_size = 10

# Maximum size of request body, in bytes
max_body_bytes = 100000000
max_body_bytes = 1000000

# Maximum size of request header, in bytes
max_header_bytes = 1048576
Expand Down Expand Up @@ -330,7 +330,7 @@ keep-invalid-txs-in-cache = false

# Maximum size of a single transaction.
# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}.
max_tx_bytes = 100000000
max_tx_bytes = 1048576

# Maximum size of a batch of transactions to send to a peer
# Including space needed by encoding (one varint per transaction).
Expand Down
7 changes: 4 additions & 3 deletions proto/poktroll/application/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ message Application {
cosmos.base.v1beta1.Coin stake = 2;

// CRITICAL: Must contain EXACTLY ONE service config
// Kept as repeated for legacy and future compatibility
// This prevents applications from over-servicing.
// Kept as repeated field for legacy and future compatibility
// Refs:
// - https://github.com/pokt-network/poktroll/pull/750#discussion_r1735025033
// - https://www.notion.so/buildwithgrove/Off-chain-Application-Stake-Tracking-6a8bebb107db4f7f9dc62cbe7ba555f7
Expand All @@ -35,8 +36,8 @@ message Application {
repeated string delegatee_gateway_addresses = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.nullable) = false];

// Mapping of session end heights to gateways being undelegated from
// Key: Height of the last block of the session when undelegation was committed
// Value: List of gateways being undelegated from
// - Key: Height of the last block of the session when undelegation tx was committed
// - Value: List of gateways being undelegated from
// TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment
// so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906.
map<uint64, UndelegatingGatewayList> pending_undelegations = 5 [(gogoproto.nullable) = false];
Expand Down
10 changes: 5 additions & 5 deletions proto/poktroll/shared/supplier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ message Supplier {
// Cannot be updated by the operator
string owner_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// Operator address managing the off-chain server
// Immutable for supplier's lifespan - requires unstake/re-stake to change
// Can update supplier configs except owner address
// Operator address managing the offchain server
// Immutable for supplier's lifespan - requires unstake/re-stake to change.
// Can update supplier configs except for owner address.
string operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// Total amount of staked uPOKT
Expand All @@ -31,8 +31,8 @@ message Supplier {
uint64 unstake_session_end_height = 5;

// Mapping of serviceIds to their activation heights
// Key: serviceId
// Value: Session start height when supplier becomes active for the service
// - Key: serviceId
// - Value: Session start height when supplier becomes active for the service
// TODO_MAINNET(@olshansk, #1033): Look into moving this to an external repeated protobuf
// because maps are no longer supported for serialized types in the CosmoSDK.
map<string, uint64> services_activation_heights_map = 6;
Expand Down
7 changes: 4 additions & 3 deletions x/application/types/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions x/shared/types/supplier.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions x/supplier/keeper/query_supplier_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package keeper_test

import (
"fmt"
"strconv"
"testing"

Expand All @@ -11,6 +12,7 @@ import (

keepertest "github.com/pokt-network/poktroll/testutil/keeper"
"github.com/pokt-network/poktroll/testutil/nullify"
"github.com/pokt-network/poktroll/testutil/sample"
"github.com/pokt-network/poktroll/x/supplier/types"
)

Expand All @@ -20,6 +22,7 @@ var _ = strconv.IntSize
func TestSupplierQuerySingle(t *testing.T) {
supplierModuleKeepers, ctx := keepertest.SupplierKeeper(t)
suppliers := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 2)
supplierAddr := sample.AccAddress()

tests := []struct {
desc string
Expand All @@ -44,9 +47,9 @@ func TestSupplierQuerySingle(t *testing.T) {
{
desc: "KeyNotFound",
request: &types.QueryGetSupplierRequest{
OperatorAddress: strconv.Itoa(100000),
OperatorAddress: supplierAddr,
},
expectedErr: status.Error(codes.NotFound, "supplier with address: \"100000\""),
expectedErr: status.Error(codes.NotFound, fmt.Sprintf("supplier with address: \"%s\"", supplierAddr)),
},
{
desc: "InvalidRequest",
Expand Down

0 comments on commit 7ec7084

Please sign in to comment.