Skip to content

Commit

Permalink
morph: completely remove fallbackTime from client cfg
Browse files Browse the repository at this point in the history
It's unused and not needed, default fallback lifetime is set by Notary
actor.

Signed-off-by: Anna Shaleva <anna@nspcc.ru>
  • Loading branch information
AnnaShaleva committed Apr 20, 2023
1 parent 58c4e22 commit bdc463a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changelog for NeoFS Node
- Inner ring node panic on exit if internal CN is not enabled (#2308)

### Removed
- FallbackTime Morph client configuration option (#2310)

### Updated

Expand Down
23 changes: 5 additions & 18 deletions pkg/morph/client/notary.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import (

type (
notaryInfo struct {
txValidTime uint32 // minimum amount of blocks when mainTx will be valid
roundTime uint32 // extra amount of blocks to synchronize sidechain height diff of inner ring nodes
fallbackTime uint32 // mainTx's ValidUntilBlock - fallbackTime + 1 is when fallbackTx is sent
txValidTime uint32 // minimum amount of blocks when mainTx will be valid
roundTime uint32 // extra amount of blocks to synchronize sidechain height diff of inner ring nodes

alphabetSource AlphabetKeys // source of alphabet node keys to prepare witness

Expand All @@ -43,7 +42,7 @@ type (
notaryCfg struct {
proxy util.Uint160

txValidTime, roundTime, fallbackTime uint32
txValidTime, roundTime uint32

alphabetSource AlphabetKeys
}
Expand All @@ -53,9 +52,8 @@ type (
)

const (
defaultNotaryValidTime = 50
defaultNotaryRoundTime = 100
defaultNotaryFallbackTime = 40
defaultNotaryValidTime = 50
defaultNotaryRoundTime = 100

notaryBalanceOfMethod = "balanceOf"
notaryExpirationOfMethod = "expirationOf"
Expand All @@ -71,7 +69,6 @@ func defaultNotaryConfig(c *Client) *notaryCfg {
return &notaryCfg{
txValidTime: defaultNotaryValidTime,
roundTime: defaultNotaryRoundTime,
fallbackTime: defaultNotaryFallbackTime,
alphabetSource: c.Committee,
}
}
Expand Down Expand Up @@ -106,7 +103,6 @@ func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
proxy: cfg.proxy,
txValidTime: cfg.txValidTime,
roundTime: cfg.roundTime,
fallbackTime: cfg.fallbackTime,
alphabetSource: cfg.alphabetSource,
notary: notary.Hash,
}
Expand Down Expand Up @@ -674,15 +670,6 @@ func WithRoundTime(t uint32) NotaryOption {
}
}

// WithFallbackTime returns a notary support option for client
// that specifies amount of blocks before fallbackTx will be sent.
// Should be less than TxValidTime.
func WithFallbackTime(t uint32) NotaryOption {
return func(c *notaryCfg) {
c.fallbackTime = t
}
}

// WithAlphabetSource returns a notary support option for client
// that specifies function to return list of alphabet node keys.
// By default notary subsystem uses committee as a source. This is
Expand Down

0 comments on commit bdc463a

Please sign in to comment.