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

feat: config rpc #88

Merged
merged 7 commits into from
Sep 12, 2023
Merged

feat: config rpc #88

merged 7 commits into from
Sep 12, 2023

Conversation

0xSulpiride
Copy link
Member

Description

  • feat: added new rpc method skandha_config

Sample request:

curl --location 'http://localhost:14337/1337/' \
--header 'Content-Type: application/json' \
--data '{
    "id": 3,
    "method": "skandha_config",
    "params": [],
    "jsonrpc": "2.0"
}'

Response:

{
    "jsonrpc": "2.0",
    "id": 3,
    "result": {
        "flags": {
            "unsafeMode": false,
            "testingMode": false,
            "redirectRpc": true
        },
        "entryPoints": [
            "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
        ],
        "beneficiary": "0x7072475dF8EB2F9A9C8e7640141f08632f14BC4C",
        "relayer": "0x7743d0ec8F1f848dC76E21A18dC5b478F7d87b6e",
        "minInclusionDenominator": 10,
        "throttlingSlack": 10,
        "banSlack": 10,
        "minSignerBalance": "0.1 eth",
        "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
        "estimationStaticBuffer": 21000,
        "validationGasLimit": 10000000,
        "receiptLookupRange": 1024,
        "etherscanApiKey": false,
        "conditionalTransactions": false,
        "rpcEndpointSubmit": false,
        "gasPriceMarkup": 0,
        "enforceGasPrice": false,
        "enforceGasPriceThreshold": 1000
    }
}

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (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)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Further comments (optional)

Copy link
Member

@arddluma arddluma left a comment

Choose a reason for hiding this comment

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

Could you please check as it fails when running --testingMode. Not sure if it is related to this endpoint tho.

✖ TypeError: Cannot read properties of undefined (reading 'minInclusionDenominator')

@arddluma arddluma force-pushed the config-rpc branch 2 times, most recently from 876f842 to cd1b239 Compare September 12, 2023 12:32
case CustomRPCMethods.skandha_config:
result = await skandhaApi.getConfig();
// skip hexlify for this particular rpc
return res.status(200).send({
Copy link
Member

Choose a reason for hiding this comment

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

Can we pls avoid hardcoding and move the http status codes and messages to a common constants file?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@0xSulpiride 0xSulpiride merged commit 1d6f494 into master Sep 12, 2023
3 checks passed
@0xSulpiride 0xSulpiride deleted the config-rpc branch September 12, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants