nspcc-dev / neofs-node

NeoFS is a decentralized distributed object storage integrated with the Neo blockchain
https://fs.neo.org
GNU General Public License v3.0
32 stars 38 forks source link

Rounding error for initial NEO transfer calculations #2681

Closed roman-khimov closed 9 months ago

roman-khimov commented 9 months ago

Expected Behavior

IR starting for an already running network and dealing with NEO transfers in a normal way.

Current Behavior

For a 7-node network it's

neofs-ir[820]: 2023-12-15T19:47:37.738Z info deploy/funds.go:414 have available NEO on the committee multi-sig account, going to transfer to the Alphabet contracts {"balance": "2"} neofs-ir[820]: 2023-12-15T19:48:37.848Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "022cbb26f105f5023b72a2b5e7b07fea14619361", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.850Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "d6bb47140feaf45206b5413cef9581e6b734f11b", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.852Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "37277e24c32b85fd960867f7a3427894251ef33c", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.854Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "bfabc554a728980d21faeaa4a487c738890593d7", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.854Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "4ce9e4d290c9d7e828e46568f78c0e30f612628a", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.861Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "d36ee8028b44eabf0d35a380d990fd7798b25634", "": "0"} neofs-ir[820]: 2023-12-15T19:48:37.862Z info deploy/funds.go:422 going to transfer NEO from the committee multi-sig account to the Alphabet contract {"contract": "7ac6e2da0d33600aa019b8036ca6101205d4fa08", "": "0"} neofs-ir[820]: 2023-12-15T19:47:37.752Z info deploy/funds.go:445 Notary request transferring Neo from committee multi-sig account to the Alphabet contracts has been successfully sent, will wait for the outcome {"main tx": "377e72d034fc2fa6c44e0e3c434126a2be6d36e0ef9a6630c2e0d9a854761a31", "fallback tx": "597c9f8c817d2812da3ee814df20e8f7a50f170c9cccf7dfc6201b8f04295dc3", "vub": 2745636}

that never ends because we transfer zero NEO and there are always two left.

Possible Solution

For an already set up network this logic can be either omitted (notice that committee can differ from the standby one also), or we can ignore <ValidatorsCount amount of NEO or we can transfer them to random alphabet contract.

Steps to Reproduce (for bugs)

Upgrade a network with seven nodes.

Your Environment