Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FM-18: Check transactions #28

Merged
merged 7 commits into from
Feb 15, 2023
Merged

FM-18: Check transactions #28

merged 7 commits into from
Feb 15, 2023

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Feb 12, 2023

Closes consensus-shipyard/ipc#285

Implements a new CheckInterpreter stack that performs nonce and balance checks on incoming transactions before they are added to the mempool. The successful results update a temporary state represented by the StateTree on top of the latest state root hash, so the next transaction sent by the same account is checked against the tentative state.

NOTE: The current state does not check that the message sets any reasonable gas_fee_cap. I'm not fully comfortable with the gas rules of the ref-fvm calculated in GasOutputs, however it definitely allows the fee to be set to zero, in which case as far as I can see the miner pays. It would make sense to include a rule in the FvmMessageInterpreter which rejects transactions if they don't set a reasonable fee, perhaps based on the base_fee. I'll create a story for this and have a look at what Forest is doing.

@aakoshh aakoshh marked this pull request as ready for review February 13, 2023 20:44
@aakoshh aakoshh merged commit 775ab6e into master Feb 15, 2023
@aakoshh aakoshh deleted the fm-18-check-tx branch February 15, 2023 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement check_tx
1 participant