Skip to content

Commit 9628024

Browse files
Shashwat-NautiyalSamWilsn
authored andcommitted
compute_header_hash() removed
1 parent 29f791b commit 9628024

File tree

16 files changed

+0
-560
lines changed

16 files changed

+0
-560
lines changed

src/ethereum/arrow_glacier/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -805,41 +805,6 @@ def process_transaction(
805805
block_output.block_logs += tx_output.logs
806806

807807

808-
def compute_header_hash(header: Header) -> Hash32:
809-
"""
810-
Computes the hash of a block header.
811-
812-
The header hash of a block is the canonical hash that is used to refer
813-
to a specific block and completely distinguishes a block from another.
814-
815-
``keccak256`` is a function that produces a 256 bit hash of any input.
816-
It also takes in any number of bytes as an input and produces a single
817-
hash for them. A hash is a completely unique output for a single input.
818-
So an input corresponds to one unique hash that can be used to identify
819-
the input exactly.
820-
821-
Prior to using the ``keccak256`` hash function, the header must be
822-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
823-
RLP encoding the header converts it into a space-efficient format that
824-
allows for easy transfer of data between nodes. The purpose of RLP is to
825-
encode arbitrarily nested arrays of binary data, and RLP is the primary
826-
encoding method used to serialize objects in Ethereum's execution layer.
827-
The only purpose of RLP is to encode structure; encoding specific data
828-
types (e.g. strings, floats) is left up to higher-order protocols.
829-
830-
Parameters
831-
----------
832-
header :
833-
Header of interest.
834-
835-
Returns
836-
-------
837-
hash : `ethereum.crypto.hash.Hash32`
838-
Hash of the header.
839-
"""
840-
return keccak256(rlp.encode(header))
841-
842-
843808
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
844809
"""
845810
Validates the gas limit for a block.

src/ethereum/berlin/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -704,41 +704,6 @@ def process_transaction(
704704
block_output.block_logs += tx_output.logs
705705

706706

707-
def compute_header_hash(header: Header) -> Hash32:
708-
"""
709-
Computes the hash of a block header.
710-
711-
The header hash of a block is the canonical hash that is used to refer
712-
to a specific block and completely distinguishes a block from another.
713-
714-
``keccak256`` is a function that produces a 256 bit hash of any input.
715-
It also takes in any number of bytes as an input and produces a single
716-
hash for them. A hash is a completely unique output for a single input.
717-
So an input corresponds to one unique hash that can be used to identify
718-
the input exactly.
719-
720-
Prior to using the ``keccak256`` hash function, the header must be
721-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
722-
RLP encoding the header converts it into a space-efficient format that
723-
allows for easy transfer of data between nodes. The purpose of RLP is to
724-
encode arbitrarily nested arrays of binary data, and RLP is the primary
725-
encoding method used to serialize objects in Ethereum's execution layer.
726-
The only purpose of RLP is to encode structure; encoding specific data
727-
types (e.g. strings, floats) is left up to higher-order protocols.
728-
729-
Parameters
730-
----------
731-
header :
732-
Header of interest.
733-
734-
Returns
735-
-------
736-
hash : `ethereum.crypto.hash.Hash32`
737-
Hash of the header.
738-
"""
739-
return keccak256(rlp.encode(header))
740-
741-
742707
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
743708
"""
744709
Validates the gas limit for a block.

src/ethereum/byzantium/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -681,41 +681,6 @@ def process_transaction(
681681
block_output.block_logs += tx_output.logs
682682

683683

684-
def compute_header_hash(header: Header) -> Hash32:
685-
"""
686-
Computes the hash of a block header.
687-
688-
The header hash of a block is the canonical hash that is used to refer
689-
to a specific block and completely distinguishes a block from another.
690-
691-
``keccak256`` is a function that produces a 256 bit hash of any input.
692-
It also takes in any number of bytes as an input and produces a single
693-
hash for them. A hash is a completely unique output for a single input.
694-
So an input corresponds to one unique hash that can be used to identify
695-
the input exactly.
696-
697-
Prior to using the ``keccak256`` hash function, the header must be
698-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
699-
RLP encoding the header converts it into a space-efficient format that
700-
allows for easy transfer of data between nodes. The purpose of RLP is to
701-
encode arbitrarily nested arrays of binary data, and RLP is the primary
702-
encoding method used to serialize objects in Ethereum's execution layer.
703-
The only purpose of RLP is to encode structure; encoding specific data
704-
types (e.g. strings, floats) is left up to higher-order protocols.
705-
706-
Parameters
707-
----------
708-
header :
709-
Header of interest.
710-
711-
Returns
712-
-------
713-
hash : `ethereum.crypto.hash.Hash32`
714-
Hash of the header.
715-
"""
716-
return keccak256(rlp.encode(header))
717-
718-
719684
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
720685
"""
721686
Validates the gas limit for a block.

src/ethereum/cancun/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -768,41 +768,6 @@ def increase_recipient_balance(recipient: Account) -> None:
768768
destroy_account(block_env.state, wd.address)
769769

770770

771-
def compute_header_hash(header: Header) -> Hash32:
772-
"""
773-
Computes the hash of a block header.
774-
775-
The header hash of a block is the canonical hash that is used to refer
776-
to a specific block and completely distinguishes a block from another.
777-
778-
``keccak256`` is a function that produces a 256 bit hash of any input.
779-
It also takes in any number of bytes as an input and produces a single
780-
hash for them. A hash is a completely unique output for a single input.
781-
So an input corresponds to one unique hash that can be used to identify
782-
the input exactly.
783-
784-
Prior to using the ``keccak256`` hash function, the header must be
785-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
786-
RLP encoding the header converts it into a space-efficient format that
787-
allows for easy transfer of data between nodes. The purpose of RLP is to
788-
encode arbitrarily nested arrays of binary data, and RLP is the primary
789-
encoding method used to serialize objects in Ethereum's execution layer.
790-
The only purpose of RLP is to encode structure; encoding specific data
791-
types (e.g. strings, floats) is left up to higher-order protocols.
792-
793-
Parameters
794-
----------
795-
header :
796-
Header of interest.
797-
798-
Returns
799-
-------
800-
hash : `ethereum.crypto.hash.Hash32`
801-
Hash of the header.
802-
"""
803-
return keccak256(rlp.encode(header))
804-
805-
806771
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
807772
"""
808773
Validates the gas limit for a block.

src/ethereum/constantinople/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -681,41 +681,6 @@ def process_transaction(
681681
block_output.block_logs += tx_output.logs
682682

683683

684-
def compute_header_hash(header: Header) -> Hash32:
685-
"""
686-
Computes the hash of a block header.
687-
688-
The header hash of a block is the canonical hash that is used to refer
689-
to a specific block and completely distinguishes a block from another.
690-
691-
``keccak256`` is a function that produces a 256 bit hash of any input.
692-
It also takes in any number of bytes as an input and produces a single
693-
hash for them. A hash is a completely unique output for a single input.
694-
So an input corresponds to one unique hash that can be used to identify
695-
the input exactly.
696-
697-
Prior to using the ``keccak256`` hash function, the header must be
698-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
699-
RLP encoding the header converts it into a space-efficient format that
700-
allows for easy transfer of data between nodes. The purpose of RLP is to
701-
encode arbitrarily nested arrays of binary data, and RLP is the primary
702-
encoding method used to serialize objects in Ethereum's execution layer.
703-
The only purpose of RLP is to encode structure; encoding specific data
704-
types (e.g. strings, floats) is left up to higher-order protocols.
705-
706-
Parameters
707-
----------
708-
header :
709-
Header of interest.
710-
711-
Returns
712-
-------
713-
hash : `ethereum.crypto.hash.Hash32`
714-
Hash of the header.
715-
"""
716-
return keccak256(rlp.encode(header))
717-
718-
719684
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
720685
"""
721686
Validates the gas limit for a block.

src/ethereum/dao_fork/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -685,41 +685,6 @@ def process_transaction(
685685
block_output.block_logs += tx_output.logs
686686

687687

688-
def compute_header_hash(header: Header) -> Hash32:
689-
"""
690-
Computes the hash of a block header.
691-
692-
The header hash of a block is the canonical hash that is used to refer
693-
to a specific block and completely distinguishes a block from another.
694-
695-
``keccak256`` is a function that produces a 256 bit hash of any input.
696-
It also takes in any number of bytes as an input and produces a single
697-
hash for them. A hash is a completely unique output for a single input.
698-
So an input corresponds to one unique hash that can be used to identify
699-
the input exactly.
700-
701-
Prior to using the ``keccak256`` hash function, the header must be
702-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
703-
RLP encoding the header converts it into a space-efficient format that
704-
allows for easy transfer of data between nodes. The purpose of RLP is to
705-
encode arbitrarily nested arrays of binary data, and RLP is the primary
706-
encoding method used to serialize objects in Ethereum's execution layer.
707-
The only purpose of RLP is to encode structure; encoding specific data
708-
types (e.g. strings, floats) is left up to higher-order protocols.
709-
710-
Parameters
711-
----------
712-
header :
713-
Header of interest.
714-
715-
Returns
716-
-------
717-
hash : `ethereum.crypto.hash.Hash32`
718-
Hash of the header.
719-
"""
720-
return keccak256(rlp.encode(header))
721-
722-
723688
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
724689
"""
725690
Validates the gas limit for a block.

src/ethereum/frontier/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -668,41 +668,6 @@ def process_transaction(
668668
block_output.block_logs += tx_output.logs
669669

670670

671-
def compute_header_hash(header: Header) -> Hash32:
672-
"""
673-
Computes the hash of a block header.
674-
675-
The header hash of a block is the canonical hash that is used to refer
676-
to a specific block and completely distinguishes a block from another.
677-
678-
``keccak256`` is a function that produces a 256 bit hash of any input.
679-
It also takes in any number of bytes as an input and produces a single
680-
hash for them. A hash is a completely unique output for a single input.
681-
So an input corresponds to one unique hash that can be used to identify
682-
the input exactly.
683-
684-
Prior to using the ``keccak256`` hash function, the header must be
685-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
686-
RLP encoding the header converts it into a space-efficient format that
687-
allows for easy transfer of data between nodes. The purpose of RLP is to
688-
encode arbitrarily nested arrays of binary data, and RLP is the primary
689-
encoding method used to serialize objects in Ethereum's execution layer.
690-
The only purpose of RLP is to encode structure; encoding specific data
691-
types (e.g. strings, floats) is left up to higher-order protocols.
692-
693-
Parameters
694-
----------
695-
header :
696-
Header of interest.
697-
698-
Returns
699-
-------
700-
hash : `ethereum.crypto.hash.Hash32`
701-
Hash of the header.
702-
"""
703-
return keccak256(rlp.encode(header))
704-
705-
706671
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
707672
"""
708673
Validates the gas limit for a block.

src/ethereum/gray_glacier/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -805,41 +805,6 @@ def process_transaction(
805805
block_output.block_logs += tx_output.logs
806806

807807

808-
def compute_header_hash(header: Header) -> Hash32:
809-
"""
810-
Computes the hash of a block header.
811-
812-
The header hash of a block is the canonical hash that is used to refer
813-
to a specific block and completely distinguishes a block from another.
814-
815-
``keccak256`` is a function that produces a 256 bit hash of any input.
816-
It also takes in any number of bytes as an input and produces a single
817-
hash for them. A hash is a completely unique output for a single input.
818-
So an input corresponds to one unique hash that can be used to identify
819-
the input exactly.
820-
821-
Prior to using the ``keccak256`` hash function, the header must be
822-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
823-
RLP encoding the header converts it into a space-efficient format that
824-
allows for easy transfer of data between nodes. The purpose of RLP is to
825-
encode arbitrarily nested arrays of binary data, and RLP is the primary
826-
encoding method used to serialize objects in Ethereum's execution layer.
827-
The only purpose of RLP is to encode structure; encoding specific data
828-
types (e.g. strings, floats) is left up to higher-order protocols.
829-
830-
Parameters
831-
----------
832-
header :
833-
Header of interest.
834-
835-
Returns
836-
-------
837-
hash : `ethereum.crypto.hash.Hash32`
838-
Hash of the header.
839-
"""
840-
return keccak256(rlp.encode(header))
841-
842-
843808
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
844809
"""
845810
Validates the gas limit for a block.

src/ethereum/homestead/fork.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -668,41 +668,6 @@ def process_transaction(
668668
block_output.block_logs += tx_output.logs
669669

670670

671-
def compute_header_hash(header: Header) -> Hash32:
672-
"""
673-
Computes the hash of a block header.
674-
675-
The header hash of a block is the canonical hash that is used to refer
676-
to a specific block and completely distinguishes a block from another.
677-
678-
``keccak256`` is a function that produces a 256 bit hash of any input.
679-
It also takes in any number of bytes as an input and produces a single
680-
hash for them. A hash is a completely unique output for a single input.
681-
So an input corresponds to one unique hash that can be used to identify
682-
the input exactly.
683-
684-
Prior to using the ``keccak256`` hash function, the header must be
685-
encoded using the Recursive-Length Prefix. See :ref:`rlp`.
686-
RLP encoding the header converts it into a space-efficient format that
687-
allows for easy transfer of data between nodes. The purpose of RLP is to
688-
encode arbitrarily nested arrays of binary data, and RLP is the primary
689-
encoding method used to serialize objects in Ethereum's execution layer.
690-
The only purpose of RLP is to encode structure; encoding specific data
691-
types (e.g. strings, floats) is left up to higher-order protocols.
692-
693-
Parameters
694-
----------
695-
header :
696-
Header of interest.
697-
698-
Returns
699-
-------
700-
hash : `ethereum.crypto.hash.Hash32`
701-
Hash of the header.
702-
"""
703-
return keccak256(rlp.encode(header))
704-
705-
706671
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
707672
"""
708673
Validates the gas limit for a block.

0 commit comments

Comments
 (0)