Skip to content

fix: restore pointEvaluation precompile (0x0a) in pre-Lisovo precompile sets#138

Open
Johnaverse wants to merge 1 commit into0xPolygon:release/3.2from
Johnaverse:fix/restore-point-evaluation-precompile
Open

fix: restore pointEvaluation precompile (0x0a) in pre-Lisovo precompile sets#138
Johnaverse wants to merge 1 commit into0xPolygon:release/3.2from
Johnaverse:fix/restore-point-evaluation-precompile

Conversation

@Johnaverse
Copy link
Copy Markdown

Summary

Restore the pointEvaluation precompile at address 0x0a in the pre-Lisovo Polygon PoS precompile sets to fix a consensus-breaking gas computation regression introduced by the LisovoPro changes.

Problem

Erigon v3.4.0 fails to validate Polygon PoS mainnet block 80,089,885 with a gas mismatch:

ERRO invalid block, txnIdx=143, gas used by execution: 31765558, in header: 31813153, headerNum=80089885

The computed gas is lower than the block header by 47,595 gas.

Root Cause

The pointEvaluation precompile at address 0x0a was removed from the pre-Lisovo precompile maps during the LisovoPro changes.

Affected sets:

  • Prague
  • Madhugiri
  • MadhugiriPro

Before Lisovo, calls to 0x0a must be treated as a precompile call. Removing it changes both:

  • gas accounting
  • execution semantics
  • active precompile warming behavior

As a result, calls to 0x0a are treated as ordinary calls to an empty account instead of the pointEvaluation precompile.

Fix

Restore pointEvaluation at address 0x0a in the affected pre-Lisovo precompile sets in contracts.go.

Also update regression coverage in contracts_test.go to assert that pointEvaluation remains available through Lisovo and is still absent in LisovoPro.

Why This Fix Is Narrow

This change only restores backward-compatible behavior for pre-Lisovo blocks.

It does not change the current LisovoPro behavior. Whether LisovoPro should also expose pointEvaluation remains a separate consensus decision.

Impact

This fixes sync and block re-execution for Polygon PoS on pre-Lisovo blocks in cases where transactions call address 0x0a.

Without this fix, nodes may fail validation at block 80,089,885 and potentially at other pre-Lisovo blocks with the same pattern.

Testing

  • Added regression coverage for Prague, Madhugiri, MadhugiriPro, Lisovo, and LisovoPro in contracts_test.go
  • Verified that the touched files are clean in editor diagnostics

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