-
Notifications
You must be signed in to change notification settings - Fork 282
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(connector-besu): do not crash if ledger unreachable - send HTTP 503 #3573
Open
ruzell22
wants to merge
1
commit into
hyperledger-cacti:main
Choose a base branch
from
ruzell22:issue3406
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+952
−31
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.yarn/patches/web3-eth-accounts-npm-1.6.1-c95f31ca81.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index de2853c247b334e6b22cee42b3e597281c44efdc..787aecf6758228c092f1a3cd8097f64e76cc573d 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -344,7 +344,7 @@ function _handleTxPricing(_this, tx) { | ||
throw Error("Network doesn't support eip-1559"); | ||
resolve({ gasPrice }); | ||
} | ||
- }); | ||
+ }).catch((ex) => reject(ex)); | ||
} | ||
} | ||
catch (error) { | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 157 additions & 0 deletions
157
packages/cactus-common/src/main/typescript/http/http-header.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
/** | ||
* A list of well-known headers as published on Wikipedia. | ||
* @see https://en.wikipedia.org/wiki/List_of_HTTP_header_fields | ||
* | ||
* TODO Finish documenting each enum item and make sure to also include | ||
* the examples provided on the linked Wikipedia page above. The first | ||
* few headers are documented this way but we need all of them like that. | ||
* | ||
* TODO Ensure that there are no typos in the header names. | ||
*/ | ||
export enum HttpHeader { | ||
// Standard request fields | ||
|
||
/** | ||
* Acceptable instance-manipulations for the request. | ||
* @example A-IM: feed | ||
* @see https://datatracker.ietf.org/doc/html/rfc3229 | ||
*/ | ||
A_IM = "A-IM", | ||
/** | ||
* Media type(s) that is/are acceptable for the response. See Content negotiation. | ||
* @example Accept: text/html | ||
* @see https://datatracker.ietf.org/doc/html/rfc9110 | ||
*/ | ||
Accept = "Accept", | ||
/** | ||
* Character sets that are acceptable. | ||
* @example Accept-Charset: utf-8 | ||
* @see https://datatracker.ietf.org/doc/html/rfc9110 | ||
*/ | ||
AcceptCharset = "Accept-Charset", | ||
/** | ||
* Acceptable version in time. | ||
* @example Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT | ||
* @see https://datatracker.ietf.org/doc/html/rfc7089 | ||
*/ | ||
AcceptDatetime = "Accept-Datetime", | ||
AcceptEncoding = "Accept-Encoding", | ||
AcceptLanguage = "Accept-Language", | ||
AccessControlAllowOrigin = "Access-Control-Allow-Origin", | ||
AccessControlAllowCredentials = "Access-Control-Allow-Credentials", | ||
AccessControlExposeHeaders = "Access-Control-Expose-Headers", | ||
AccessControlMaxAge = "Access-Control-Max-Age", | ||
AccessControlAllowMethods = "Access-Control-Allow-Methods", | ||
AccessControlAllowHeaders = "Access-Control-Allow-Headers", | ||
Authorization = "Authorization", | ||
CacheControl = "Cache-Control", | ||
Connection = "Connection", | ||
ContentDisposition = "Content-Disposition", | ||
ContentEncoding = "Content-Encoding", | ||
ContentLength = "Content-Length", | ||
ContentLocation = "Content-Location", | ||
ContentMD5 = "Content-MD5", | ||
ContentType = "Content-Type", | ||
Cookie = "Cookie", | ||
Date = "Date", | ||
Expect = "Expect", | ||
Forwarded = "Forwarded", | ||
From = "From", | ||
Host = "Host", | ||
IfMatch = "If-Match", | ||
IfModifiedSince = "If-Modified-Since", | ||
IfNoneMatch = "If-None-Match", | ||
IfRange = "If-Range", | ||
IfUnmodifiedSince = "If-Unmodified-Since", | ||
MaxForwards = "Max-Forwards", | ||
Origin = "Origin", | ||
Pragma = "Pragma", | ||
Prefer = "Prefer", | ||
ProxyAuthorization = "Proxy-Authorization", | ||
Range = "Range", | ||
Referer = "Referer", | ||
TE = "TE", | ||
Trailer = "Trailer", | ||
TransferEncoding = "Transfer-Encoding", | ||
Upgrade = "Upgrade", | ||
UserAgent = "User-Agent", | ||
|
||
// Common non-standard request fields | ||
UpgradeInsecureRequests = "Upgrade-Insecure-Requests", | ||
XRequestedWith = "X-Requested-With", | ||
DNT = "DNT", | ||
XForwardedFor = "X-Forwarded-For", | ||
XForwardedHost = "X-Forwarded-Host", | ||
XForwardedProto = "X-Forwarded-Proto", | ||
FrontEndHttps = "Front-End-Https", | ||
XHttpMethodOverride = "X-Http-Method-Override", | ||
XAttDeviceId = "X-Att-DeviceId", | ||
XWapProfile = "X-Wap-Profile", | ||
ProxyConnection = "Proxy-Connection", | ||
XUIDH = "X-UIDH", | ||
XCsrfToken = "X-Csrf-Token", | ||
XRequestId = "X-Request-ID", // Alternative X-Request-Id | ||
CorrelationId = "X-Correlation-ID", // Alternative Correlation-ID | ||
SaveData = "Save-Data", | ||
SecGpc = "Sec-GPC", | ||
|
||
// Standard response fields | ||
AcceptCH = "Accept-CH", | ||
AcceptPatch = "Accept-Patch", | ||
AltSvc = "Alt-Svc", | ||
Age = "Age", | ||
Allow = "Allow", | ||
Expires = "Expires", | ||
IM = "IM", | ||
LastModified = "Last-Modified", | ||
Link = "Link", | ||
Location = "Location", | ||
P3P = "P3P", | ||
ProxyAuthenticate = "Proxy-Authenticate", | ||
PublicKeyPins = "Public-Key-Pins", | ||
/** | ||
* f an entity is temporarily unavailable, this instructs the client | ||
* to try again later. Value could be a specified period of time | ||
* (in seconds) or a HTTP-date. | ||
* | ||
* There are two accepted formats when it comes to the values of the header: | ||
* ```http | ||
* Retry-After: <http-date> | ||
* Retry-After: <delay-seconds> | ||
* ``` | ||
* | ||
* `<http-date>` | ||
* A date after which to retry. See the Date header for more details on the HTTP date format. | ||
* | ||
* `<delay-seconds>` | ||
* A non-negative decimal integer indicating the seconds to delay after the response is received. | ||
* | ||
* @example Retry-After: 120 | ||
* @example Retry-After: Fri, 07 Nov 2014 23:59:59 GMT | ||
* | ||
* @see https://datatracker.ietf.org/doc/html/rfc9110#section-10.2.3 | ||
*/ | ||
RetryAfter = "Retry-After", | ||
Server = "Server", | ||
SetCookie = "Set-Cookie", | ||
StrictTransportSecurity = "Strict-Transport-Security", | ||
Tk = "Tk", | ||
Vary = "Vary", | ||
Via = "Via", // Same as request field | ||
/** | ||
* Indicates the authentication scheme that should be used to access the requested entity. | ||
* @example WWW-Authenticate: Basic | ||
* @see https://datatracker.ietf.org/doc/html/rfc9110 | ||
*/ | ||
WWWAuthenticate = "WWW-Authenticate", | ||
XFrameOptions = "X-Frame-Options", | ||
|
||
// Common non-standard response fields | ||
ContentSecurityPolicy = "Content-Security-Policy", | ||
ExpectCT = "Expect-CT", | ||
NEL = "NEL", | ||
PermissionsPolicy = "Permissions-Policy", | ||
Refresh = "Refresh", | ||
ReportTo = "Report-To", | ||
Timing_Allow_Origin = "Timing-Allow-Origin", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide more details about this (in commit & PR message). In particular:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruzell22 +1 to the above, this should be explained in detail.
@outSH I wrote the code, here's the answer that @ruzell22 can copy paste into the PR description and the commit message: Without the catch block the rejection is an unhandled rejection that bubbles up to the top of the callstack where NodeJS itself catches it and then crashes the entire process. (used to be that it just logged a warning but since some of the newer versions it crashes which allows us to find these bugs in our code / library's code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petermetz this is a nice learning! (Never knew that we can patch and include packages this way as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jagpreetsinghsasan Yeah, it's very useful when you need it. :-)