Open ncying opened 6 years ago
here is the reason: APIs collect the data and create the transaction => put into utx pool if the tx id is already in cache, return the infomation, see https://github.com/excelsia/VEE/blob/28d3b4efe32bfbaff84356a76245cc11913cef6a/src/main/scala/com/wavesplatform/UtxPool.scala#L62 else validate the transaction (e.g. judge the fee sufficiency)
the tx id of alias and contract transaction will be exactly same if we use same alias or name. in the case i reported, a same tx id with insufficient fee error is already in cache. so, if you try to submit another transaction with same alias or name, you will return the insufficient fee error again.
i tested the same submission after restarting the node, then it passed.
suggestion: add timestamps in toHash data and get a dynamic tx id
makes sense. maybe just remove the following line so that the id is based on toSign()?
override lazy val id: ByteStr = ByteStr(FastCryptographicHash(transactionType.id.toByte +: contract.name.getBytes("UTF-8")))
@ning2056 did some more research, this will only happen if the fee is not 0 and the fee is not enough. the txn is only in the utxpool for 90 minutes. we can just reduce the time if we want to solve this issue.
we can't just change the id as it is used by @ning2056 for uniqueness of the contract.
utx {
max-size = 10000
# Evict transaction from UTX pool after it gets older than specified
max-transaction-age = 90m
}
Yes, I know the tx id was used as uniqueness test in contract transaction. It seems that we can add extra parameter like what used in original payment transaction, and use the new parameter for uniqueness in contract.
seems we can either
maybe we just try 3 -- since we are generating one block every second, the time should be reduced anyway.
when create an alias or contract in api, if the fee number insufficient, for example:
we will get
then increase the fee
and return the same error, but this time the fee number is valid