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

Gas price #26

Merged
merged 41 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
34eb900
Add docker container
vponline Oct 5, 2023
2ad1f75
Add docker run script
vponline Oct 5, 2023
2d0a1bd
Resolve conflicts
vponline Oct 5, 2023
0ecf394
Fix readme
vponline Oct 5, 2023
9a84e0d
Add gas price strategy
vponline Oct 9, 2023
e8ab81a
Fix conflict
vponline Oct 9, 2023
99257f7
Fix getting percentile price, add unit tests, clean up
vponline Oct 10, 2023
d08bb52
Fix schema tests
vponline Oct 10, 2023
0d3bcf7
Add e2e tests
vponline Oct 11, 2023
f427c22
Fix lint
vponline Oct 11, 2023
1b4ef78
Ignore console.log
vponline Oct 11, 2023
a8e965a
Add gas collector loop, refactor clearing expired prices
vponline Oct 12, 2023
cbd8f99
Fix lint
vponline Oct 12, 2023
e7f207f
Add jsdoc
vponline Oct 12, 2023
24ad22c
Add todos
vponline Oct 12, 2023
b8d3b03
Remove comment, add positive check to gasSettings zod schema
vponline Oct 13, 2023
e8c714d
Add gasCollectorInterval
vponline Oct 13, 2023
700fa4e
Resolve conflicts
vponline Oct 13, 2023
edf75e2
Fix workflow e2e test name
vponline Oct 16, 2023
4e7c052
Fix eslint rules and apply
vponline Oct 17, 2023
5079628
Fix prettier
vponline Oct 17, 2023
9f17b99
Fix jest configs
vponline Oct 17, 2023
34c3608
Store gas by provider, apply scaling formula
vponline Oct 20, 2023
b580698
Separate loop and calculating price
vponline Oct 20, 2023
2bd66c6
Fix tests
vponline Oct 23, 2023
968a599
Add final tests
vponline Oct 23, 2023
7aa8a55
Remove gas interval
vponline Oct 23, 2023
67e4031
Resolve conflicts
vponline Oct 23, 2023
8c43f88
Fix lint
vponline Oct 23, 2023
4364c19
Fix package-json
vponline Oct 23, 2023
a3a8bfc
Fix eslint
vponline Oct 23, 2023
ea481ff
Refactoring, rename fields
vponline Oct 24, 2023
6038edf
Fix prettier
vponline Oct 24, 2023
4fb0273
Remove unnecessary check
vponline Oct 24, 2023
a2a8e23
Remove getGasPrice retries
vponline Oct 24, 2023
c7f4f30
Fix prettier, add check for internal PRs
vponline Oct 24, 2023
4bb9c01
Add gasSettings to README
vponline Oct 24, 2023
a129cfd
Add check for sufficient sanitization data
vponline Oct 25, 2023
49dff92
Merge states
vponline Oct 25, 2023
422671f
Move scripts
vponline Oct 26, 2023
9fb9b83
Resolve conflicts
vponline Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,31 @@ jobs:
run: pnpm run prettier:check && pnpm run eslint:check
- name: Test
run: pnpm run test

test-e2e:
name: Test e2e
runs-on: ubuntu-latest
# Don't run twice for a push within an internal PR
vponline marked this conversation as resolved.
Show resolved Hide resolved
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
timeout-minutes: 10
steps:
- name: Clone
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Start Hardhat
run: pnpm dev:eth-node&
- name: Test E2E
run: pnpm test:e2e

required-checks-passed:
name: All required checks passed
runs-on: ubuntu-latest
needs: [documentation, lint-build-test]
needs: [documentation, lint-build-test, e2e]
steps:
- run: exit 0
7 changes: 7 additions & 0 deletions config/airseeker.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
"hardhat": {
"url": "${HARDHAT_PROVIDER_URL}"
}
},
"gasSettings": {
"recommendedGasPriceMultiplier": 1.5,
"sanitizationSamplingWindow": 15,
"sanitizationPercentile": 80,
"scalingWindow": 2,
"scalingMultiplier": 2
}
}
},
Expand Down
13 changes: 13 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { HardhatUserConfig } from 'hardhat/types';
import '@nomiclabs/hardhat-ethers';

const config: HardhatUserConfig = {
networks: {
localhost: {
url: 'http://127.0.0.1:8545/',
},
},
defaultNetwork: 'localhost',
};

export default config;
7 changes: 7 additions & 0 deletions jest-e2e.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = require('./jest.config');

module.exports = {
...config,
displayName: 'e2e',
testMatch: ['**/?(*.)+(feature).[t]s?(x)'],
};
7 changes: 7 additions & 0 deletions jest-unit.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = require('./jest.config');

module.exports = {
...config,
displayName: 'unit',
testMatch: ['**/?(*.)+(spec|test).[t]s?(x)'],
};
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { join } = require('path');
* https://jestjs.io/docs/configuration
*/
module.exports = {
projects: ['<rootDir>/jest-e2e.config.js', '<rootDir>/jest-unit.config.js'],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
"dependencies": {
"@api3/airnode-protocol-v1": "^2.10.0",
"@api3/promise-utils": "^0.4.0",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"dotenv": "^16.3.1",
"ethers": "^5.7.2",
"hardhat": "^2.18.0",
"lodash": "^4.17.21",
"zod": "^3.22.2"
},
Expand All @@ -45,9 +47,11 @@
"eslint:fix": "eslint . --ext .js,.ts --fix",
"prettier:check": "prettier --check \"./**/*.{js,ts,md,json}\"",
"prettier:fix": "prettier --write \"./**/*.{js,ts,md,json}\"",
"test": "jest",
"test": "jest --selectProjects unit --verbose --runInBand --bail --detectOpenHandles --silent",
"test:e2e": "jest --selectProjects e2e --runInBand",
"tsc": "tsc --project .",
"docker:build": "docker build -t api3/airseekerv2:latest -f docker/Dockerfile .",
"docker:run": "docker run -it --rm api3/airseekerv2:latest"
"docker:run": "docker run -it --rm api3/airseekerv2:latest",
"dev:eth-node": "hardhat node"
}
}
Loading