Skip to content

fix: return G2NotInSubgroup for G2 subgroup check failure#3179

Closed
Fibonacci747 wants to merge 1 commit intobluealloy:mainfrom
Fibonacci747:fix/arkworks-g2
Closed

fix: return G2NotInSubgroup for G2 subgroup check failure#3179
Fibonacci747 wants to merge 1 commit intobluealloy:mainfrom
Fibonacci747:fix/arkworks-g2

Conversation

@Fibonacci747
Copy link
Copy Markdown
Contributor

The arkworks backend returned Bls12381G1NotInSubgroup from read_g2() when the G2 subgroup check failed. This was inconsistent with both the logical context (G2 subgroup validation) and the blst backend, which correctly returns Bls12381G2NotInSubgroup. Aligning the error variant ensures consistent behavior across backends, corrects diagnostics for callers that rely on precise error reporting, and matches EIP-2537 expectations where MSM and pairing must enforce subgroup checks for their respective groups.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 16, 2025

CodSpeed Performance Report

Merging #3179 will not alter performance

Comparing Fibonacci747:fix/arkworks-g2 (ea9efea) with main (0d424ba)

Summary

✅ 173 untouched

@rakita rakita added the ai-bot label Nov 17, 2025
@rakita
Copy link
Copy Markdown
Member

rakita commented Nov 17, 2025

Will be merged later

@rakita rakita closed this Nov 17, 2025
rakita added a commit that referenced this pull request Jan 9, 2026
This commit consolidates improvements from 8 community PRs with the ai-bot label:

- fix: correct debug log for blob gas fields in blockchaintest (#3291)
  Split blob_excess_gas_and_price into separate debug outputs for clarity

- perf(state): remove redundant clones in account_info.rs (#3287)
  Eliminate unnecessary clone operations in test code

- docs: fix duplicate word in MIGRATION_GUIDE.md (#3209)
  Remove duplicate "allows" in PrecompileError documentation

- fix: return G2NotInSubgroup for G2 subgroup check failure (#3179)
  Correct error type from G1NotInSubgroup to G2NotInSubgroup in BLS12-381

- refactor: reuse bound tx and remove redundant context.tx() calls (#3176)
  Optimize validation by reusing transaction binding

- docs: fix incorrect reth references in blockchain.rs comments (#3169)
  Update comments to use correct terminology instead of "reth"

- perf: use lazy defaults for env vars in burntpix benchmark (#3071)
  Replace unwrap_or with unwrap_or_else to avoid unnecessary allocations

All changes have been tested with cargo check and cargo test.
@rakita rakita removed the ai-bot label Jan 9, 2026
rakita added a commit that referenced this pull request Jan 9, 2026
* chore: apply improvements from ai-bot labeled PRs

This commit consolidates improvements from 8 community PRs with the ai-bot label:

- fix: correct debug log for blob gas fields in blockchaintest (#3291)
  Split blob_excess_gas_and_price into separate debug outputs for clarity

- perf(state): remove redundant clones in account_info.rs (#3287)
  Eliminate unnecessary clone operations in test code

- docs: fix duplicate word in MIGRATION_GUIDE.md (#3209)
  Remove duplicate "allows" in PrecompileError documentation

- fix: return G2NotInSubgroup for G2 subgroup check failure (#3179)
  Correct error type from G1NotInSubgroup to G2NotInSubgroup in BLS12-381

- refactor: reuse bound tx and remove redundant context.tx() calls (#3176)
  Optimize validation by reusing transaction binding

- docs: fix incorrect reth references in blockchain.rs comments (#3169)
  Update comments to use correct terminology instead of "reth"

- perf: use lazy defaults for env vars in burntpix benchmark (#3071)
  Replace unwrap_or with unwrap_or_else to avoid unnecessary allocations

All changes have been tested with cargo check and cargo test.

* fmt
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