[#337] morph: Completely remove fallbackTime from client cfg

It's unused and not needed, default fallback lifetime is set by Notary
actor.

Signed-off-by: Anna Shaleva <anna@nspcc.ru>
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/342/head
Anna Shaleva 2023-04-20 18:53:48 +03:00 committed by Evgenii Stratonikov
parent ddcc156ecc
commit bcdb0f330d
1 changed files with 5 additions and 18 deletions

View File

@ -31,9 +31,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
@ -44,7 +43,7 @@ type (
notaryCfg struct {
proxy util.Uint160
txValidTime, roundTime, fallbackTime uint32
txValidTime, roundTime uint32
alphabetSource AlphabetKeys
}
@ -54,9 +53,8 @@ type (
)
const (
defaultNotaryValidTime = 50
defaultNotaryRoundTime = 100
defaultNotaryFallbackTime = 40
defaultNotaryValidTime = 50
defaultNotaryRoundTime = 100
notaryBalanceOfMethod = "balanceOf"
notaryExpirationOfMethod = "expirationOf"
@ -72,7 +70,6 @@ func defaultNotaryConfig(c *Client) *notaryCfg {
return &notaryCfg{
txValidTime: defaultNotaryValidTime,
roundTime: defaultNotaryRoundTime,
fallbackTime: defaultNotaryFallbackTime,
alphabetSource: c.Committee,
}
}
@ -107,7 +104,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,
}
@ -685,15 +681,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