Skip to content
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

no_std OP consensus rules #13683

Closed
emhane opened this issue Jan 6, 2025 · 2 comments · Fixed by #13684 or #13692
Closed

no_std OP consensus rules #13683

emhane opened this issue Jan 6, 2025 · 2 comments · Fixed by #13684 or #13692
Assignees
Labels
A-consensus Related to the consensus engine A-dependencies Pull requests or issues that are about dependencies A-op-reth Related to Optimism and op-reth

Comments

@emhane
Copy link
Member

emhane commented Jan 6, 2025

Describe the feature

Only OpBeaconConsensus rule set requires std (to use system time). Make the rest of the crate no_std compatible.

Additional context

No response

@emhane emhane added A-consensus Related to the consensus engine A-dependencies Pull requests or issues that are about dependencies A-op-reth Related to Optimism and op-reth labels Jan 6, 2025
@emhane emhane self-assigned this Jan 6, 2025
@mattsse
Copy link
Collaborator

mattsse commented Jan 6, 2025

I'm okay with removing this check:

// Check if timestamp is in the future. Clock can drift but this can be consensus issue.
let present_timestamp =
SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs();
if header.exceeds_allowed_future_timestamp(present_timestamp) {
return Err(ConsensusError::TimestampIsInFuture {
timestamp: header.timestamp,
present_timestamp,
})
}

this was taken from the eth impl and we can remove this entirely

@mattsse
Copy link
Collaborator

mattsse commented Jan 6, 2025

ref #13041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine A-dependencies Pull requests or issues that are about dependencies A-op-reth Related to Optimism and op-reth
Projects
Archived in project
2 participants