feat(primitive): Signer recovery (#179)

* feat(consensus): Signer recovery and tx validation

* Signature hash and use seckp256k1 over k256

* use deref_more for transactions

* cleanup and fix for eip1559 hash

* fix hash calculation on decoding
This commit is contained in:
rakita
2022-11-09 18:11:32 +01:00
committed by GitHub
parent 836ad6aaee
commit 9e35d58b05
11 changed files with 358 additions and 79 deletions

View File

@ -41,7 +41,6 @@ pub enum Error {
TimestampIsInPast { parent_timestamp: u64, timestamp: u64 },
#[error("Block timestamp {timestamp:?} is in future in comparison of our clock time {present_timestamp:?}")]
TimestampIsInFuture { timestamp: u64, present_timestamp: u64 },
// TODO make better error msg :)
#[error("Child gas_limit {child_gas_limit:?} max increase is {parent_gas_limit}/1024")]
GasLimitInvalidIncrease { parent_gas_limit: u64, child_gas_limit: u64 },
#[error("Child gas_limit {child_gas_limit:?} max decrease is {parent_gas_limit}/1024")]
@ -50,4 +49,10 @@ pub enum Error {
BaseFeeMissing,
#[error("Block base fee ({got:?}) is different then expected: ({expected:?})")]
BaseFeeDiff { expected: u64, got: u64 },
#[error("Transaction eip1559 priority fee is more then max fee")]
TransactionPriorityFeeMoreThenMaxFee,
#[error("Transaction chain_id does not match")]
TransactionChainId,
#[error("Transation max fee is less them block base fee")]
TransactionMaxFeeLessThenBaseFee,
}