[#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>
This commit is contained in:
Anna Shaleva 2023-04-20 18:53:48 +03:00 committed by Evgenii Stratonikov
parent ddcc156ecc
commit bcdb0f330d

View file

@ -31,9 +31,8 @@ import (
type ( type (
notaryInfo struct { notaryInfo struct {
txValidTime uint32 // minimum amount of blocks when mainTx will be valid 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 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
alphabetSource AlphabetKeys // source of alphabet node keys to prepare witness alphabetSource AlphabetKeys // source of alphabet node keys to prepare witness
@ -44,7 +43,7 @@ type (
notaryCfg struct { notaryCfg struct {
proxy util.Uint160 proxy util.Uint160
txValidTime, roundTime, fallbackTime uint32 txValidTime, roundTime uint32
alphabetSource AlphabetKeys alphabetSource AlphabetKeys
} }
@ -54,9 +53,8 @@ type (
) )
const ( const (
defaultNotaryValidTime = 50 defaultNotaryValidTime = 50
defaultNotaryRoundTime = 100 defaultNotaryRoundTime = 100
defaultNotaryFallbackTime = 40
notaryBalanceOfMethod = "balanceOf" notaryBalanceOfMethod = "balanceOf"
notaryExpirationOfMethod = "expirationOf" notaryExpirationOfMethod = "expirationOf"
@ -72,7 +70,6 @@ func defaultNotaryConfig(c *Client) *notaryCfg {
return &notaryCfg{ return &notaryCfg{
txValidTime: defaultNotaryValidTime, txValidTime: defaultNotaryValidTime,
roundTime: defaultNotaryRoundTime, roundTime: defaultNotaryRoundTime,
fallbackTime: defaultNotaryFallbackTime,
alphabetSource: c.Committee, alphabetSource: c.Committee,
} }
} }
@ -107,7 +104,6 @@ func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
proxy: cfg.proxy, proxy: cfg.proxy,
txValidTime: cfg.txValidTime, txValidTime: cfg.txValidTime,
roundTime: cfg.roundTime, roundTime: cfg.roundTime,
fallbackTime: cfg.fallbackTime,
alphabetSource: cfg.alphabetSource, alphabetSource: cfg.alphabetSource,
notary: notary.Hash, 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 // WithAlphabetSource returns a notary support option for client
// that specifies function to return list of alphabet node keys. // that specifies function to return list of alphabet node keys.
// By default notary subsystem uses committee as a source. This is // By default notary subsystem uses committee as a source. This is