Skip to content

fix: fix double_sign precompile return code #44

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

Merged
merged 3 commits into from
Jul 28, 2025

Conversation

will-2012
Copy link
Contributor

@will-2012 will-2012 commented Jul 25, 2025

Description

Fix double_sign precompile return code.

Rationale

Keep the same return code with

https://github.com/bnb-chain/revm/blob/d66170e712460ae766fc26a063f106658ce33e9d/crates/precompile/src/double_sign.rs#L95-L108

Example

Avoid this https://testnet.bscscan.com/tx/0x899592476081d65840828cc65b283c2835c15c6d9101c865dd5db07824bcd9bf execution inconsistency.

Changes

Notable changes:

  • double sign precompile related.

Copy link
Owner

@loocapro loocapro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: Instead of repeatedly using PrecompileError::other("invalid evidence"), could we define a specific variant like PrecompileError::InvalidEvidence?

use thiserror::Error;

#[derive(Debug, Error)]
pub enum PrecompileError {
    #[error("invalid evidence")]
    InvalidEvidence,
}

@will-2012
Copy link
Contributor Author

Nitpick: Instead of repeatedly using PrecompileError::other("invalid evidence"), could we define a specific variant like PrecompileError::InvalidEvidence?

use thiserror::Error;

#[derive(Debug, Error)]
pub enum PrecompileError {
    #[error("invalid evidence")]
    InvalidEvidence,
}

Sure, refined by 31c2457, pls help review again :D.

@will-2012 will-2012 requested a review from loocapro July 28, 2025 02:22
Copy link
Owner

@loocapro loocapro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@loocapro loocapro merged commit 5db30f6 into loocapro:main Jul 28, 2025
4 checks passed
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.

2 participants