nspcc-dev / neofs-api

NeoFS API documentation and proto files declaration
Apache License 2.0
11 stars 15 forks source link

Disabling basic income settlements #251

Open alexvanin opened 2 years ago

alexvanin commented 2 years ago

To manage basic income settlements we have BasicIncomeRate parameter of the system. https://github.com/nspcc-dev/neofs-api/blob/813c04bea4a23b99fb90666b1b325c95e0a364cf/netmap/types.proto#L265-L268

Setting it to zero minimize single basic income settlement to 0.000000000001 GAS.

https://github.com/nspcc-dev/neofs-node/blob/d8d3588e1b824af37c34f16bef89e5a2af71f70b/pkg/innerring/processors/settlement/basic/collect.go#L103-L105

    if price.Cmp(bigZero) == 0 {
        price.Add(price, bigOne)
    }

Transfers are still going to persist in the side chain. Private installations might want to decrease number of transactions in sidechain and avoid possible errors in Inner Ring if transfer is going to fail. To do that we should be able to turn off basic income completely.

Possible solutions

1) Add new system parameter BasicIncomeDisabled 2) Interpret zero value of BasicIncomeRate to disable basic income settlements

/cc @realloc @fyrchik

roman-khimov commented 1 year ago

I'd say this can be handled in node, zero rate is zero rate, it's already defined in the protocol and the node should just follow this setting.