Open jnaviask opened 3 years ago
Is this related to the existential deposit?
Is this related to the existential deposit?
Still investigating... how would this cause a contract's nonce to reset?
It may not be related, but I know that when people have problems with nonces resetting in Substrate chains it is often due to accounts getting "reaped".
For normal substrate accounts, if your balance goes below this amount, the account is "reaped" and the nonce reset to zero. The point is that we shouldn't waste state space on accounts that just have "dust" values.
I don't know how or whether this relates to accounts inside the evm. But the fact that the resetting happens only when you send value was a further clue that made me suggest it.
An easy thing to test would be setting this value to zero and seeing whether it solves your problem. If it does then you ca nstart to explore why.
And again I could be 100% wrong about this, I just wanted to share the idea.
This issue still persists, and your guess was correct @JoshOrndorff, the contract's underlying account is getting reaped. I see system:KilledAccount
emitted when the contract spawns another with value.
Description
In certain cases, when calling a method on a contract that spawns another contract within solidity, the nonce of the creating contract will reliably be reset to 0.
Steps to Reproduce
Consider the following solidity contract:
The following test case works:
But replacing
c.spawn
withc.spawnWithValue
set to some reasonable amount causesc
's nonce to become 0 instead of 2 as expected.