From 3aae60d5174e43c61791a7648a28775dd3534e9a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 1 Apr 2021 20:17:53 +0300 Subject: [PATCH] [#454] innerring: Increase duration of notary deposit Extra blocks for notary deposit must not be less than extra blocks at notary tx rounding. Consider you make notary deposit every 1000 block for next 1100 blocks. At block 555 you made notary deposit up to 1655. At block 1554 you want to send notary tx. Notary client uses rounding to calculate `until` value. By default notary client rounds with up to 150 block ahead, thus for tx at 1554 `until` will be 1700. 1700 is bigger than deposit limit at 1655 and tx will fail. However if extra blocks for notary deposit will be 200, then this case won't be possible. Signed-off-by: Alex Vanin --- pkg/innerring/innerring.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index fdfa8d8c..ef992d7a 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -110,8 +110,9 @@ const ( mainnetPrefix = "mainnet" // extra blocks to overlap two deposits, we do that to make sure that - // there won't be any blocks without deposited assets in notary contract. - notaryExtraBlocks = 100 + // there won't be any blocks without deposited assets in notary contract; + // make sure it is bigger than any extra rounding value in notary client. + notaryExtraBlocks = 300 // amount of tries before notary deposit timeout. notaryDepositTimeout = 100 )