Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hathor/conf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def GENESIS_TX2_TIMESTAMP(self) -> int:
# List of soft voided transaction.
SOFT_VOIDED_TX_IDS: list[bytes] = []

# List of transactions to skip verification.
SKIP_VERIFICATION: list[bytes] = []

# Identifier used in metadata's voided_by to mark a tx as soft-voided.
SOFT_VOIDED_ID: bytes = b'tx-non-grata'

Expand Down Expand Up @@ -592,6 +595,12 @@ def _validate_tokens(genesis_tokens: int, values: dict[str, Any]) -> int:
allow_reuse=True,
each_item=True
)(parse_hex_str),
_parse_skipped_verification_tx_id=pydantic.validator(
'SKIP_VERIFICATION',
pre=True,
allow_reuse=True,
each_item=True
)(parse_hex_str),
_parse_checkpoints=pydantic.validator(
'CHECKPOINTS',
pre=True
Expand Down
3 changes: 3 additions & 0 deletions hathor/conf/testnet_hotel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ CHECKPOINTS:
4_200_000: 00000000010a8dae043c84fcb2cef6a2b42a28279b95af20ab5a098acf2a3565
4_300_000: 000000000019da781ef75fa5f59c5537d8ed18b64c589c3e036109cfb1d84f7d

SKIP_VERIFICATION:
- 00000000af8c95ca9aabf5fd90ac44bd4f16d182618c357b301370ad0430c4a3

FEATURE_ACTIVATION:
default_threshold: 15_120 # 15120 = 75% of evaluation_interval (20160)
features:
Expand Down
9 changes: 9 additions & 0 deletions hathor/verification/verification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def verify_basic(
"""Basic verifications (the ones without access to dependencies: parents+inputs). Raises on error.

Used by `self.validate_basic`. Should not modify the validation state."""
if vertex.hash in self._settings.SKIP_VERIFICATION:
return

self.verifiers.vertex.verify_version_basic(vertex)

# We assert with type() instead of isinstance() because each subclass has a specific branch.
Expand Down Expand Up @@ -165,6 +168,9 @@ def verify(self, vertex: BaseTransaction, params: VerificationParams) -> None:
"""Run all verifications. Raises on error.

Used by `self.validate_full`. Should not modify the validation state."""
if vertex.hash in self._settings.SKIP_VERIFICATION:
return

self.verifiers.vertex.verify_headers(vertex)

# We assert with type() instead of isinstance() because each subclass has a specific branch.
Expand Down Expand Up @@ -268,6 +274,9 @@ def _verify_token_creation_tx(self, tx: TokenCreationTransaction, params: Verifi
self.verifiers.token_creation_tx.verify_token_info(tx)

def verify_without_storage(self, vertex: BaseTransaction, params: VerificationParams) -> None:
if vertex.hash in self._settings.SKIP_VERIFICATION:
return

# We assert with type() instead of isinstance() because each subclass has a specific branch.
match vertex.version:
case TxVersion.REGULAR_BLOCK:
Expand Down