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

fix: Improve compatibility with standard ethereum tooling #2649

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

konstantinabl
Copy link
Collaborator

@konstantinabl konstantinabl commented Jul 2, 2024

Description:

Currently, our validation process only checks the presence of fields returned by our API, without verifying the format of these fields. This can lead to inconsistencies and potential errors.

Changes introduced:

  • Adds separate CI workflow for API conformity
  • Pulls the openrpc.json from execution-apis repo in order to validate our response against it

Related issue(s):

Fixes #2108

@konstantinabl konstantinabl linked an issue Jul 2, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jul 2, 2024

Tests

       3 files     197 suites   15s ⏱️
   993 tests    992 ✔️ 1 💤 0
1 006 runs  1 005 ✔️ 1 💤 0

Results for commit 583839f.

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch from fd097d9 to 1505dde Compare July 2, 2024 10:32
@konstantinabl konstantinabl changed the title Improve compatibility with standard ethereum tooling fix: Improve compatibility with standard ethereum tooling Jul 2, 2024
@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch from 1505dde to 0bb7a2f Compare July 2, 2024 10:43
Copy link

github-actions bot commented Jul 2, 2024

Acceptance Tests

  21 files  294 suites   33m 25s ⏱️
599 tests 586 ✔️ 4 💤   9
910 runs  894 ✔️ 4 💤 12

Results for commit 583839f.

♻️ This comment has been updated with latest results.

@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch 4 times, most recently from d10956d to 777a5d5 Compare July 3, 2024 14:59
@konstantinabl konstantinabl added the enhancement New feature or request label Jul 5, 2024
@konstantinabl konstantinabl marked this pull request as ready for review July 18, 2024 13:08
Copy link
Collaborator

@georgi-l95 georgi-l95 left a comment

Choose a reason for hiding this comment

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

LG, after this we can write some custom tests for the schema. aside from Jeromy comments, i think it looks okay. @Nana-EC has to modify the checks when this is approved in order to be merged.

@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch 2 times, most recently from ad4382d to 824ed40 Compare July 22, 2024 12:54
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
…-apis

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
…c; Adds file name in test header;Excludes dir from tests

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
This reverts commit 38f712e.

Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch from db30f68 to adb87ac Compare August 9, 2024 13:10
Signed-off-by: Konstantina Blazhukova <konstantina.blajukova@gmail.com>
@konstantinabl konstantinabl force-pushed the 2108-research-improve-compatility-with-standard-ethereum-tooling branch from de0a650 to 583839f Compare August 9, 2024 13:36
Copy link

sonarcloud bot commented Aug 9, 2024

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.11%. Comparing base (f55251e) to head (583839f).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2649       +/-   ##
===========================================
+ Coverage   44.11%   84.11%   +40.00%     
===========================================
  Files          44       46        +2     
  Lines        3409     3457       +48     
  Branches      727      734        +7     
===========================================
+ Hits         1504     2908     +1404     
+ Misses       1651      326     -1325     
+ Partials      254      223       -31     
Flag Coverage Δ
relay 79.80% <ø> (?)
server 81.56% <100.00%> (?)
ws-server 97.87% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/server/src/validator/constants.ts 100.00% <100.00%> (ø)
packages/server/src/validator/methods.ts 100.00% <ø> (ø)
packages/server/src/validator/types.ts 96.77% <100.00%> (+66.77%) ⬆️

... and 34 files with indirect coverage changes

Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Great work! Just some suggestions and comments

@@ -38,7 +38,7 @@
"axios-retry": "^3.5.1",
"chai": "^4.3.6",
"ethers": "^6.7.0",
"execution-apis": "git://github.com/ethereum/execution-apis.git#584905270d8ad665718058060267061ecfd79ca5",
"execution-apis": "git://github.com/ethereum/execution-apis.git#7907424db935b93c2fe6a3c0faab943adebe8557",
Copy link
Member

Choose a reason for hiding this comment

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

just being curious, where did you get this updated number?

@@ -5,6 +5,8 @@ const directoryPath = path.resolve(__dirname, '../../../../node_modules/executio
const axios = require('axios');
Copy link
Member

Choose a reason for hiding this comment

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

This file is missing header license

/*-
/*-
 *
 * Hedera JSON RPC Relay
 *
 * Copyright (C) 2022-2024 Hedera Hashgraph, LLC
 * ...

@@ -5,6 +5,8 @@ const directoryPath = path.resolve(__dirname, '../../../../node_modules/executio
const axios = require('axios');
const openRpcData = require('../../../../docs/openrpc.json');
require('dotenv').config();
import Ajv from 'ajv';
import addFormats from 'ajv-formats';
Copy link
Member

Choose a reason for hiding this comment

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

my editor says it cannot find this module, ajv-formats.

image

@@ -5,6 +5,8 @@ const directoryPath = path.resolve(__dirname, '../../../../node_modules/executio
const axios = require('axios');
const openRpcData = require('../../../../docs/openrpc.json');
require('dotenv').config();
import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import { signTransaction } from '../../../relay/tests/helpers';
import { expect } from 'chai';
let currentBlockHash;
Copy link
Member

Choose a reason for hiding this comment

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

Please clean up this session. I noticed that both import and require syntaxes are being used for importing dependencies. To conform to ES6 standards, please use import instead of require. Additionally, let's improve readability by adding some empty lines between the imports section and the variable declaration section.

@quiet-node quiet-node modified the milestones: 0.53.0, 0.55.0 Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Research: Improve compatility with standard Ethereum tooling
6 participants