The current implementation of permits has several drawbacks:
- Only one permit per account can exist in the mempool at any given time.
- There's no RPC function to retrieve the latest nonce from the mempool, as there is for regular transactions.
- Indexing permits is difficult because there’s no nonce included in the arguments, making it hard to track the sequence.
- Dispatched permits are sometimes deleted from the mempool due to nonce validation issues, especially when the node hasn’t synced to the latest nonce.
- Permits cannot be replaced with newer ones.
Proposed Solution
We should introduce a nonce as an additional parameter when submitting a permit. This nonce will be validated against the specified value, rather than the one stored in the state, allowing:
- Permits to be dispatched with the same nonce as a priority.
- Multiple permits per account to exist in the pool simultaneously.
To ensure nonce continuity, we will create a runtime API to retrieve the latest permit nonce for an account from the mempool, similar to how it's done for regular transactions.This will resolve points 1-4.
For point 5, we will allow a permit to be replaced by a newer one by specifying a higher tip, granting it more priority, similar to how regular transactions behave.
Backward Compatibility:
These changes will be backward compatible with the original Moonbeam-derived interface, allowing us to process old permits with the same limitations as before.
The current implementation of permits has several drawbacks:
Proposed Solution
We should introduce a nonce as an additional parameter when submitting a permit. This nonce will be validated against the specified value, rather than the one stored in the state, allowing:
To ensure nonce continuity, we will create a runtime API to retrieve the latest permit nonce for an account from the mempool, similar to how it's done for regular transactions.This will resolve points 1-4.
For point 5, we will allow a permit to be replaced by a newer one by specifying a higher tip, granting it more priority, similar to how regular transactions behave.
Backward Compatibility:
These changes will be backward compatible with the original Moonbeam-derived interface, allowing us to process old permits with the same limitations as before.