From 0d757fd9c2a51fbf25009abb3048f2e10c26b259 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Mon, 11 Sep 2023 15:10:57 +0500 Subject: [PATCH 1/6] feat: config rpc --- packages/api/src/app.ts | 8 +++ packages/api/src/constants.ts | 1 + packages/api/src/modules/skandha.ts | 9 +++- packages/cli/src/cmds/start/handler.ts | 2 + packages/executor/src/config.ts | 2 + packages/executor/src/executor.ts | 2 +- packages/executor/src/interfaces.ts | 1 + packages/executor/src/modules/skandha.ts | 68 ++++++++++++++++++++++-- packages/types/src/api/interfaces.ts | 25 +++++++++ 9 files changed, 111 insertions(+), 7 deletions(-) diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index 76569f24..f9d97efc 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -190,6 +190,14 @@ export class ApiApp { case CustomRPCMethods.skandha_getGasPrice: result = await skandhaApi.getGasPrice(); break; + case CustomRPCMethods.skandha_config: + result = await skandhaApi.getConfig(); + // skip hexlify for this particular rpc + return res.status(200).send({ + jsonrpc, + id, + result, + }); default: throw new RpcError( `Method ${method} is not supported`, diff --git a/packages/api/src/constants.ts b/packages/api/src/constants.ts index 9651022c..a25a43ed 100644 --- a/packages/api/src/constants.ts +++ b/packages/api/src/constants.ts @@ -1,6 +1,7 @@ export const CustomRPCMethods = { skandha_validateUserOperation: "skandha_validateUserOperation", skandha_getGasPrice: "skandha_getGasPrice", + skandha_config: "skandha_config", }; export const BundlerRPCMethods = { diff --git a/packages/api/src/modules/skandha.ts b/packages/api/src/modules/skandha.ts index fec09a54..50d5e906 100644 --- a/packages/api/src/modules/skandha.ts +++ b/packages/api/src/modules/skandha.ts @@ -1,5 +1,8 @@ import { Eth } from "executor/lib/modules/eth"; -import { GetGasPriceResponse } from "types/lib/api/interfaces"; +import { + GetConfigResponse, + GetGasPriceResponse, +} from "types/lib/api/interfaces"; import { Skandha } from "executor/lib/modules"; import { RpcMethodValidator } from "../utils/RpcMethodValidator"; import { SendUserOperationGasArgs } from "../dto/SendUserOperation.dto"; @@ -22,4 +25,8 @@ export class SkandhaAPI { async getGasPrice(): Promise { return await this.skandhaModule.getGasPrice(); } + + async getConfig(): Promise { + return await this.skandhaModule.getConfig(); + } } diff --git a/packages/cli/src/cmds/start/handler.ts b/packages/cli/src/cmds/start/handler.ts index 10868d05..dc263e37 100644 --- a/packages/cli/src/cmds/start/handler.ts +++ b/packages/cli/src/cmds/start/handler.ts @@ -29,6 +29,7 @@ export async function bundlerHandler( networks: configOptions.networks, testingMode, unsafeMode, + redirectRpc, }); } catch (err) { logger.debug("Config file not found. Proceeding with env vars..."); @@ -36,6 +37,7 @@ export async function bundlerHandler( networks: {}, testingMode, unsafeMode, + redirectRpc, }); } diff --git a/packages/executor/src/config.ts b/packages/executor/src/config.ts index 26b79943..d3af964a 100644 --- a/packages/executor/src/config.ts +++ b/packages/executor/src/config.ts @@ -13,12 +13,14 @@ export class Config { networks: Networks; testingMode: boolean; unsafeMode: boolean; + redirectRpc: boolean; constructor(private config: ConfigOptions) { this.supportedNetworks = this.parseSupportedNetworks(); this.networks = this.parseNetworkConfigs(); this.testingMode = config.testingMode ?? false; this.unsafeMode = config.unsafeMode ?? false; + this.redirectRpc = config.redirectRpc ?? false; } getNetworkProvider(network: NetworkName): providers.JsonRpcProvider | null { diff --git a/packages/executor/src/executor.ts b/packages/executor/src/executor.ts index 6a8a73db..b012043f 100644 --- a/packages/executor/src/executor.ts +++ b/packages/executor/src/executor.ts @@ -103,7 +103,7 @@ export class Executor { this.skandha = new Skandha( this.network, this.provider, - this.networkConfig, + this.config, this.logger ); diff --git a/packages/executor/src/interfaces.ts b/packages/executor/src/interfaces.ts index dcadab03..86d7e0e0 100644 --- a/packages/executor/src/interfaces.ts +++ b/packages/executor/src/interfaces.ts @@ -142,6 +142,7 @@ export interface ConfigOptions { networks: Networks; testingMode?: boolean; unsafeMode: boolean; + redirectRpc: boolean; } export interface SlotMap { diff --git a/packages/executor/src/modules/skandha.ts b/packages/executor/src/modules/skandha.ts index 9459d17b..70ab8d07 100644 --- a/packages/executor/src/modules/skandha.ts +++ b/packages/executor/src/modules/skandha.ts @@ -1,27 +1,39 @@ import { BigNumber, ethers } from "ethers"; import { NetworkName } from "types/lib"; -import { GetGasPriceResponse } from "types/lib/api/interfaces"; +import { + GetConfigResponse, + GetGasPriceResponse, +} from "types/lib/api/interfaces"; import RpcError from "types/lib/api/errors/rpc-error"; import * as RpcErrorCodes from "types/lib/api/errors/rpc-error-codes"; import { GasPriceMarkupOne } from "params/lib"; import { getGasFee } from "params/lib"; import { Logger, NetworkConfig } from "../interfaces"; +import { Config } from "../config"; // custom features of Skandha export class Skandha { + networkConfig: NetworkConfig; + constructor( private networkName: NetworkName, private provider: ethers.providers.JsonRpcProvider, - private config: NetworkConfig, + private config: Config, private logger: Logger - ) {} + ) { + const networkConfig = this.config.getNetworkConfig(this.networkName); + if (!networkConfig) { + throw new Error("No network config"); + } + this.networkConfig = networkConfig; + } async getGasPrice(): Promise { - const multiplier = this.config.gasPriceMarkup; + const multiplier = this.networkConfig.gasPriceMarkup; const gasFee = await getGasFee( this.networkName, this.provider, - this.config.etherscanApiKey + this.networkConfig.etherscanApiKey ); let { maxPriorityFeePerGas, maxFeePerGas } = gasFee; @@ -51,4 +63,50 @@ export class Skandha { maxFeePerGas, }; } + + async getConfig(): Promise { + const wallet = this.config.getRelayer(this.networkName); + const hasEtherscanApiKey = Boolean(this.networkConfig.etherscanApiKey); + const hasExecutionRpc = Boolean(this.networkConfig.rpcEndpointSubmit); + return { + flags: { + unsafeMode: this.config.unsafeMode, + testingMode: this.config.testingMode, + redirectRpc: this.config.redirectRpc, + }, + entryPoints: this.networkConfig.entryPoints, + beneficiary: this.networkConfig.beneficiary, + relayer: wallet ? await wallet.getAddress() : "", + minInclusionDenominator: BigNumber.from( + this.networkConfig.minInclusionDenominator + ).toNumber(), + throttlingSlack: BigNumber.from( + this.networkConfig.throttlingSlack + ).toNumber(), + banSlack: BigNumber.from(this.networkConfig.banSlack).toNumber(), + minSignerBalance: `${ethers.utils.formatEther( + this.networkConfig.minSignerBalance + )} eth`, + multicall: this.networkConfig.multicall, + estimationStaticBuffer: BigNumber.from( + this.networkConfig.estimationStaticBuffer + ).toNumber(), + validationGasLimit: BigNumber.from( + this.networkConfig.validationGasLimit + ).toNumber(), + receiptLookupRange: BigNumber.from( + this.networkConfig.receiptLookupRange + ).toNumber(), + etherscanApiKey: hasEtherscanApiKey, + conditionalTransactions: this.networkConfig.conditionalTransactions, + rpcEndpointSubmit: hasExecutionRpc, + gasPriceMarkup: BigNumber.from( + this.networkConfig.gasPriceMarkup + ).toNumber(), + enforceGasPrice: this.networkConfig.enforceGasPrice, + enforceGasPriceThreshold: BigNumber.from( + this.networkConfig.enforceGasPriceThreshold + ).toNumber(), + }; + } } diff --git a/packages/types/src/api/interfaces.ts b/packages/types/src/api/interfaces.ts index d5c745da..6bb6469c 100644 --- a/packages/types/src/api/interfaces.ts +++ b/packages/types/src/api/interfaces.ts @@ -38,6 +38,31 @@ export type UserOperationReceipt = { receipt: providers.TransactionReceipt; }; +export type GetConfigResponse = { + flags: { + redirectRpc: boolean; + testingMode: boolean; + unsafeMode: boolean; + }; + entryPoints: string[]; + beneficiary: string; + relayer: string; + minInclusionDenominator: number; + throttlingSlack: number; + banSlack: number; + minSignerBalance: string; + multicall: string; + estimationStaticBuffer: number; + validationGasLimit: number; + receiptLookupRange: number; + etherscanApiKey: boolean; // true if set + conditionalTransactions: boolean; + rpcEndpointSubmit: boolean; // true if not empty string + gasPriceMarkup: number; + enforceGasPrice: boolean; + enforceGasPriceThreshold: number; +}; + export type SupportedEntryPoints = string[]; export type EthChainIdResponse = { chainId: number }; From 2a55af89c280cf95bc8e53cd39c8967f1002efe1 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Mon, 11 Sep 2023 16:35:51 +0500 Subject: [PATCH 2/6] chore(release): v0.0.44 --- lerna.json | 2 +- package.json | 2 +- packages/api/package.json | 6 +++--- packages/cli/package.json | 10 +++++----- packages/db/package.json | 4 ++-- packages/executor/package.json | 6 +++--- packages/params/package.json | 4 ++-- packages/types/package.json | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lerna.json b/lerna.json index bed9b857..c09428df 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.0.43", + "version": "0.0.44", "stream": "true", "command": { "version": { diff --git a/package.json b/package.json index 4541cb80..69a59d88 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "root", "private": true, - "version": "0.0.43", + "version": "0.0.44", "engines": { "node": ">=18.0.0" }, diff --git a/packages/api/package.json b/packages/api/package.json index e2bb606c..49afe62f 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "api", - "version": "0.0.43", + "version": "0.0.44", "description": "The API module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -35,12 +35,12 @@ "class-transformer": "0.5.1", "class-validator": "0.14.0", "ethers": "5.7.2", - "executor": "^0.0.43", + "executor": "^0.0.44", "fastify": "4.14.1", "pino": "8.11.0", "pino-pretty": "10.0.0", "reflect-metadata": "0.1.13", - "types": "^0.0.43" + "types": "^0.0.44" }, "devDependencies": { "@types/connect": "3.4.35" diff --git a/packages/cli/package.json b/packages/cli/package.json index 011222ac..db9fe8c8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "cli", - "version": "0.0.43", + "version": "0.0.44", "description": "> TODO: description", "author": "zincoshine ", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -31,13 +31,13 @@ "url": "https://https://github.com/etherspot/skandha/issues" }, "dependencies": { - "api": "^0.0.43", - "db": "^0.0.43", - "executor": "^0.0.43", + "api": "^0.0.44", + "db": "^0.0.44", + "executor": "^0.0.44", "find-up": "5.0.0", "got": "12.5.3", "js-yaml": "4.1.0", - "types": "^0.0.43", + "types": "^0.0.44", "yargs": "17.6.2" }, "devDependencies": { diff --git a/packages/db/package.json b/packages/db/package.json index 9217d128..066680ad 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "db", - "version": "0.0.43", + "version": "0.0.44", "description": "The DB module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://github.com/etherspot/etherspot-bundler#readme", @@ -37,6 +37,6 @@ "devDependencies": { "@types/rocksdb": "3.0.1", "prettier": "^2.8.4", - "types": "^0.0.43" + "types": "^0.0.44" } } diff --git a/packages/executor/package.json b/packages/executor/package.json index 1c9f483a..bba214f5 100644 --- a/packages/executor/package.json +++ b/packages/executor/package.json @@ -1,6 +1,6 @@ { "name": "executor", - "version": "0.0.43", + "version": "0.0.44", "description": "The Relayer module of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", @@ -33,7 +33,7 @@ "dependencies": { "async-mutex": "0.4.0", "ethers": "5.7.2", - "params": "^0.0.43", - "types": "^0.0.43" + "params": "^0.0.44", + "types": "^0.0.44" } } diff --git a/packages/params/package.json b/packages/params/package.json index 4080d181..d30b97ab 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,6 +1,6 @@ { "name": "params", - "version": "0.0.43", + "version": "0.0.44", "description": "Various bundler parameters", "author": "Etherspot", "homepage": "https://github.com/etherspot/skandha#readme", @@ -25,7 +25,7 @@ "@eth-optimism/sdk": "3.0.0", "@mantleio/sdk": "0.2.1", "ethers": "5.7.2", - "types": "^0.0.43" + "types": "^0.0.44" }, "scripts": { "clean": "rm -rf lib && rm -f *.tsbuildinfo", diff --git a/packages/types/package.json b/packages/types/package.json index 7952c6de..d19c365f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "types", - "version": "0.0.43", + "version": "0.0.44", "description": "The types of Etherspot bundler client", "author": "Etherspot", "homepage": "https://https://github.com/etherspot/skandha#readme", From 6a7e20c3963500de47dcc41246de8462afa6fb44 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Tue, 12 Sep 2023 14:08:56 +0500 Subject: [PATCH 3/6] feat: run on testingMode without config file --- packages/executor/src/config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/executor/src/config.ts b/packages/executor/src/config.ts index d3af964a..750879b1 100644 --- a/packages/executor/src/config.ts +++ b/packages/executor/src/config.ts @@ -16,11 +16,11 @@ export class Config { redirectRpc: boolean; constructor(private config: ConfigOptions) { - this.supportedNetworks = this.parseSupportedNetworks(); - this.networks = this.parseNetworkConfigs(); this.testingMode = config.testingMode ?? false; this.unsafeMode = config.unsafeMode ?? false; this.redirectRpc = config.redirectRpc ?? false; + this.supportedNetworks = this.parseSupportedNetworks(); + this.networks = this.parseNetworkConfigs(); } getNetworkProvider(network: NetworkName): providers.JsonRpcProvider | null { @@ -66,6 +66,9 @@ export class Config { } private parseSupportedNetworks(): NetworkName[] { + if (this.testingMode) { + return ["dev"]; + } const envNetworks = NETWORKS_ENV(); if (envNetworks) { return envNetworks.map((key) => key as NetworkName); From cd1b23966a1de98c99febc2f958d6d0f9a1caf27 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Tue, 12 Sep 2023 14:10:41 +0500 Subject: [PATCH 4/6] disable binary search --- packages/executor/src/modules/eth.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/executor/src/modules/eth.ts b/packages/executor/src/modules/eth.ts index 52133023..27e37640 100644 --- a/packages/executor/src/modules/eth.ts +++ b/packages/executor/src/modules/eth.ts @@ -160,22 +160,13 @@ export class Eth { //> // Binary search gas limits - let userOpToEstimate: UserOperationStruct = { + const userOpToEstimate: UserOperationStruct = { ...userOpComplemented, preVerificationGas, verificationGasLimit, callGasLimit, }; - // binary search vgl and cgl - try { - userOpToEstimate = await this.userOpValidationService.binarySearchVGL( - userOpToEstimate, - entryPoint - ); - // eslint-disable-next-line no-empty - } catch (err) {} - const gasFee = await getGasFee( this.networkName, this.provider, @@ -190,8 +181,8 @@ export class Eth { preVerificationGas, verificationGasLimit: userOpToEstimate.verificationGasLimit, verificationGas: userOpToEstimate.verificationGasLimit, - validAfter: BigNumber.from(validAfter), - validUntil: BigNumber.from(validUntil), + validAfter: validAfter ? BigNumber.from(validAfter) : undefined, + validUntil: validUntil ? BigNumber.from(validUntil) : undefined, callGasLimit: userOpToEstimate.callGasLimit, maxFeePerGas: gasFee.maxFeePerGas, maxPriorityFeePerGas: gasFee.maxPriorityFeePerGas, From 47076d92359ae76e4543ea1146d788f769460449 Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Tue, 12 Sep 2023 18:30:07 +0500 Subject: [PATCH 5/6] http codes --- packages/api/src/app.ts | 9 ++++--- packages/api/src/constants.ts | 51 +++++++++++++++++++++++++++++++++++ packages/api/src/server.ts | 11 +++++--- 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index 5de36eaa..dfedc702 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -9,6 +9,7 @@ import logger from "./logger"; import { BundlerRPCMethods, CustomRPCMethods, + HttpStatus, RedirectedRPCMethods, } from "./constants"; import { EthAPI, DebugAPI, Web3API, RedirectAPI } from "./modules"; @@ -139,9 +140,9 @@ export class ApiApp { if (this.redirectRpc && method in RedirectedRPCMethods) { const body = await redirectApi.redirect(method, params); if (body.error) { - return res.status(200).send({ ...body, id }); + return res.status(HttpStatus.OK).send({ ...body, id }); } - return res.status(200).send({ jsonrpc, id, ...body }); + return res.status(HttpStatus.OK).send({ jsonrpc, id, ...body }); } if (result === undefined) { @@ -200,7 +201,7 @@ export class ApiApp { case CustomRPCMethods.skandha_config: result = await skandhaApi.getConfig(); // skip hexlify for this particular rpc - return res.status(200).send({ + return res.status(HttpStatus.OK).send({ jsonrpc, id, result, @@ -214,7 +215,7 @@ export class ApiApp { } result = deepHexlify(result); - return res.status(200).send({ + return res.status(HttpStatus.OK).send({ jsonrpc, id, result, diff --git a/packages/api/src/constants.ts b/packages/api/src/constants.ts index e9631e72..019f59fe 100644 --- a/packages/api/src/constants.ts +++ b/packages/api/src/constants.ts @@ -61,3 +61,54 @@ export const RedirectedRPCMethods = { eth_maxPriorityFeePerGas: "eth_maxPriorityFeePerGas", eth_sendRawTransaction: "eth_sendRawTransaction", }; + +export enum HttpStatus { + CONTINUE = 100, + SWITCHING_PROTOCOLS = 101, + PROCESSING = 102, + EARLYHINTS = 103, + OK = 200, + CREATED = 201, + ACCEPTED = 202, + NON_AUTHORITATIVE_INFORMATION = 203, + NO_CONTENT = 204, + RESET_CONTENT = 205, + PARTIAL_CONTENT = 206, + AMBIGUOUS = 300, + MOVED_PERMANENTLY = 301, + FOUND = 302, + SEE_OTHER = 303, + NOT_MODIFIED = 304, + TEMPORARY_REDIRECT = 307, + PERMANENT_REDIRECT = 308, + BAD_REQUEST = 400, + UNAUTHORIZED = 401, + PAYMENT_REQUIRED = 402, + FORBIDDEN = 403, + NOT_FOUND = 404, + METHOD_NOT_ALLOWED = 405, + NOT_ACCEPTABLE = 406, + PROXY_AUTHENTICATION_REQUIRED = 407, + REQUEST_TIMEOUT = 408, + CONFLICT = 409, + GONE = 410, + LENGTH_REQUIRED = 411, + PRECONDITION_FAILED = 412, + PAYLOAD_TOO_LARGE = 413, + URI_TOO_LONG = 414, + UNSUPPORTED_MEDIA_TYPE = 415, + REQUESTED_RANGE_NOT_SATISFIABLE = 416, + EXPECTATION_FAILED = 417, + I_AM_A_TEAPOT = 418, + MISDIRECTED = 421, + UNPROCESSABLE_ENTITY = 422, + FAILED_DEPENDENCY = 424, + PRECONDITION_REQUIRED = 428, + TOO_MANY_REQUESTS = 429, + INTERNAL_SERVER_ERROR = 500, + NOT_IMPLEMENTED = 501, + BAD_GATEWAY = 502, + SERVICE_UNAVAILABLE = 503, + GATEWAY_TIMEOUT = 504, + HTTP_VERSION_NOT_SUPPORTED = 505, +} diff --git a/packages/api/src/server.ts b/packages/api/src/server.ts index 2bef36f0..dea6c8ff 100644 --- a/packages/api/src/server.ts +++ b/packages/api/src/server.ts @@ -3,6 +3,7 @@ import cors from "@fastify/cors"; import RpcError from "types/lib/api/errors/rpc-error"; import { ServerConfig } from "types/lib/api/interfaces"; import logger from "./logger"; +import { HttpStatus } from "./constants"; export class Server { constructor(private app: FastifyInstance, private config: ServerConfig) { @@ -70,16 +71,18 @@ export class Server { data: err.data, code: err.code, }; - return res.status(200).send({ + return res.status(HttpStatus.OK).send({ jsonrpc: body.jsonrpc, id: body.id, error, }); } - return res.status(err.statusCode ?? 500).send({ - error: "Unexpected behaviour", - }); + return res + .status(err.statusCode ?? HttpStatus.INTERNAL_SERVER_ERROR) + .send({ + error: "Unexpected behaviour", + }); }); await this.app.listen({ From d01729984da1d400d697a0344a2825758a20198d Mon Sep 17 00:00:00 2001 From: marie-fourier Date: Tue, 12 Sep 2023 18:33:15 +0500 Subject: [PATCH 6/6] remove unused http codes --- packages/api/src/constants.ts | 46 ----------------------------------- 1 file changed, 46 deletions(-) diff --git a/packages/api/src/constants.ts b/packages/api/src/constants.ts index 019f59fe..e4f87ece 100644 --- a/packages/api/src/constants.ts +++ b/packages/api/src/constants.ts @@ -63,52 +63,6 @@ export const RedirectedRPCMethods = { }; export enum HttpStatus { - CONTINUE = 100, - SWITCHING_PROTOCOLS = 101, - PROCESSING = 102, - EARLYHINTS = 103, OK = 200, - CREATED = 201, - ACCEPTED = 202, - NON_AUTHORITATIVE_INFORMATION = 203, - NO_CONTENT = 204, - RESET_CONTENT = 205, - PARTIAL_CONTENT = 206, - AMBIGUOUS = 300, - MOVED_PERMANENTLY = 301, - FOUND = 302, - SEE_OTHER = 303, - NOT_MODIFIED = 304, - TEMPORARY_REDIRECT = 307, - PERMANENT_REDIRECT = 308, - BAD_REQUEST = 400, - UNAUTHORIZED = 401, - PAYMENT_REQUIRED = 402, - FORBIDDEN = 403, - NOT_FOUND = 404, - METHOD_NOT_ALLOWED = 405, - NOT_ACCEPTABLE = 406, - PROXY_AUTHENTICATION_REQUIRED = 407, - REQUEST_TIMEOUT = 408, - CONFLICT = 409, - GONE = 410, - LENGTH_REQUIRED = 411, - PRECONDITION_FAILED = 412, - PAYLOAD_TOO_LARGE = 413, - URI_TOO_LONG = 414, - UNSUPPORTED_MEDIA_TYPE = 415, - REQUESTED_RANGE_NOT_SATISFIABLE = 416, - EXPECTATION_FAILED = 417, - I_AM_A_TEAPOT = 418, - MISDIRECTED = 421, - UNPROCESSABLE_ENTITY = 422, - FAILED_DEPENDENCY = 424, - PRECONDITION_REQUIRED = 428, - TOO_MANY_REQUESTS = 429, INTERNAL_SERVER_ERROR = 500, - NOT_IMPLEMENTED = 501, - BAD_GATEWAY = 502, - SERVICE_UNAVAILABLE = 503, - GATEWAY_TIMEOUT = 504, - HTTP_VERSION_NOT_SUPPORTED = 505, }