Skip to content

fix: remove spawn_blocking for payload_to_block conversions#636

Merged
ncitron merged 2 commits into
masterfrom
fix-ethereum-wasm
Jun 16, 2025
Merged

fix: remove spawn_blocking for payload_to_block conversions#636
ncitron merged 2 commits into
masterfrom
fix-ethereum-wasm

Conversation

@ncitron

@ncitron ncitron commented Jun 16, 2025

Copy link
Copy Markdown
Collaborator

Summary

  • Removed tokio::task::spawn_blocking usage in consensus module for payload_to_block conversions
  • Fixes WASM compatibility issues since spawn_blocking is not supported in WASM environments

Changes

  • consensus.rs: Removed spawn_blocking wrappers around payload_to_block calls
  • The function is now called directly, simplifying the code

Context

The tokio::task::spawn_blocking function is designed to move CPU-intensive work off the async runtime to dedicated threads. However, this functionality is not available in WASM environments which don't have access to OS-level threads. By removing these spawn_blocking calls, the code now works correctly in both native and WASM builds.

ncitron added 2 commits June 16, 2025 19:46
Removed the use of tokio::task::spawn_blocking for payload_to_block conversions in the consensus module. The payload_to_block function is now called directly instead of being wrapped in spawn_blocking tasks. This fixes WASM compatibility issues since spawn_blocking is not supported in WASM environments.

Also includes a minor formatting fix in helios-ts/index.html.
@ncitron ncitron merged commit a5dc6ee into master Jun 16, 2025
6 checks passed
@ncitron ncitron deleted the fix-ethereum-wasm branch June 16, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant