-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction Consensus Rules #165
Conversation
I think thats it for transactions |
I think you need to impose some constraints on the scriptSig sizes too. IIRC only taproot can have unlimited script sizes |
I`m including the nixify branch so i can already work with flakes |
5fdc7a4
to
f81f455
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Davidson-Souza what do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After refactoring to functions, the code improve and we can now follow to tests on transactions validations.
Done some unitary that cover the errors that the new functions has to output. A personally talk with @Davidson-Souza we established that the objective for block validation code is just some rewriting and implementation to the rest of the code. The first comment explains the actual state of block validation in So doing it in a separate PR right after this one merged. Tagging @Davidson-Souza for a final review. |
Strange... Clippy is asking things out of the scope of this PR |
The ones I'm seeing are due of an |
Also, could you please rebase and squash this? |
e6e56fe
to
43dec4a
Compare
Done, Squashed and lint satisfied |
Just two things that I need to expose. About the bip34 And the constraint of having only 1 coinbase. |
Removed Sequence and time validation so we can implement it on #187 since we need some refactoring |
I've tried to run on the latest commit on mainnet, and I got an error:
But this block is part of the main chain |
Hmmm, that's interesting... i need to make better error logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not change anything of features or rules, but now we can know which transaction we are invalidating
9972fc8
to
9e0c144
Compare
Signed-off-by: jaoleal <[email protected]>
See #162 for context.
After a reading at
crates/floresta-chain/
, based on commenting and codebase...Floresta, what concern the validation of Transactions, has
So, based on Core
validation.cpp
and @Davidson-Souza comment on #162The lacking Rules are:
Values validation.
- Output value is equal or less than total input (Implemented, just needs tests)
- none value is negative
- Any value is not greater than the number in satoshis of the maximum possible bitcoins. (MAX_MONEY = 21000000 * 100 000 000)
- Double Input Spend. (The case that has more than one equal input, mostly referring to the same utxo)
- Inputs are spending UTXO.
Size validation
- Size, without witness, in vbytes has to be less than MAX_BLOCK_WEIGHT(?)
What is a sigop
Their values
This list can and will change, lacking rules that got implemented will change to
RuleDraft will be ready after all Rules are properly tested.
So, for block validation we do have three points of validation
partial_chain.rs
withPartialChainStateInner::process_block()
function that delegates the block validation itself forPartialChainStateInner::validate_block()
, which verifies:The second point being the
ChainState<PersistedState>::validate_block()
that has the same functionality as the other validate_block() function just described above, andBlockchainInterface trait
that has a unimplementedvalidate_block()
function.Since we have a
Chainstate<PersistedState>::validate_header()
we can consider that the known rules are implemented but not tested.