Skip to content

Commit

Permalink
[Code Health] refactor: share helpers to consolidate avoid dependency…
Browse files Browse the repository at this point in the history
… cycles (#855)

## Summary

Consolidates pkg `x/shared` with `x/shared/types`.

#### Before
```
x
└── shared
    ├── helpers                 // pkg removed
    │   ├── service_configs.go  // moved to x/shared/types/service_configs.go
    │   └── service_test.go     // moved to x/shared/types/service_test.go
    ├── session.go              // moved to x/shared/types/session.go
    ├── session_test.go         // moved to x/shared/types/session_test.go
    ├── supplier.go             // combined with x/shared/types/supplier.go
    └── types
        ├── supplier.go
        └── ...
```

#### After
```
x
└── shared
    └── types
        ├── service_configs.go
        ├── service_test.go
        ├── session.go
        ├── session_test.go
        ├── supplier.go
        └── ...
```

## Issue

I went looking for `GetSessionEndToProofWindowCloseBlocks()` knowing it
exists but was unable to find it easily.
This PR attempts to resolve a structural inconsistency within the shared
module's packages.

- #N/A

## Type of change

Select one or more from the following:

- [ ] New feature, functionality or library
- [ ] Consensus breaking; add the `consensus-breaking` label if so. See
#791 for details
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

- [ ] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [ ] **Unit Tests**: `make go_develop_and_test`
- [ ] **LocalNet E2E Tests**: `make test_e2e`
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.

## Sanity Checklist

- [ ] I have tested my changes using the available tooling
- [ ] I have commented my code
- [x] I have performed a self-review of my own code; both comments &
source code
- [ ] I create and reference any new tickets, if applicable
- [ ] I have left TODOs throughout the codebase, if applicable
  • Loading branch information
bryanchriswhite authored Oct 15, 2024
1 parent 489b466 commit 632e527
Show file tree
Hide file tree
Showing 49 changed files with 239 additions and 286 deletions.
3 changes: 1 addition & 2 deletions e2e/tests/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
servicetypes "github.com/pokt-network/poktroll/x/service/types"
sessiontypes "github.com/pokt-network/poktroll/x/session/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
suppliertypes "github.com/pokt-network/poktroll/x/supplier/types"
)
Expand Down Expand Up @@ -781,7 +780,7 @@ func (s *suite) getSupplierUnbondingHeight(accName string) int64 {
responseBz := []byte(strings.TrimSpace(res.Stdout))
s.cdc.MustUnmarshalJSON(responseBz, &resp)

return shared.GetSupplierUnbondingHeight(&resp.Params, supplier)
return sharedtypes.GetSupplierUnbondingHeight(&resp.Params, supplier)
}

// getApplicationInfo returns the application information for a given application address.
Expand Down
5 changes: 2 additions & 3 deletions load-testing/tests/relays_stress_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/pokt-network/poktroll/testutil/testclient/testeventsquery"
apptypes "github.com/pokt-network/poktroll/x/application/types"
gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
suppliertypes "github.com/pokt-network/poktroll/x/supplier/types"
)
Expand Down Expand Up @@ -379,9 +378,9 @@ func (plans *actorLoadTestIncrementPlans) totalDurationBlocks(
// The last block of the last session SHOULD align with the last block of the
// last increment duration (i.e. **after** maxActorCount actors are activated).
blocksToFinalSessionEnd := plans.maxActorBlocksToFinalIncrementEnd()
finalSessionEndHeight := shared.GetSessionEndHeight(sharedParams, currentHeight+blocksToFinalSessionEnd)
finalSessionEndHeight := sharedtypes.GetSessionEndHeight(sharedParams, currentHeight+blocksToFinalSessionEnd)

return shared.GetProofWindowCloseHeight(sharedParams, finalSessionEndHeight) - currentHeight
return sharedtypes.GetProofWindowCloseHeight(sharedParams, finalSessionEndHeight) - currentHeight
}

// blocksToFinalIncrementStart returns the number of blocks that will have
Expand Down
15 changes: 7 additions & 8 deletions pkg/client/query/sharedquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/cosmos/gogoproto/grpc"

"github.com/pokt-network/poktroll/pkg/client"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -71,7 +70,7 @@ func (sq *sharedQuerier) GetClaimWindowOpenHeight(ctx context.Context, queryHeig
if err != nil {
return 0, err
}
return shared.GetClaimWindowOpenHeight(sharedParams, queryHeight), nil
return sharedtypes.GetClaimWindowOpenHeight(sharedParams, queryHeight), nil
}

