Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

feat: add precompile skeleton #128

Merged
merged 1 commit into from
Jul 26, 2023
Merged

feat: add precompile skeleton #128

merged 1 commit into from
Jul 26, 2023

Conversation

vlopes11
Copy link

Description

This commit introduces the support for precompiled contracts. For more information, check the appendix E of the Ethereum Yellow Paper.

It is a simplified version of the identity precompile PR of PSE. It strips the implementation of the identity precompile variant, leaving only the skeleton for the lookup table calls.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Contents

This commit introduces the support for precompiled contracts. For more
information, check the appendix E of the Ethereum Yellow Paper.

It is a simplified version of the identity precompile PR of PSE. It
strips the implementation of the identity precompile variant, leaving
only the skeleton for the lookup table calls.

[Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf)
[Identity (dataCopy) precompile privacy-scaling-explorations#1396](privacy-scaling-explorations#1396)
@Brechtpd
Copy link

Looks good!

There's a problem with the PSE super circuit failing when I tested using make test-all:

test super_circuit::test::serial_test_super_circuit_1tx_1max_tx ... [2023-07-25T20:06:12Z ERROR zkevm_circuits::super_circuit::test] Verification failures: [
        Lookup keccak(index: 130) is not satisfied in Region 13 ('signature address verify') at offset 74,
        Lookup keccak256_table_lookup(cur.value_rlc, cur.length, cur.hash)(index: 132) is not satisfied in Region 9 ('assign bytecode') at offset 2,
    ]
FAILED
test super_circuit::test::serial_test_super_circuit_1tx_2max_tx ... [2023-07-25T20:06:56Z ERROR zkevm_circuits::super_circuit::test] Verification failures: [
        Lookup keccak(index: 130) is not satisfied in Region 13 ('signature address verify') at offset 74,
        Lookup keccak256_table_lookup(cur.value_rlc, cur.length, cur.hash)(index: 132) is not satisfied in Region 9 ('assign bytecode') at offset 3,
    ]
FAILED
test super_circuit::test::serial_test_super_circuit_2tx_2max_tx ... [2023-07-25T20:07:38Z ERROR zkevm_circuits::super_circuit::test] Verification failures: [
        Lookup keccak(index: 130) is not satisfied in Region 13 ('signature address verify') at offset 74,
        Lookup keccak(index: 130) is not satisfied in Region 13 ('signature address verify') at offset 150,
        Lookup keccak256_table_lookup(cur.value_rlc, cur.length, cur.hash)(index: 132) is not satisfied in Region 9 ('assign bytecode') at offset 3,
    ]
FAILED

The Taiko super circuit works, Do you have an idea @johntaiko, may be similar to a previous problem? I haven't look into the problem in detail, I will also do so if the problem is unknown.

@Brechtpd
Copy link

Ah the error does not seem to be related to this PR. Will confirm, will merge the PR in main afterwards if so

@Brechtpd Brechtpd merged commit 3620c07 into main Jul 26, 2023
@vlopes11 vlopes11 deleted the vlopes11/precompile-base branch July 26, 2023 11:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants