[#47] innerring: Increase minimal extra fee on contract invocations

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-01-20 16:11:43 +03:00 committed by Alex Vanin
parent 8865252daf
commit 0745267411
4 changed files with 7 additions and 14 deletions

View file

@ -32,5 +32,5 @@ func AlphabetVote(cli *client.Client, con util.Uint160, epoch uint64, keys []key
binaryKeys = append(binaryKeys, keys[i].Bytes())
}
return cli.Invoke(con, feeOneGas, voteMethod, int64(epoch), binaryKeys)
return cli.Invoke(con, extraFee, voteMethod, int64(epoch), binaryKeys)
}

View file

@ -24,7 +24,6 @@ type (
const (
putContainerMethod = "put"
deleteContainerMethod = "delete"
listContainersMethod = "list"
)
// RegisterContainer invokes Put method.
@ -33,7 +32,7 @@ func RegisterContainer(cli *client.Client, con util.Uint160, p *ContainerParams)
return client.ErrNilClient
}
return cli.Invoke(con, 5*extraFee, putContainerMethod,
return cli.Invoke(con, 3*extraFee, putContainerMethod,
p.Container,
p.Signature,
p.Key.Bytes(),

View file

@ -27,14 +27,8 @@ const (
// for invocation calculated based on testinvoke which happens at collection
// stage. Therefore client has to provide some extra SysFee to operate at
// execution stage. Otherwise invocation will fail due to gas limit.
extraFee = 1_5000_0000 // 1.5 Fixed8 gas
extraFee = 2_0000_0000 // 2.0 Fixed8 gas
// Different methods need different extra fee values, so with this
// constants let's try to minimize spent GAS of inner ring node.
feeHalfGas = 50_000_000 // 0.5 Fixed8 gas
feeOneGas = feeHalfGas * 2 // 1.0 Fixed8 gas
checkIsInnerRingMethod = "isInnerRing"
innerRingListMethod = "innerRingList"
chequeMethod = "cheque"
)

View file

@ -57,7 +57,7 @@ func SetNewEpoch(cli *client.Client, con util.Uint160, epoch uint64) error {
return client.ErrNilClient
}
return cli.Invoke(con, feeOneGas, setNewEpochMethod, int64(epoch))
return cli.Invoke(con, extraFee, setNewEpochMethod, int64(epoch))
}
// ApprovePeer invokes addPeer method.
@ -66,7 +66,7 @@ func ApprovePeer(cli *client.Client, con util.Uint160, peer []byte) error {
return client.ErrNilClient
}
return cli.Invoke(con, feeOneGas, approvePeerMethod, peer)
return cli.Invoke(con, extraFee, approvePeerMethod, peer)
}
// UpdatePeerState invokes addPeer method.