// GetProofWindowOpenHeight returns the block height at which the proof window of
Expand All @@ -87,7 +86,7 @@ func (sq *sharedQuerier) GetProofWindowOpenHeight(ctx context.Context, queryHeig
if err != nil {
return 0, err
}
return shared.GetProofWindowOpenHeight(sharedParams, queryHeight), nil
return sharedtypes.GetProofWindowOpenHeight(sharedParams, queryHeight), nil
}

// GetSessionGracePeriodEndHeight returns the block height at which the grace period
Expand All @@ -108,7 +107,7 @@ func (sq *sharedQuerier) GetSessionGracePeriodEndHeight(
if err != nil {
return 0, err
}
return shared.GetSessionGracePeriodEndHeight(sharedParams, queryHeight), nil
return sharedtypes.GetSessionGracePeriodEndHeight(sharedParams, queryHeight), nil
}

// GetEarliestSupplierClaimCommitHeight returns the earliest block height at which a claim
Expand All @@ -127,7 +126,7 @@ func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Contex

// Fetch the block at the proof window open height. Its hash is used as part
// of the seed to the pseudo-random number generator.
claimWindowOpenHeight := shared.GetClaimWindowOpenHeight(sharedParams, queryHeight)
claimWindowOpenHeight := sharedtypes.GetClaimWindowOpenHeight(sharedParams, queryHeight)
claimWindowOpenBlock, err := sq.blockQuerier.Block(ctx, &claimWindowOpenHeight)
if err != nil {
return 0, err
Expand All @@ -136,7 +135,7 @@ func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Contex
// NB: Byte slice representation of block hashes don't need to be normalized.
claimWindowOpenBlockHash := claimWindowOpenBlock.BlockID.Hash.Bytes()

return shared.GetEarliestSupplierClaimCommitHeight(
return sharedtypes.GetEarliestSupplierClaimCommitHeight(
sharedParams,
queryHeight,
claimWindowOpenBlockHash,
Expand All @@ -160,13 +159,13 @@ func (sq *sharedQuerier) GetEarliestSupplierProofCommitHeight(ctx context.Contex

// Fetch the block at the proof window open height. Its hash is used as part
// of the seed to the pseudo-random number generator.
proofWindowOpenHeight := shared.GetProofWindowOpenHeight(sharedParams, queryHeight)
proofWindowOpenHeight := sharedtypes.GetProofWindowOpenHeight(sharedParams, queryHeight)
proofWindowOpenBlock, err := sq.blockQuerier.Block(ctx, &proofWindowOpenHeight)
if err != nil {
return 0, err
}

return shared.GetEarliestSupplierProofCommitHeight(
return sharedtypes.GetEarliestSupplierProofCommitHeight(
sharedParams,
queryHeight,
proofWindowOpenBlock.BlockID.Hash,
Expand Down
3 changes: 1 addition & 2 deletions pkg/crypto/rings/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/pokt-network/poktroll/pkg/polylog"
apptypes "github.com/pokt-network/poktroll/x/application/types"
"github.com/pokt-network/poktroll/x/service/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -294,7 +293,7 @@ func GetRingAddressesAtBlock(
blockHeight int64,
) []string {
// Get the target session end height at which we want to get the active delegations.
targetSessionEndHeight := uint64(shared.GetSessionEndHeight(sharedParams, blockHeight))
targetSessionEndHeight := uint64(sharedtypes.GetSessionEndHeight(sharedParams, blockHeight))

return GetRingAddressesAtSessionEndHeight(app, targetSessionEndHeight)
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/relayer/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/pokt-network/poktroll/pkg/relayer/config"
"github.com/pokt-network/poktroll/pkg/relayer/proxy"
"github.com/pokt-network/poktroll/testutil/testproxy"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -356,17 +355,17 @@ func TestRelayerProxy_Relays(t *testing.T) {

sharedParams := sharedtypes.DefaultParams()

sessionTwoStartHeight := shared.GetSessionEndHeight(&sharedParams, blockHeight) + 1
sessionTwoStartHeight := sharedtypes.GetSessionEndHeight(&sharedParams, blockHeight) + 1

// blockOutsideSessionGracePeriod is the block height that is after the first
// session's grace period and within the second session's grace period,
// meaning a relay should be handled as part of the session two AND NOT session one.
blockOutsideSessionGracePeriod := shared.GetSessionGracePeriodEndHeight(&sharedParams, sessionTwoStartHeight)
blockOutsideSessionGracePeriod := sharedtypes.GetSessionGracePeriodEndHeight(&sharedParams, sessionTwoStartHeight)

// blockWithinSessionGracePeriod is the block height that is after the first
// session but within its session's grace period, meaning a relay should be
// handled at this block height.
blockWithinSessionGracePeriod := shared.GetSessionGracePeriodEndHeight(&sharedParams, blockHeight) - 1
blockWithinSessionGracePeriod := sharedtypes.GetSessionGracePeriodEndHeight(&sharedParams, blockHeight) - 1

tests := []struct {
desc string
Expand Down
10 changes: 5 additions & 5 deletions pkg/relayer/proxy/relay_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package proxy
import (
"context"

"github.com/pokt-network/poktroll/x/service/types"
"github.com/pokt-network/poktroll/x/shared"
servicetypes "github.com/pokt-network/poktroll/x/service/types"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

// VerifyRelayRequest is a shared method used by RelayServers to check the relay
// request signature and session validity.
func (rp *relayerProxy) VerifyRelayRequest(
ctx context.Context,
relayRequest *types.RelayRequest,
relayRequest *servicetypes.RelayRequest,
supplierServiceId string,
) error {
// Get the block height at which the relayRequest should be processed.
Expand Down Expand Up @@ -97,7 +97,7 @@ func (rp *relayerProxy) VerifyRelayRequest(
// If the session has expired, then return an error.
func (rp *relayerProxy) getTargetSessionBlockHeight(
ctx context.Context,
relayRequest *types.RelayRequest,
relayRequest *servicetypes.RelayRequest,
) (sessionHeight int64, err error) {
currentHeight := rp.blockClient.LastBlock(ctx).Height()
sessionEndHeight := relayRequest.Meta.SessionHeader.GetSessionEndBlockHeight()
Expand All @@ -116,7 +116,7 @@ func (rp *relayerProxy) getTargetSessionBlockHeight(
if sessionEndHeight < currentHeight {
// Do not process the `RelayRequest` if the session has expired and the current
// block height is outside the session's grace period.
if !shared.IsGracePeriodElapsed(sharedParams, sessionEndHeight, currentHeight) {
if !sharedtypes.IsGracePeriodElapsed(sharedParams, sessionEndHeight, currentHeight) {
// The RelayRequest's session has expired but is still within the
// grace period so process it as if the session is still active.
return sessionEndHeight, nil
Expand Down
11 changes: 6 additions & 5 deletions pkg/relayer/session/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"slices"

"github.com/pokt-network/smt"

"github.com/pokt-network/poktroll/pkg/client"
"github.com/pokt-network/poktroll/pkg/either"
"github.com/pokt-network/poktroll/pkg/observable"
Expand All @@ -13,8 +15,7 @@ import (
"github.com/pokt-network/poktroll/pkg/observable/logging"
"github.com/pokt-network/poktroll/pkg/relayer"
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
"github.com/pokt-network/poktroll/x/shared"
"github.com/pokt-network/smt"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

// createClaims maps over the sessionsToClaimObs observable. For each claim batch, it:
Expand Down Expand Up @@ -56,7 +57,7 @@ func (rs *relayerSessionsManager) createClaims(
// Delete expired session trees so they don't get claimed again.
channel.ForEach(
ctx, failedCreateClaimSessionsObs,
rs.deleteExpiredSessionTreesFn(shared.GetClaimWindowCloseHeight),
rs.deleteExpiredSessionTreesFn(sharedtypes.GetClaimWindowCloseHeight),
)

// Map eitherClaimedSessions to a new observable of []relayer.SessionTree
Expand Down Expand Up @@ -115,7 +116,7 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight(
return nil
}

claimWindowOpenHeight := shared.GetClaimWindowOpenHeight(sharedParams, sessionEndHeight)
claimWindowOpenHeight := sharedtypes.GetClaimWindowOpenHeight(sharedParams, sessionEndHeight)

// we wait for claimWindowOpenHeight to be received before proceeding since we need its hash
// to know where this servicer's claim submission window opens.
Expand Down Expand Up @@ -149,7 +150,7 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight(

// Get the earliest claim commit height for this supplier.
supplierOperatorAddr := sessionTrees[0].GetSupplierOperatorAddress().String()
earliestSupplierClaimsCommitHeight := shared.GetEarliestSupplierClaimCommitHeight(
earliestSupplierClaimsCommitHeight := sharedtypes.GetEarliestSupplierClaimCommitHeight(
sharedParams,
sessionEndHeight,
claimsWindowOpenBlock.Hash(),
Expand Down
11 changes: 5 additions & 6 deletions pkg/relayer/session/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import (
"github.com/pokt-network/poktroll/pkg/observable/filter"
"github.com/pokt-network/poktroll/pkg/observable/logging"
"github.com/pokt-network/poktroll/pkg/relayer"
"github.com/pokt-network/poktroll/x/proof/types"
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

// submitProofs maps over the given claimedSessions observable.
Expand Down Expand Up @@ -53,7 +52,7 @@ func (rs *relayerSessionsManager) submitProofs(
// Delete expired session trees so they don't get proven again.
channel.ForEach(
ctx, failedSubmitProofsSessionsObs,
rs.deleteExpiredSessionTreesFn(shared.GetProofWindowCloseHeight),
rs.deleteExpiredSessionTreesFn(sharedtypes.GetProofWindowCloseHeight),
)
}

Expand Down Expand Up @@ -102,7 +101,7 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr
return nil
}

proofWindowOpenHeight := shared.GetProofWindowOpenHeight(sharedParams, sessionEndHeight)
proofWindowOpenHeight := sharedtypes.GetProofWindowOpenHeight(sharedParams, sessionEndHeight)

// we wait for proofWindowOpenHeight to be received before proceeding since we need
// its hash to seed the pseudo-random number generator for the proof submission
Expand All @@ -127,7 +126,7 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr

// Get the earliest proof commit height for this supplier.
supplierOperatorAddr := sessionTrees[0].GetSupplierOperatorAddress().String()
earliestSupplierProofsCommitHeight := shared.GetEarliestSupplierProofCommitHeight(
earliestSupplierProofsCommitHeight := sharedtypes.GetEarliestSupplierProofCommitHeight(
sharedParams,
sessionEndHeight,
proofsWindowOpenBlock.Hash(),
Expand Down Expand Up @@ -170,7 +169,7 @@ func (rs *relayerSessionsManager) newMapProveSessionsFn(
// Map key is the supplier operator address.
proofMsgs := make([]client.MsgSubmitProof, len(sessionTrees))
for idx, session := range sessionTrees {
proofMsgs[idx] = &types.MsgSubmitProof{
proofMsgs[idx] = &prooftypes.MsgSubmitProof{
Proof: session.GetProofBz(),
SessionHeader: session.GetSessionHeader(),
SupplierOperatorAddress: session.GetSupplierOperatorAddress().String(),
Expand Down
7 changes: 3 additions & 4 deletions pkg/relayer/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
"github.com/pokt-network/poktroll/pkg/observable/logging"
"github.com/pokt-network/poktroll/pkg/polylog"
"github.com/pokt-network/poktroll/pkg/relayer"
"github.com/pokt-network/poktroll/x/service/types"
"github.com/pokt-network/poktroll/x/shared"
servicetypes "github.com/pokt-network/poktroll/x/service/types"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -157,7 +156,7 @@ func (rs *relayerSessionsManager) InsertRelays(relays relayer.MinedRelaysObserva
// corresponding to the relay request metadata.
// If no tree for the session exists, a new SessionTree is created before returning.
func (rs *relayerSessionsManager) ensureSessionTree(
relayRequestMetadata *types.RelayRequestMetadata,
relayRequestMetadata *servicetypes.RelayRequestMetadata,
) (relayer.SessionTree, error) {
rs.sessionsTreesMu.Lock()
defer rs.sessionsTreesMu.Unlock()
Expand Down Expand Up @@ -257,7 +256,7 @@ func (rs *relayerSessionsManager) forEachBlockClaimSessionsFn(
// before emitting the on-time sessions.
var lateSessions []relayer.SessionTree

claimWindowOpenHeight := shared.GetClaimWindowOpenHeight(sharedParams, sessionEndHeight)
claimWindowOpenHeight := sharedtypes.GetClaimWindowOpenHeight(sharedParams, sessionEndHeight)

// Checking for sessions to claim with <= operator,
// which means that it would include sessions that were supposed to be
Expand Down
9 changes: 4 additions & 5 deletions pkg/relayer/session/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/pokt-network/poktroll/testutil/testrelayer"
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
sessiontypes "github.com/pokt-network/poktroll/x/session/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -370,8 +369,8 @@ func playClaimAndProofSubmissionBlocks(
// Calculate the session grace period end block height to emit that block height
// to the blockPublishCh to trigger session trees processing for the session number.
sharedParams := sharedtypes.DefaultParams()
claimWindowOpenHeight := shared.GetClaimWindowOpenHeight(&sharedParams, sessionEndHeight)
earliestSupplierClaimCommitHeight := shared.GetEarliestSupplierClaimCommitHeight(
claimWindowOpenHeight := sharedtypes.GetClaimWindowOpenHeight(&sharedParams, sessionEndHeight)
earliestSupplierClaimCommitHeight := sharedtypes.GetEarliestSupplierClaimCommitHeight(
&sharedParams,
sessionEndHeight,
blockHash,
Expand All @@ -389,14 +388,14 @@ func playClaimAndProofSubmissionBlocks(

waitSimulateIO()

proofWindowOpenHeight := shared.GetProofWindowOpenHeight(&sharedParams, sessionEndHeight)
proofWindowOpenHeight := sharedtypes.GetProofWindowOpenHeight(&sharedParams, sessionEndHeight)
proofPathSeedBlock := testblock.NewAnyTimesBlock(t, blockHash, proofWindowOpenHeight)
blockPublishCh <- proofPathSeedBlock

waitSimulateIO()

// Publish a block to the blockPublishCh to trigger proof submission for the session.
earliestSupplierProofCommitHeight := shared.GetEarliestSupplierProofCommitHeight(
earliestSupplierProofCommitHeight := sharedtypes.GetEarliestSupplierProofCommitHeight(
&sharedParams,
sessionEndHeight,
blockHash,
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/application/application_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/pokt-network/poktroll/testutil/integration/suites"
"github.com/pokt-network/poktroll/testutil/testkeyring"
apptypes "github.com/pokt-network/poktroll/x/application/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -95,7 +94,7 @@ func (s *appTransferTestSuite) TestSingleSourceToNonexistentDestinationSucceeds(
require.NoError(s.T(), err)

sharedParams := sharedParamsAny.(sharedtypes.Params)
sessionEndHeight := shared.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight())
sessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight())

transferBeginHeight := s.SdkCtx().BlockHeight()

Expand Down Expand Up @@ -192,7 +191,7 @@ func (s *appTransferTestSuite) TestMultipleSourceToSameNonexistentDestinationMer

sharedParams := sharedParamsAny.(sharedtypes.Params)
msgTransferAppTypeURL := cosmostypes.MsgTypeURL(&apptypes.MsgTransferApplication{})
sessionEndHeight := shared.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight())
sessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, s.SdkCtx().BlockHeight())

transferBeginHeight := s.SdkCtx().BlockHeight()

Expand Down
3 changes: 1 addition & 2 deletions tests/integration/application/min_stake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
apptypes "github.com/pokt-network/poktroll/x/application/types"
prooftypes "github.com/pokt-network/poktroll/x/proof/types"
sessiontypes "github.com/pokt-network/poktroll/x/session/types"
"github.com/pokt-network/poktroll/x/shared"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

Expand Down Expand Up @@ -94,7 +93,7 @@ func (s *applicationMinStakeTestSuite) TestAppIsUnbondedIfBelowMinStakeWhenSettl
sdkCtx := cosmostypes.UnwrapSDKContext(s.ctx)
currentHeight := sdkCtx.BlockHeight()
sharedParams := s.keepers.SharedKeeper.GetParams(s.ctx)
currentSessionEndHeight := shared.GetSessionEndHeight(&sharedParams, currentHeight)
currentSessionEndHeight := sharedtypes.GetSessionEndHeight(&sharedParams, currentHeight)
claimSettlementHeight := currentSessionEndHeight + int64(sharedtypes.GetSessionEndToProofWindowCloseBlocks(&sharedParams)) + 1
sdkCtx = sdkCtx.WithBlockHeight(claimSettlementHeight)
s.ctx = sdkCtx
Expand Down
Loading

0 comments on commit 632e527

Please sign in to comment.