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

build: bump jackson version #2715

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 38 additions & 30 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,52 +64,44 @@
<sha256 value="af650fa4dd400bc5769320bcef08ed93813f349cabe8213d469acafbbd945d8a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml" name="oss-parent" version="43">
<artifact name="oss-parent-43.pom">
<sha256 value="e5585cc1c37079b2e3817a8997945736f158831844d59d0e4d3a45b27611f926" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml" name="oss-parent" version="48">
<artifact name="oss-parent-48.pom">
<sha256 value="11bba22d8631816e09b623a200747453d6491a66eac8f5c089c73da2b749014f" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-base" version="2.13.3">
<artifact name="jackson-base-2.13.3.pom">
<sha256 value="72d67291876c63e1896bc7d8ff799033d3a4b9029020110488af9c97315ed939" origin="Generated by Gradle"/>
<component group="com.fasterxml" name="oss-parent" version="50">
<artifact name="oss-parent-50.pom">
<sha256 value="f5da55dd7b88fb170c46801d17774a652fb2f4581fb5b1d0a5fc86aa182b8577" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-base" version="2.14.2">
<artifact name="jackson-base-2.14.2.pom">
<sha256 value="3ae245b9df95127321f1f905f703bd32774fe557158a9d3a9e507d82b2bc4ed4" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-bom" version="2.13.3">
<artifact name="jackson-bom-2.13.3.pom">
<sha256 value="df675b83b6caba7602fb47d75d4bb513c2af4c0a6155d7e397c0ec0f34112c75" origin="Generated by Gradle"/>
<component group="com.fasterxml.jackson" name="jackson-base" version="2.15.4">
<artifact name="jackson-base-2.15.4.pom">
<sha256 value="74e3ad3c08aa3710299f3582538e07ed8c5026c3c128b66a6189763d74e58c88" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-bom" version="2.14.2">
<artifact name="jackson-bom-2.14.2.pom">
<sha256 value="9aa209bb32391cbf5f1bd3e7fa11901676169acd190d9896b5c1e877c999febc" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-parent" version="2.13">
<artifact name="jackson-parent-2.13.pom">
<sha256 value="2bba89978172af1effcb4d143d09921a3f3082ca4dcf122b1ded98bf55b2ad57" origin="Generated by Gradle"/>
<component group="com.fasterxml.jackson" name="jackson-bom" version="2.15.4">
<artifact name="jackson-bom-2.15.4.pom">
<sha256 value="6cc2d925fcadf5cd225254cbf4e4a78bb9af9194d018717733d598461e35fd98" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson" name="jackson-parent" version="2.14">
<artifact name="jackson-parent-2.14.pom">
<sha256 value="0906add855ae39f92357d63f485889b08fca4c43a5fe433522d75344e0757b19" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-annotations" version="2.13.3">
<artifact name="jackson-annotations-2.13.3.jar">
<sha256 value="5326a6fbcde7cf8817f36c254101cd45f6acea4258518cd3c80ee5b89f4e4b9b" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-annotations-2.13.3.module">
<sha256 value="9cff35722597acaae21f8fe630317aced55855f92d3ba21bac4b3f90892ea00c" origin="Generated by Gradle"/>
<component group="com.fasterxml.jackson" name="jackson-parent" version="2.15">
<artifact name="jackson-parent-2.15.pom">
<sha256 value="6cdf97bc66f389f63e36850d2f552d1216688f8e5a58727d3f6a98edf8675cde" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-annotations" version="2.14.2">
Expand All @@ -120,12 +112,12 @@
<sha256 value="b014a64cc1844949f824d34671293541fab723223ac8b83222b5772113bdec17" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.13.3">
<artifact name="jackson-core-2.13.3.jar">
<sha256 value="ab119a8ea3cc69472ebc0e870b849bfbbe536ad57d613dc38453ccd592ca6a3d" origin="Generated by Gradle"/>
<component group="com.fasterxml.jackson.core" name="jackson-annotations" version="2.15.4">
<artifact name="jackson-annotations-2.15.4.jar">
<sha256 value="f204ebbd552614a22b8531ffe350d47f8fd42c45bb60517c07974dc27a5a1dd3" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-core-2.13.3.module">
<sha256 value="eca2ac4d1d67ae89f43e6390fcbcbf1633fd8c3a1a4968d93214ebe5825f61e3" origin="Generated by Gradle"/>
<artifact name="jackson-annotations-2.15.4.module">
<sha256 value="2045ddd4adf0a2e56c054022055c949f7c722aa04986d8341e96d5c106fddf62" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.14.2">
Expand All @@ -136,12 +128,12 @@
<sha256 value="92739e3bcbe09b2649e187eb7ed25ac252b587707cd922ab95badcde8aea12dc" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.13.3">
<artifact name="jackson-databind-2.13.3.jar">
<sha256 value="6444bf08d8cd4629740afc3db1276938f494728deb663ce585c4e91f6b45eb84" origin="Generated by Gradle"/>
<component group="com.fasterxml.jackson.core" name="jackson-core" version="2.15.4">
<artifact name="jackson-core-2.15.4.jar">
<sha256 value="8dc9210dd285db366f45f518dd1e6a9ccfeb0f1a8e184a899fe96d29edf1fd94" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-databind-2.13.3.module">
<sha256 value="422d6822037d1a58b918dcebbb475082f07ca7cca7e4b582873c64c6cde4b887" origin="Generated by Gradle"/>
<artifact name="jackson-core-2.15.4.module">
<sha256 value="1bc11f6558a1f2a15a16f8d1e7e1aba7a68a2eed1a2337a68659e2016d2858cf" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.14.2">
Expand All @@ -152,6 +144,14 @@
<sha256 value="6130ca9b95707ccd4f80f6258569990a7ce40039aa353c4635c900d36beec705" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.jackson.core" name="jackson-databind" version="2.15.4">
<artifact name="jackson-databind-2.15.4.jar">
<sha256 value="0f99ff7719eef3ee85608b3dee6ecf3c698003fe9d6e34eabbfabccdc9b5ac2c" origin="Generated by Gradle"/>
</artifact>
<artifact name="jackson-databind-2.15.4.module">
<sha256 value="44702a2bfdd1a3b292711b9356291db05df961d180555849d2cbf60eb9ccb101" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.fasterxml.woodstox" name="woodstox-core" version="6.2.6">
<artifact name="woodstox-core-6.2.6.jar">
<sha256 value="ed131989de559f1674d0755282cf09dd7813912141460af822f5ef1c9b5a0ae1" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1020,6 +1020,14 @@
<sha256 value="d83e87f1676cde44191eec5cda690492392f26923b1e498148ca739dfed75295" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.9.2">
<artifact name="junit-bom-5.9.2.module">
<sha256 value="ab137ba5a8e32c9b066bf9126a1c76dd5614b724ba5c0b02549772b5e9f4cf1f" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.9.2.pom">
<sha256 value="2ed07d65845131f5336a86476c9a4056b59d0b58b9815ab3679bb0f36f35f705" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter" version="5.7.2">
<artifact name="junit-jupiter-5.7.2.module">
<sha256 value="db6c1c5939a0ef63eb81dbb578d36c0c7bb37611a33b3ab03856716faa800f1b" origin="Generated by Gradle"/>
Expand Down
4 changes: 2 additions & 2 deletions rskj-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ext {
rocksdbJniVer : '7.10.2',
slf4jVer : '1.7.36',
logbackVer : '1.2.10',
jacksonVer : '2.13.3',
jacksonVer : '2.15.4',
commonsLang3Ver : '3.12.0',
typesafeConfigVer : '1.4.2',
mapdbVer : '2.0-beta13',
Expand Down Expand Up @@ -156,7 +156,7 @@ ext {
awaitilityVer : '4.2.0',
commonsIoVer : '2.11.0',
commonsCodecVer: '1.15',
jacksonVer : '2.13.3',
jacksonVer : '2.15.4',
okhttpWsVer : '2.7.5',

rskLllVer : '0.0.2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import co.rsk.rpc.exception.JsonRpcThrowableError;
import co.rsk.util.JacksonParserUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.exc.StreamConstraintsException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
Expand Down Expand Up @@ -89,11 +90,11 @@ protected void channelRead0(ChannelHandlerContext ctx, ByteBufHolder request) th
LOGGER.error(invalidReqMsg, e);
responseContent = buildErrorContent(ErrorResolver.JsonError.INVALID_REQUEST.code, e.getMessage());
responseCode = ErrorResolver.JsonError.INVALID_REQUEST.code;
} catch (StackOverflowError e) {
String stackOverflowErrorMsg = "Invalid request";
LOGGER.error(stackOverflowErrorMsg, e);
} catch (StackOverflowError | StreamConstraintsException e) {
String invalidReqMsg = "Invalid request";
LOGGER.error(invalidReqMsg, e);
int errorCode = ErrorResolver.JsonError.INVALID_REQUEST.code;
responseContent = buildErrorContent(errorCode, stackOverflowErrorMsg);
responseContent = buildErrorContent(errorCode, invalidReqMsg);
responseCode = errorCode;
} catch (JsonRpcThrowableError e) {
LOGGER.error(e.getMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public JsonError resolveError(Throwable t, Method method, List<JsonNode> argumen
"the method " + method.getName() + " does not exist/is not available",
null);
} else {
logger.error("JsonRPC error when for method {} with arguments {}", method, arguments, t);
logger.error("JsonRPC error when for method {}", method, t);
error = new JsonError(JsonRpcError.INTERNAL_ERROR, "Internal server error", null);
}
return error;
Expand Down
12 changes: 9 additions & 3 deletions rskj-core/src/test/java/co/rsk/rpc/netty/Web3HttpServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,17 @@ void testStackOverflowErrorInRequest() throws Exception {
" \"jsonrpc\": \"2.0\"\n" +
"}]";

for (long i = 0; i < 99_999; i++) {
content = String.format("[[[[[[[[[[%s]]]]]]]]]]", content);
int depth = 998;
StringBuilder sb = new StringBuilder(content.length() + 2*depth);
for (long i = 0; i < depth; i++) {
sb.append("[");
}
sb.append(content);
for (long i = 0; i < depth; i++) {
sb.append("]");
Comment on lines +184 to +191
Copy link
Contributor

Choose a reason for hiding this comment

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

question:

Is it optimising because isn't necessary a loop big how was it? Did you had to change because it was failing? What's the reason for the change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you're right. basically to improve perf of the test a bit. This test was hanging a bit

}

Response response = sendHugeJsonRpcMessage(randomPort, "application/json-rpc", "127.0.0.1", content);
Response response = sendHugeJsonRpcMessage(randomPort, "application/json-rpc", "127.0.0.1", sb.toString());
String responseBody = response.body().string();
JsonNode jsonRpcResponse = OBJECT_MAPPER.readTree(responseBody);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,17 @@ void testStackOverflowErrorInRequest() throws Exception {
List<String> messages = new ArrayList<>();
String content = this.getJsonRpcDummyMessageStr("value");

for (long i = 0; i < 99_999; i++) {
content = String.format("[[[[[[[[[[%s]]]]]]]]]]", content);
int depth = 999;
StringBuilder sb = new StringBuilder(content.length() + 2*depth);
for (long i = 0; i < depth; i++) {
sb.append("[");
}
sb.append(content);
for (long i = 0; i < depth; i++) {
sb.append("]");
}

byte[] msg = content.getBytes();
byte[] msg = sb.toString().getBytes();
String serverPath = "/";

Web3 web3Mock = mock(Web3.class);
Expand Down
Loading