Repository navigation
Rafal/fix hscale deployment #1342
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
Changes from all commits
6ee8224
e1af102
7fbca4f
0e3c61c
eb8e9ca
cab942f
eb388ee
27a8120
d7cf210
ba31a27
f492f97
27935cf
35715a9
8a0e6f9
09f4d43
b568f18
9236b62
c1d248d
1220c4b
4bedf3c
e1263b1
3f91499
4f10fc3
965d9da
5aaf83d
2a50687
486cf90
2545d4a
52122ab
99f7e38
7d35fa3
bbc3d93
fe85b76
7241733
a91f014
1582f8a
a9db8ff
b20609c
1d3ff67
079aa25
f6cdce8
c9e517f
27a1918
a0955fc
bb5efe9
f8f806a
0e87a65
c8369b2
b02fb1f
8e53027
0ac6761
2144383
c92db6b
1f6bd36
90352fb
5482ff6
1fde575
6fe5ebd
395e73e
0953f82
b42523d
0f9423c
67cce5d
2b96558
c0a0a91
74b3dd6
54ed831
27c867d
2f4b6ef
88cd1e5
3d85cfe
28e6af6
3546b53
d3887dd
d9536af
b906eb7
98fb7b4
2e9c6c5
d4de871
a16914d
2ed32a5
0ebd12d
217eda5
235848e
390cc5c
2d1cb86
16ed278
4b23d91
43897b6
f1ce499
c76e3c0
24d1da9
c8badcd
d1d40bd
0173b06
f5677ae
438533a
28eadc6
9edfa56
ed0fc13
7042f60
1a7ec79
b7e6038
a8a499f
18b726f
41d855e
abc6753
90e24cb
d8be379
bbcdcc9
1e71986
41289a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,9 +195,10 @@ def _generate_transaction_hash( | |
| to_bytes(hexstr=to_address) if is_address(to_address) else b"\x00" * 20 | ||
| ) | ||
|
|
||
| # Use current timestamp to mimic block.timestamp | ||
| timestamp = int(time.time()) | ||
| timestamp_bytes = timestamp.to_bytes(32, byteorder="big", signed=False) | ||
| # Use current timestamp with microsecond precision to ensure uniqueness | ||
| timestamp = time.time() | ||
| timestamp_int = int(timestamp * 1_000_000) # Convert to microseconds as integer | ||
| timestamp_bytes = timestamp_int.to_bytes(32, byteorder="big", signed=False) | ||
|
|
||
| # Derive a deterministic pseudo-random seed from the recipient address | ||
| seed_source = f"{to_address or '0x0'}:{timestamp}" | ||
|
Comment on lines
+198
to
204
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use consistent timestamp precision in seed_source. The timestamp handling uses microsecond precision ( Apply this diff for consistency: # Use current timestamp with microsecond precision to ensure uniqueness
timestamp = time.time()
timestamp_int = int(timestamp * 1_000_000) # Convert to microseconds as integer
timestamp_bytes = timestamp_int.to_bytes(32, byteorder="big", signed=False)
# Derive a deterministic pseudo-random seed from the recipient address
-seed_source = f"{to_address or '0x0'}:{timestamp}"
+seed_source = f"{to_address or '0x0'}:{timestamp_int}"🤖 Prompt for AI Agents |
||
|
|
@@ -290,7 +291,10 @@ def insert_transaction( | |
| def _process_round_data(self, transaction_data: dict) -> dict: | ||
| """Process round data and prepare transaction data.""" | ||
|
|
||
| if "consensus_results" in transaction_data["consensus_history"]: | ||
| if ( | ||
| transaction_data["consensus_history"] is not None | ||
| and "consensus_results" in transaction_data["consensus_history"] | ||
| ): | ||
| transaction_data["num_of_rounds"] = str( | ||
| len(transaction_data["consensus_history"]["consensus_results"]) | ||
| ) | ||
|
|
@@ -301,7 +305,10 @@ def _process_round_data(self, transaction_data: dict) -> dict: | |
| validator_votes = [] | ||
| validator_votes_hash = [] | ||
| round_validators = [] | ||
| if "consensus_results" in transaction_data["consensus_history"]: | ||
| if ( | ||
| transaction_data["consensus_history"] is not None | ||
| and "consensus_results" in transaction_data["consensus_history"] | ||
| ): | ||
| round_number = str( | ||
| len(transaction_data["consensus_history"]["consensus_results"]) - 1 | ||
| ) | ||
|
|
@@ -380,7 +387,10 @@ def _prepare_basic_transaction_data(self, transaction_data: dict) -> dict: | |
| "processing_block": "0", | ||
| "proposal_block": "0", | ||
| } | ||
| if "consensus_results" in transaction_data["consensus_history"]: | ||
| if ( | ||
| transaction_data["consensus_history"] is not None | ||
| and "consensus_results" in transaction_data["consensus_history"] | ||
| ): | ||
| transaction_data["activator"] = transaction_data["consensus_history"][ | ||
| "consensus_results" | ||
| ][0]["leader_result"][0]["node_config"]["address"] | ||
|
|
@@ -443,6 +453,7 @@ def _process_messages(self, transaction_data: dict) -> dict: | |
| eq_output = [] | ||
| if ( | ||
| "consensus_history" in transaction_data | ||
| and transaction_data["consensus_history"] is not None | ||
| and "consensus_results" in transaction_data["consensus_history"] | ||
| ): | ||
| for consensus_round in transaction_data["consensus_history"][ | ||
|
|
||
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.
Health check: avoid task.result() and blind except; handle cancellation separately.
Calling result() re-raises and forced a blind except (BLE001). Use cancelled()/exception() to inspect safely; treat cancellation as “stopping,” not “failed.” As per static analysis hints.
🧰 Tools
🪛 Ruff (0.14.0)
187-187: Do not catch blind exception:
Exception(BLE001)
🤖 Prompt for AI Agents