Open natanasow opened 1 day ago
Attention: Patch coverage is 96.34146%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 84.82%. Comparing base (
ab8d06e
) to head (2b4efba
).
Files with missing lines | Patch % | Lines |
---|---|---|
...kages/config-service/src/services/loggerService.ts | 57.14% | 3 Missing :warning: |
0 tests 0 :heavy_check_mark: 0s :stopwatch: 0 suites 0 :zzz: 0 files 0 :x:
Results for commit 2b4efba7.
@AlfredoG87 @ebadiere please read the TODOs as well.
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Description:
When updating CI we noticed with the configuration updates, that if an environment variable such as
OPERATOR_ID
was defined with not value, it would override the values in the .env file. This caused tests to fail when the relay tried to submit a transaction. Ideally, the relay to fail fast, during bootstrap if required environment variables are not set.Solution:
Consolidate environment variable loading to the start of the relay. Fail to start if any required environment variables are not set. Better to fail fast.
All environment variables should be handled in one class that can also validate them, list their usage in a --help option, and exit appropriately if a validation fails.
We should also replace environment variables with a yml settings file.
Needed validations:
CHAIN_ID
,HEDERA_NETWORK
,MIRROR_NODE_URL
,OPERATOR_ID_MAIN
,OPERATOR_KEY_MAIN
,SERVER_PORT
are non-empty and in the expected formatOPERATOR_KEY_FORMAT
is not specified, the providedOPERATOR_KEY_MAIN
is in the DER formatHBAR_RATE_LIMIT_TINYBAR
is more thanHBAR_RATE_LIMIT_BASIC
,HBAR_RATE_LIMIT_EXTENDED
,HBAR_RATE_LIMIT_PRIVILEGED
Implementation Steps
There are several solid proposals by @AlfredoG87 that we should take into account as well. Described here https://github.com/hashgraph/hedera-json-rpc-relay/pull/2956#pullrequestreview-2338214042.
cc: @ebadiere
Related issue(s):
Fixes #3023
Notes for reviewer:
Checklist