-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add update payload with inclusion list egine api method
- Loading branch information
1 parent
dc90a57
commit cb304ee
Showing
14 changed files
with
226 additions
and
3 deletions.
There are no files selected for viewing
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
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
69 changes: 69 additions & 0 deletions
69
...pegasys/teku/ethereum/executionclient/methods/EngineUpdatePayloadWithInclusionListV1.java
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,69 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2025 | ||
* | ||
* 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.executionclient.methods; | ||
|
||
import java.util.List; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.apache.tuweni.bytes.Bytes; | ||
import tech.pegasys.teku.ethereum.executionclient.ExecutionEngineClient; | ||
import tech.pegasys.teku.ethereum.executionclient.response.ResponseUnwrapper; | ||
import tech.pegasys.teku.ethereum.executionclient.schema.UpdatePayloadWithInclusionListV1Response; | ||
import tech.pegasys.teku.infrastructure.async.SafeFuture; | ||
import tech.pegasys.teku.infrastructure.bytes.Bytes8; | ||
import tech.pegasys.teku.spec.datastructures.execution.versions.eip7805.UpdatePayloadWithInclusionListResponse; | ||
|
||
public class EngineUpdatePayloadWithInclusionListV1 | ||
extends AbstractEngineJsonRpcMethod<UpdatePayloadWithInclusionListResponse> { | ||
|
||
private static final Logger LOG = LogManager.getLogger(); | ||
|
||
public EngineUpdatePayloadWithInclusionListV1(final ExecutionEngineClient executionEngineClient) { | ||
super(executionEngineClient); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return EngineApiMethod.ENGINE_UPDATE_PAYLOAD_WITH_INCLUSION_LIST.getName(); | ||
} | ||
|
||
@Override | ||
public int getVersion() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public SafeFuture<UpdatePayloadWithInclusionListResponse> execute( | ||
final JsonRpcRequestParams params) { | ||
final Bytes8 payloadId = params.getRequiredParameter(0, Bytes8.class); | ||
final List<Bytes> inclusionList = params.getRequiredListParameter(1, Bytes.class); | ||
|
||
LOG.trace( | ||
"Calling {}(payloadId={}, inclusionList={})", getVersionedName(), payloadId, inclusionList); | ||
|
||
return executionEngineClient | ||
.updatePayloadWithInclusionListV1(payloadId, inclusionList) | ||
.thenApply(ResponseUnwrapper::unwrapExecutionClientResponseOrThrow) | ||
.thenApply( | ||
UpdatePayloadWithInclusionListV1Response | ||
::asInternalUpdatePayloadWithInclusionListResponse) | ||
.thenPeek( | ||
updatePayloadWithInclusionListResponse -> | ||
LOG.trace( | ||
"Response {}(payloadId={}) -> {}", | ||
getVersionedName(), | ||
updatePayloadWithInclusionListResponse.payloadId(), | ||
updatePayloadWithInclusionListResponse)); | ||
} | ||
} |
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
39 changes: 39 additions & 0 deletions
39
...egasys/teku/ethereum/executionclient/schema/UpdatePayloadWithInclusionListV1Response.java
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,39 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2025 | ||
* | ||
* 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.executionclient.schema; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import tech.pegasys.teku.ethereum.executionclient.serialization.Bytes8Deserializer; | ||
import tech.pegasys.teku.infrastructure.bytes.Bytes8; | ||
import tech.pegasys.teku.spec.datastructures.execution.versions.eip7805.UpdatePayloadWithInclusionListResponse; | ||
|
||
public class UpdatePayloadWithInclusionListV1Response { | ||
|
||
@JsonDeserialize(using = Bytes8Deserializer.class) | ||
private final Bytes8 payloadId; | ||
|
||
public UpdatePayloadWithInclusionListV1Response( | ||
@JsonProperty("payloadId") final Bytes8 payloadId) { | ||
this.payloadId = payloadId; | ||
} | ||
|
||
public UpdatePayloadWithInclusionListResponse asInternalUpdatePayloadWithInclusionListResponse() { | ||
return new UpdatePayloadWithInclusionListResponse(payloadId); | ||
} | ||
|
||
public Bytes8 getPayloadId() { | ||
return payloadId; | ||
} | ||
} |
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
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
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
18 changes: 18 additions & 0 deletions
18
...pec/datastructures/execution/versions/eip7805/UpdatePayloadWithInclusionListResponse.java
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,18 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2025 | ||
* | ||
* 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.datastructures.execution.versions.eip7805; | ||
|
||
import tech.pegasys.teku.infrastructure.bytes.Bytes8; | ||
|
||
public record UpdatePayloadWithInclusionListResponse(Bytes8 payloadId) {} |
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.