From b4f7c2dbf108ac34dfd9841b2a9bf7fa9d47cebe Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Mon, 30 Dec 2024 12:54:23 +0200 Subject: [PATCH] Remove unused classes/modules (#8959) --- .../api/MinGenesisTimeBlockEventChannel.java | 20 --------- data/serializer/build.gradle | 2 - .../schema/interfaces/SignedBlindedBlock.java | 33 -------------- ethereum/execution-types/build.gradle | 2 +- ethereum/jackson-deserializers/build.gradle | 5 --- .../jackson/Eth1AddressDeserializer.java | 35 --------------- .../suppliers/type/Bytes32Supplier.java | 26 ----------- .../suppliers/type/UInt64Supplier.java | 26 ----------- infrastructure/jackson/build.gradle | 8 ---- .../bytes/ByteArrayDeserializer.java | 44 ------------------- .../bytes/ByteArraySerializer.java | 33 -------------- .../bytes/Bytes20Deserializer.java | 29 ------------ .../bytes/Bytes20Serializer.java | 30 ------------- .../bytes/Bytes4Deserializer.java | 29 ------------ .../deserializers/bytes/Bytes4Serializer.java | 30 ------------- .../bytes/BytesDeserializer.java | 29 ------------ .../bytes/DoubleDeserializer.java | 28 ------------ .../deserializers/bytes/DoubleSerializer.java | 40 ----------------- .../uints/UInt256Deserializer.java | 35 --------------- .../uints/UInt256Serializer.java | 29 ------------ .../service/serviceutils/NoopService.java | 29 ------------ infrastructure/yaml/build.gradle | 1 - .../teku/data/yaml}/Bytes32Deserializer.java | 4 +- .../teku/data/yaml}/BytesSerializer.java | 5 ++- .../teku/data/yaml}/UInt64Deserializer.java | 4 +- .../teku/data/yaml}/UInt64Serializer.java | 7 +-- .../pegasys/teku/data/yaml/YamlProvider.java | 36 ++------------- settings.gradle | 2 - validator/client/build.gradle | 1 - .../teku/validator/SetGasLimitException.java | 21 --------- .../loader/BLSPublicKeyDeserializer.java | 1 + .../loader/BLSPublicKeySerializer.java | 1 + .../loader}/Bytes48KeyDeserializer.java | 2 +- .../loader/ProposerConfigLoader.java | 7 ++- ...dedBlockEndpointNotAvailableException.java | 16 ------- .../BlockProductionV3FailedException.java | 16 ------- 36 files changed, 21 insertions(+), 645 deletions(-) delete mode 100644 beacon/pow/src/main/java/tech/pegasys/teku/beacon/pow/api/MinGenesisTimeBlockEventChannel.java delete mode 100644 data/serializer/src/main/java/tech/pegasys/teku/api/schema/interfaces/SignedBlindedBlock.java delete mode 100644 ethereum/jackson-deserializers/build.gradle delete mode 100644 ethereum/jackson-deserializers/src/main/java/tech/pegasys/teku/ethereum/jackson/Eth1AddressDeserializer.java delete mode 100644 ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/Bytes32Supplier.java delete mode 100644 ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/UInt64Supplier.java delete mode 100644 infrastructure/jackson/build.gradle delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArrayDeserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArraySerializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Deserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Serializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Deserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Serializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesDeserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleDeserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleSerializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Deserializer.java delete mode 100644 infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Serializer.java delete mode 100644 infrastructure/serviceutils/src/main/java/tech/pegasys/teku/service/serviceutils/NoopService.java rename infrastructure/{jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes => yaml/src/main/java/tech/pegasys/teku/data/yaml}/Bytes32Deserializer.java (90%) rename infrastructure/{jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes => yaml/src/main/java/tech/pegasys/teku/data/yaml}/BytesSerializer.java (90%) rename infrastructure/{jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints => yaml/src/main/java/tech/pegasys/teku/data/yaml}/UInt64Deserializer.java (90%) rename infrastructure/{jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints => yaml/src/main/java/tech/pegasys/teku/data/yaml}/UInt64Serializer.java (87%) delete mode 100644 validator/client/src/main/java/tech/pegasys/teku/validator/SetGasLimitException.java rename {infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes => validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader}/Bytes48KeyDeserializer.java (94%) delete mode 100644 validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlindedBlockEndpointNotAvailableException.java delete mode 100644 validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlockProductionV3FailedException.java diff --git a/beacon/pow/src/main/java/tech/pegasys/teku/beacon/pow/api/MinGenesisTimeBlockEventChannel.java b/beacon/pow/src/main/java/tech/pegasys/teku/beacon/pow/api/MinGenesisTimeBlockEventChannel.java deleted file mode 100644 index 7ba101fc9f1..00000000000 --- a/beacon/pow/src/main/java/tech/pegasys/teku/beacon/pow/api/MinGenesisTimeBlockEventChannel.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.beacon.pow.api; - -import tech.pegasys.teku.ethereum.pow.api.MinGenesisTimeBlockEvent; - -public interface MinGenesisTimeBlockEventChannel { - void onMinGenesisTimeBlock(MinGenesisTimeBlockEvent event); -} diff --git a/data/serializer/build.gradle b/data/serializer/build.gradle index 4302d4d8e80..f24eb8983ed 100644 --- a/data/serializer/build.gradle +++ b/data/serializer/build.gradle @@ -3,11 +3,9 @@ dependencies { api 'io.swagger.core.v3:swagger-annotations' implementation project(':ethereum:execution-types') - implementation project(':ethereum:jackson-deserializers') implementation project(':ethereum:spec') implementation project(':infrastructure:bls') implementation project(':infrastructure:bytes') - implementation project(':infrastructure:jackson') implementation project(':infrastructure:async') implementation 'io.tmio:tuweni-units' diff --git a/data/serializer/src/main/java/tech/pegasys/teku/api/schema/interfaces/SignedBlindedBlock.java b/data/serializer/src/main/java/tech/pegasys/teku/api/schema/interfaces/SignedBlindedBlock.java deleted file mode 100644 index 3429bdb17a7..00000000000 --- a/data/serializer/src/main/java/tech/pegasys/teku/api/schema/interfaces/SignedBlindedBlock.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.api.schema.interfaces; - -import io.swagger.v3.oas.annotations.media.Schema; -import tech.pegasys.teku.api.schema.altair.SignedBeaconBlockAltair; -import tech.pegasys.teku.api.schema.bellatrix.SignedBlindedBeaconBlockBellatrix; -import tech.pegasys.teku.api.schema.capella.SignedBlindedBeaconBlockCapella; -import tech.pegasys.teku.api.schema.deneb.SignedBlindedBeaconBlockDeneb; -import tech.pegasys.teku.api.schema.electra.SignedBlindedBeaconBlockElectra; -import tech.pegasys.teku.api.schema.phase0.SignedBeaconBlockPhase0; - -@Schema( - oneOf = { - SignedBeaconBlockPhase0.class, - SignedBeaconBlockAltair.class, - SignedBlindedBeaconBlockBellatrix.class, - SignedBlindedBeaconBlockCapella.class, - SignedBlindedBeaconBlockDeneb.class, - SignedBlindedBeaconBlockElectra.class - }) -public interface SignedBlindedBlock {} diff --git a/ethereum/execution-types/build.gradle b/ethereum/execution-types/build.gradle index c8ce4745c85..b9503a7dba8 100644 --- a/ethereum/execution-types/build.gradle +++ b/ethereum/execution-types/build.gradle @@ -3,7 +3,7 @@ dependencies { implementation project(':infrastructure:crypto') implementation project(':infrastructure:json') - testFixturesApi project(':infrastructure:jackson') + testFixturesApi 'com.fasterxml.jackson.core:jackson-databind' testImplementation project(':ethereum:json-types') testImplementation testFixtures(project(':infrastructure:json')) diff --git a/ethereum/jackson-deserializers/build.gradle b/ethereum/jackson-deserializers/build.gradle deleted file mode 100644 index 1b32471b6bc..00000000000 --- a/ethereum/jackson-deserializers/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - implementation project(':infrastructure:bytes') - implementation project(':infrastructure:jackson') - implementation project(':ethereum:execution-types') -} \ No newline at end of file diff --git a/ethereum/jackson-deserializers/src/main/java/tech/pegasys/teku/ethereum/jackson/Eth1AddressDeserializer.java b/ethereum/jackson-deserializers/src/main/java/tech/pegasys/teku/ethereum/jackson/Eth1AddressDeserializer.java deleted file mode 100644 index 5f789385890..00000000000 --- a/ethereum/jackson-deserializers/src/main/java/tech/pegasys/teku/ethereum/jackson/Eth1AddressDeserializer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.ethereum.jackson; - -import com.fasterxml.jackson.core.JacksonException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonMappingException; -import java.io.IOException; -import tech.pegasys.teku.ethereum.execution.types.Eth1Address; - -public class Eth1AddressDeserializer extends JsonDeserializer { - - @Override - public Eth1Address deserialize(final JsonParser p, final DeserializationContext ctxt) - throws JacksonException { - try { - return Eth1Address.fromHexString(p.getValueAsString()); - } catch (RuntimeException | IOException ex) { - throw new JsonMappingException(p, ex.getMessage(), ex); - } - } -} diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/Bytes32Supplier.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/Bytes32Supplier.java deleted file mode 100644 index 1ea025dc6f9..00000000000 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/Bytes32Supplier.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.spec.propertytest.suppliers.type; - -import net.jqwik.api.Arbitraries; -import net.jqwik.api.Arbitrary; -import net.jqwik.api.ArbitrarySupplier; -import org.apache.tuweni.bytes.Bytes32; - -public class Bytes32Supplier implements ArbitrarySupplier { - @Override - public Arbitrary get() { - return Arbitraries.bytes().array(byte[].class).ofSize(32).map(Bytes32::wrap); - } -} diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/UInt64Supplier.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/UInt64Supplier.java deleted file mode 100644 index d4d3f11851e..00000000000 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/propertytest/suppliers/type/UInt64Supplier.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.spec.propertytest.suppliers.type; - -import net.jqwik.api.Arbitraries; -import net.jqwik.api.Arbitrary; -import net.jqwik.api.ArbitrarySupplier; -import tech.pegasys.teku.infrastructure.unsigned.UInt64; - -public class UInt64Supplier implements ArbitrarySupplier { - @Override - public Arbitrary get() { - return Arbitraries.longs().map(UInt64::fromLongBits); - } -} diff --git a/infrastructure/jackson/build.gradle b/infrastructure/jackson/build.gradle deleted file mode 100644 index 3f1451d6923..00000000000 --- a/infrastructure/jackson/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -dependencies { - api 'com.fasterxml.jackson.core:jackson-databind' - api 'io.swagger.core.v3:swagger-annotations' - - implementation project(':infrastructure:bytes') - - implementation 'io.tmio:tuweni-units' -} \ No newline at end of file diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArrayDeserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArrayDeserializer.java deleted file mode 100644 index 5b64a8a0003..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArrayDeserializer.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import static com.google.common.base.Preconditions.checkArgument; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.ObjectCodec; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonNode; -import java.io.IOException; - -public class ByteArrayDeserializer extends JsonDeserializer { - - @Override - public byte[] deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - ObjectCodec oc = p.getCodec(); - JsonNode node = oc.readTree(p); - checkArgument(node.isArray(), "Expected array but did not appear to be one!"); - byte[] data = new byte[node.size()]; - for (int i = 0; i < node.size(); i++) { - final int current = node.get(i).asInt(-1); - checkArgument( - current >= 0 && current <= 255, - "Expected %s to be a byte value between 0 and 255 inclusive", - node.get(i)); - data[i] = (byte) current; - } - return data; - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArraySerializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArraySerializer.java deleted file mode 100644 index 1c97c40d7fc..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/ByteArraySerializer.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; - -public class ByteArraySerializer extends JsonSerializer { - @Override - public void serialize( - final byte[] value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeStartArray(); - for (int i = 0; i < value.length; i++) { - final int s = value[i] & 0xff; - gen.writeString(String.format("%d", s)); - } - gen.writeEndArray(); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Deserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Deserializer.java deleted file mode 100644 index e9d53b33024..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Deserializer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import java.io.IOException; -import tech.pegasys.teku.infrastructure.bytes.Bytes20; - -public class Bytes20Deserializer extends JsonDeserializer { - - @Override - public Bytes20 deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - return Bytes20.fromHexString(p.getValueAsString()); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Serializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Serializer.java deleted file mode 100644 index 1ff0dc2e281..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes20Serializer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; -import java.util.Locale; -import tech.pegasys.teku.infrastructure.bytes.Bytes20; - -public class Bytes20Serializer extends JsonSerializer { - @Override - public void serialize( - final Bytes20 value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeString(value.toHexString().toLowerCase(Locale.ROOT)); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Deserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Deserializer.java deleted file mode 100644 index 4aca1c976cb..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Deserializer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import java.io.IOException; -import tech.pegasys.teku.infrastructure.bytes.Bytes4; - -public class Bytes4Deserializer extends JsonDeserializer { - - @Override - public Bytes4 deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - return Bytes4.fromHexString(p.getValueAsString()); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Serializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Serializer.java deleted file mode 100644 index 996401c3d24..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes4Serializer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; -import java.util.Locale; -import tech.pegasys.teku.infrastructure.bytes.Bytes4; - -public class Bytes4Serializer extends JsonSerializer { - @Override - public void serialize( - final Bytes4 value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeString(value.toHexString().toLowerCase(Locale.ROOT)); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesDeserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesDeserializer.java deleted file mode 100644 index 449f8654999..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesDeserializer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import java.io.IOException; -import org.apache.tuweni.bytes.Bytes; - -public class BytesDeserializer extends JsonDeserializer { - - @Override - public Bytes deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - return Bytes.fromHexString(p.getValueAsString()); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleDeserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleDeserializer.java deleted file mode 100644 index ba8bce97e68..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleDeserializer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import java.io.IOException; - -public class DoubleDeserializer extends JsonDeserializer { - - @Override - public Double deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - return Double.valueOf(p.getValueAsString()); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleSerializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleSerializer.java deleted file mode 100644 index 5da417213a0..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/DoubleSerializer.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -public class DoubleSerializer extends JsonSerializer { - private static final DecimalFormatSymbols US_SYMBOLS = new DecimalFormatSymbols(Locale.US); - - @Override - public void serialize( - final Double value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeString(formatValue(value)); - } - - private String formatValue(final Double value) { - DecimalFormat df = new DecimalFormat("#.####", US_SYMBOLS); - df.setRoundingMode(RoundingMode.HALF_UP); - return df.format(value); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Deserializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Deserializer.java deleted file mode 100644 index 1370bc9b6d4..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Deserializer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.uints; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import java.io.IOException; -import java.math.BigInteger; -import org.apache.tuweni.units.bigints.UInt256; - -public class UInt256Deserializer extends JsonDeserializer { - - @Override - public UInt256 deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - String value = p.getValueAsString(); - if (value.startsWith("0x")) { - return UInt256.fromHexString(p.getValueAsString()); - } - - return UInt256.valueOf(new BigInteger(value)); - } -} diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Serializer.java b/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Serializer.java deleted file mode 100644 index 899c2d4bc1c..00000000000 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt256Serializer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.infrastructure.jackson.deserializers.uints; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import java.io.IOException; -import org.apache.tuweni.units.bigints.UInt256; - -public class UInt256Serializer extends JsonSerializer { - @Override - public void serialize( - final UInt256 value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeString(value.toDecimalString()); - } -} diff --git a/infrastructure/serviceutils/src/main/java/tech/pegasys/teku/service/serviceutils/NoopService.java b/infrastructure/serviceutils/src/main/java/tech/pegasys/teku/service/serviceutils/NoopService.java deleted file mode 100644 index efa3c325a78..00000000000 --- a/infrastructure/serviceutils/src/main/java/tech/pegasys/teku/service/serviceutils/NoopService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.service.serviceutils; - -import tech.pegasys.teku.infrastructure.async.SafeFuture; - -public class NoopService extends Service { - - @Override - protected SafeFuture doStart() { - return SafeFuture.COMPLETE; - } - - @Override - protected SafeFuture doStop() { - return SafeFuture.COMPLETE; - } -} diff --git a/infrastructure/yaml/build.gradle b/infrastructure/yaml/build.gradle index e184a680e03..91430265c1e 100644 --- a/infrastructure/yaml/build.gradle +++ b/infrastructure/yaml/build.gradle @@ -1,5 +1,4 @@ dependencies { - implementation project(':infrastructure:jackson') implementation 'io.tmio:tuweni-bytes' implementation 'com.fasterxml.jackson.core:jackson-databind' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml' diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes32Deserializer.java b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/Bytes32Deserializer.java similarity index 90% rename from infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes32Deserializer.java rename to infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/Bytes32Deserializer.java index 5fcd75d8ef1..e3ecac932e9 100644 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes32Deserializer.java +++ b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/Bytes32Deserializer.java @@ -1,5 +1,5 @@ /* - * Copyright Consensys Software Inc., 2022 + * Copyright Consensys Software Inc., 2024 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; +package tech.pegasys.teku.data.yaml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesSerializer.java b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/BytesSerializer.java similarity index 90% rename from infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesSerializer.java rename to infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/BytesSerializer.java index 2fafab35ae0..83439aa4f53 100644 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/BytesSerializer.java +++ b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/BytesSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright Consensys Software Inc., 2022 + * Copyright Consensys Software Inc., 2024 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; +package tech.pegasys.teku.data.yaml; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; @@ -21,6 +21,7 @@ import org.apache.tuweni.bytes.Bytes; public class BytesSerializer extends JsonSerializer { + @Override public void serialize( final Bytes value, final JsonGenerator gen, final SerializerProvider provider) diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Deserializer.java b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Deserializer.java similarity index 90% rename from infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Deserializer.java rename to infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Deserializer.java index 44cc016d84a..f20c2720762 100644 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Deserializer.java +++ b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Deserializer.java @@ -1,5 +1,5 @@ /* - * Copyright Consensys Software Inc., 2022 + * Copyright Consensys Software Inc., 2024 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -package tech.pegasys.teku.infrastructure.jackson.deserializers.uints; +package tech.pegasys.teku.data.yaml; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Serializer.java b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Serializer.java similarity index 87% rename from infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Serializer.java rename to infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Serializer.java index 49ff1af4a30..f0513d21304 100644 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/uints/UInt64Serializer.java +++ b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/UInt64Serializer.java @@ -1,5 +1,5 @@ /* - * Copyright Consensys Software Inc., 2022 + * Copyright Consensys Software Inc., 2024 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -package tech.pegasys.teku.infrastructure.jackson.deserializers.uints; +package tech.pegasys.teku.data.yaml; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; @@ -20,10 +20,11 @@ import tech.pegasys.teku.infrastructure.unsigned.UInt64; public class UInt64Serializer extends JsonSerializer { + @Override public void serialize( final UInt64 value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException { - gen.writeString(value.toString()); + gen.writeNumber(value.bigIntegerValue()); } } diff --git a/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/YamlProvider.java b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/YamlProvider.java index b3f2fe47ff7..fb232601b18 100644 --- a/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/YamlProvider.java +++ b/infrastructure/yaml/src/main/java/tech/pegasys/teku/data/yaml/YamlProvider.java @@ -14,43 +14,35 @@ package tech.pegasys.teku.data.yaml; import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.io.StringWriter; import java.io.UncheckedIOException; import java.util.stream.Stream; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; -import tech.pegasys.teku.infrastructure.jackson.deserializers.bytes.Bytes32Deserializer; -import tech.pegasys.teku.infrastructure.jackson.deserializers.bytes.BytesSerializer; import tech.pegasys.teku.infrastructure.unsigned.UInt64; public class YamlProvider { private final ObjectMapper objectMapper; public YamlProvider(final Module... modules) { - this.objectMapper = new ObjectMapper(new YAMLFactory()); + objectMapper = new ObjectMapper(new YAMLFactory()); addTekuMappers(); Stream.of(modules).forEach(objectMapper::registerModule); } private void addTekuMappers() { - SimpleModule module = new SimpleModule("TekuYaml", new Version(1, 0, 0, null, null, null)); + final SimpleModule module = + new SimpleModule("TekuYaml", new Version(1, 0, 0, null, null, null)); module.addDeserializer(UInt64.class, new UInt64Deserializer()); module.addSerializer(UInt64.class, new UInt64Serializer()); module.addDeserializer(Bytes32.class, new Bytes32Deserializer()); @@ -58,10 +50,6 @@ private void addTekuMappers() { objectMapper.registerModule(module).writer(new DefaultPrettyPrinter()); } - public T read(final InputStream data, final Class clazz) throws IOException { - return objectMapper.readValue(data, clazz); - } - public T read(final Bytes data, final Class clazz) throws IOException { return objectMapper.readValue(data.toArrayUnsafe(), clazz); } @@ -95,22 +83,4 @@ public String writeString(final T object) { public ObjectMapper getObjectMapper() { return objectMapper; } - - public static class UInt64Deserializer extends JsonDeserializer { - - @Override - public UInt64 deserialize(final JsonParser p, final DeserializationContext ctxt) - throws IOException { - return UInt64.valueOf(p.getValueAsString()); - } - } - - public static class UInt64Serializer extends JsonSerializer { - @Override - public void serialize( - final UInt64 value, final JsonGenerator gen, final SerializerProvider serializers) - throws IOException { - gen.writeNumber(value.bigIntegerValue()); - } - } } diff --git a/settings.gradle b/settings.gradle index af4d33cac39..b17af30b975 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,7 +10,6 @@ include 'ethereum:executionclient' include 'ethereum:executionlayer' include 'ethereum:execution-types' include 'ethereum:json-types' -include 'ethereum:jackson-deserializers' include 'ethereum:networks' include 'ethereum:pow:api' include 'ethereum:pow:merkletree' @@ -34,7 +33,6 @@ include 'infrastructure:events' include 'infrastructure:exceptions' include 'infrastructure:http' include 'infrastructure:io' -include 'infrastructure:jackson' include 'infrastructure:json' include 'infrastructure:kzg' include 'infrastructure:metrics' diff --git a/validator/client/build.gradle b/validator/client/build.gradle index 64cc30b7181..742e1a23937 100644 --- a/validator/client/build.gradle +++ b/validator/client/build.gradle @@ -4,7 +4,6 @@ dependencies { implementation project(':infrastructure:crypto') implementation project(':infrastructure:exceptions') implementation project(':infrastructure:io') - implementation project(':infrastructure:jackson') implementation project(':infrastructure:metrics') implementation project(':infrastructure:http') implementation project(':ethereum:json-types') diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/SetGasLimitException.java b/validator/client/src/main/java/tech/pegasys/teku/validator/SetGasLimitException.java deleted file mode 100644 index cc0de70fbd0..00000000000 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/SetGasLimitException.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.validator; - -public class SetGasLimitException extends IllegalArgumentException { - - public SetGasLimitException(final String message) { - super(message); - } -} diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeyDeserializer.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeyDeserializer.java index d859f3ef5a3..2c5e63f6cd6 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeyDeserializer.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeyDeserializer.java @@ -20,6 +20,7 @@ import tech.pegasys.teku.bls.BLSPublicKey; class BLSPublicKeyDeserializer extends JsonDeserializer { + @Override public BLSPublicKey deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException { diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeySerializer.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeySerializer.java index d7d48bea2dd..9952ac46c07 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeySerializer.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/BLSPublicKeySerializer.java @@ -21,6 +21,7 @@ import tech.pegasys.teku.bls.BLSPublicKey; class BLSPublicKeySerializer extends JsonSerializer { + @Override public void serialize( final BLSPublicKey value, final JsonGenerator gen, final SerializerProvider serializers) diff --git a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes48KeyDeserializer.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/Bytes48KeyDeserializer.java similarity index 94% rename from infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes48KeyDeserializer.java rename to validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/Bytes48KeyDeserializer.java index f10eb2c028c..1c5e32ba6ca 100644 --- a/infrastructure/jackson/src/main/java/tech/pegasys/teku/infrastructure/jackson/deserializers/bytes/Bytes48KeyDeserializer.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/Bytes48KeyDeserializer.java @@ -11,7 +11,7 @@ * specific language governing permissions and limitations under the License. */ -package tech.pegasys.teku.infrastructure.jackson.deserializers.bytes; +package tech.pegasys.teku.validator.client.proposerconfig.loader; import com.fasterxml.jackson.core.JacksonException; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java index 543025c9317..aee1a0383b7 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/proposerconfig/loader/ProposerConfigLoader.java @@ -27,19 +27,18 @@ import tech.pegasys.teku.infrastructure.exceptions.ExceptionUtil; import tech.pegasys.teku.infrastructure.exceptions.InvalidConfigurationException; import tech.pegasys.teku.infrastructure.http.UrlSanitizer; -import tech.pegasys.teku.infrastructure.jackson.deserializers.bytes.Bytes48KeyDeserializer; import tech.pegasys.teku.validator.client.ProposerConfig; public class ProposerConfigLoader { private final ObjectMapper objectMapper; public ProposerConfigLoader() { - this.objectMapper = new ObjectMapper(); + objectMapper = new ObjectMapper(); addTekuMappers(); } private void addTekuMappers() { - SimpleModule module = + final SimpleModule module = new SimpleModule("ProposerConfigLoader", new Version(1, 0, 0, null, null, null)); module.addDeserializer(BLSPublicKey.class, new BLSPublicKeyDeserializer()); module.addSerializer(BLSPublicKey.class, new BLSPublicKeySerializer()); @@ -49,7 +48,7 @@ private void addTekuMappers() { } public ObjectMapper getObjectMapper() { - return this.objectMapper; + return objectMapper; } public ProposerConfig getProposerConfig(final URL source) { diff --git a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlindedBlockEndpointNotAvailableException.java b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlindedBlockEndpointNotAvailableException.java deleted file mode 100644 index 5e213df09f3..00000000000 --- a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlindedBlockEndpointNotAvailableException.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.validator.remote.typedef; - -public class BlindedBlockEndpointNotAvailableException extends RuntimeException {} diff --git a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlockProductionV3FailedException.java b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlockProductionV3FailedException.java deleted file mode 100644 index 17b389b947a..00000000000 --- a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/typedef/BlockProductionV3FailedException.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Consensys Software Inc., 2023 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package tech.pegasys.teku.validator.remote.typedef; - -public class BlockProductionV3FailedException extends RuntimeException {}