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

Go API for EVM precompiles #385

Merged
merged 5 commits into from
Jun 12, 2024
Merged

Go API for EVM precompiles #385

merged 5 commits into from
Jun 12, 2024

Conversation

Vindaar
Copy link
Collaborator

@Vindaar Vindaar commented May 23, 2024

This continues from #383 by porting over the EVM precompiles C API into Go. All test cases are ported from Nim and should all pass.

@mratsim mratsim changed the base branch from goBlsApi to master May 27, 2024 11:18
@mratsim mratsim changed the base branch from master to goBlsApi May 27, 2024 11:18
Base automatically changed from goBlsApi to master June 6, 2024 14:22
Copy link
Owner

@mratsim mratsim left a comment

Choose a reason for hiding this comment

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

I think this is OK but large interference from #383 that needs a rebase.


// Ethereum BLS signatures
// -----------------------------------------------------
Copy link
Owner

Choose a reason for hiding this comment

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

@Vindaar
Copy link
Collaborator Author

Vindaar commented Jun 10, 2024

Woops, guess I screwed up the rebase I did. Will investigate.

Comment on lines +1420 to +1450
testDirEvm = "../tests/protocol_ethereum_evm_precompiles/"

modexp_tests = filepath.Join(testDirEvm, "modexp.json")
modexp_eip2565_tests = filepath.Join(testDirEvm, "modexp_eip2565.json")

bn256Add_tests = filepath.Join(testDirEvm, "bn256Add.json")
bn256ScalarMul_tests = filepath.Join(testDirEvm, "bn256ScalarMul.json")
bn256Pairing_tests = filepath.Join(testDirEvm, "bn256Pairing.json")

add_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/add_G1_bls.json")
fail_add_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-add_G1_bls.json")
add_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/add_G2_bls.json")
fail_add_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-add_G2_bls.json")

mul_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/mul_G1_bls.json")
fail_mul_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-mul_G1_bls.json")
mul_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/mul_G2_bls.json")
fail_mul_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-mul_G2_bls.json")

multiexp_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/multiexp_G1_bls.json")
fail_multiexp_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-multiexp_G1_bls.json")
multiexp_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/multiexp_G2_bls.json")
fail_multiexp_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-multiexp_G2_bls.json")

pairing_check_bls_tests = filepath.Join(testDirEvm, "eip-2537/pairing_check_bls.json")
fail_pairing_check_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-pairing_check_bls.json")

map_fp_to_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/map_fp_to_G1_bls.json")
fail_map_fp_to_G1_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-map_fp_to_G1_bls.json")
map_fp2_to_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/map_fp2_to_G2_bls.json")
fail_map_fp2_to_G2_bls_tests = filepath.Join(testDirEvm, "eip-2537/fail-map_fp2_to_G2_bls.json")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tabs are annoying. With 4 space width equivalent tabs the lines are aligned on the =...

Copy link
Owner

Choose a reason for hiding this comment

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

I agree, but gofmt dictatorship

@mratsim mratsim enabled auto-merge (squash) June 12, 2024 10:55
@mratsim mratsim disabled auto-merge June 12, 2024 11:26
@mratsim mratsim merged commit 6ca7cbf into master Jun 12, 2024
12 checks passed
@mratsim mratsim deleted the goEvmApi branch June 12, 2024 11:26
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