mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-09 22:07:59 -05:00
EVMTool Docker Support (#7430)
A few fixes that re-enable docker support for evm tool * evmtool is the entrypoint * turn off some noisy logging * ensure EOF respects the create flag Signed-off-by: Danno Ferrin <danno@numisight.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
- In process RPC service [#7395](https://github.com/hyperledger/besu/pull/7395)
|
||||
|
||||
### Bug fixes
|
||||
- Correct entrypoint in Docker evmtool [#7430](https://github.com/hyperledger/besu/pull/7430)
|
||||
|
||||
## 24.7.1
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ WORKDIR /opt/besu-evmtool
|
||||
COPY --chown=besu:besu besu-evmtool /opt/besu-evmtool/
|
||||
|
||||
ENV PATH="/opt/besu-evmtool/bin:${PATH}"
|
||||
ENTRYPOINT ["evm"]
|
||||
ENTRYPOINT ["evmtool"]
|
||||
|
||||
# Build-time metadata as defined at http://label-schema.org
|
||||
ARG BUILD_DATE
|
||||
|
||||
@@ -28,7 +28,7 @@ public final class EvmTool {
|
||||
* @param args The command line arguments.
|
||||
*/
|
||||
public static void main(final String... args) {
|
||||
LogConfigurator.setLevel("", "DEBUG");
|
||||
LogConfigurator.setLevel("", "OFF");
|
||||
final EvmToolCommand evmToolCommand = new EvmToolCommand();
|
||||
|
||||
evmToolCommand.execute(args);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package org.hyperledger.besu.evmtool;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static org.hyperledger.besu.evm.code.EOFLayout.EOFContainerMode.INITCODE;
|
||||
import static picocli.CommandLine.ScopeType.INHERIT;
|
||||
|
||||
import org.hyperledger.besu.cli.config.NetworkName;
|
||||
@@ -34,6 +35,7 @@ import org.hyperledger.besu.evm.Code;
|
||||
import org.hyperledger.besu.evm.EVM;
|
||||
import org.hyperledger.besu.evm.EvmSpecVersion;
|
||||
import org.hyperledger.besu.evm.code.CodeInvalid;
|
||||
import org.hyperledger.besu.evm.code.CodeV1;
|
||||
import org.hyperledger.besu.evm.frame.MessageFrame;
|
||||
import org.hyperledger.besu.evm.log.LogsBloomFilter;
|
||||
import org.hyperledger.besu.evm.tracing.OperationTracer;
|
||||
@@ -418,11 +420,21 @@ public class EvmToolCommand implements Runnable {
|
||||
if (codeBytes.isEmpty() && !createTransaction) {
|
||||
codeBytes = component.getWorldState().get(receiver).getCode();
|
||||
}
|
||||
Code code = evm.getCodeForCreation(codeBytes);
|
||||
Code code =
|
||||
createTransaction ? evm.getCodeForCreation(codeBytes) : evm.getCodeUncached(codeBytes);
|
||||
if (!code.isValid()) {
|
||||
out.println(((CodeInvalid) code).getInvalidReason());
|
||||
return;
|
||||
} else if (code.getEofVersion() == 1
|
||||
&& createTransaction
|
||||
!= INITCODE.equals(((CodeV1) code).getEofLayout().containerMode().get())) {
|
||||
out.println(
|
||||
createTransaction
|
||||
? "--create requires EOF in INITCODE mode"
|
||||
: "To evaluate INITCODE mode EOF code use the --create flag");
|
||||
return;
|
||||
}
|
||||
|
||||
final Stopwatch stopwatch = Stopwatch.createUnstarted();
|
||||
long lastTime = 0;
|
||||
do {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"cli": [
|
||||
"--notime",
|
||||
"--json",
|
||||
"--create",
|
||||
"--code",
|
||||
"ef00010100040200010001040000000080000000c0de471fe5",
|
||||
"--coinbase",
|
||||
"4444588443C3A91288C5002483449ABA1054192B",
|
||||
"--fork",
|
||||
"CancunEOF"
|
||||
],
|
||||
"stdin": "",
|
||||
"stdout": "EOF Code Invalid : STOP is only a valid opcode in containers used for runtime operations.\n"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"cli": [
|
||||
"--notime",
|
||||
"--json",
|
||||
"--code",
|
||||
"ef00010100040200010001040000000080000000",
|
||||
"--coinbase",
|
||||
"4444588443C3A91288C5002483449ABA1054192B",
|
||||
"--fork",
|
||||
"CancunEOF"
|
||||
],
|
||||
"stdin": "",
|
||||
"stdout": [
|
||||
{"pc":0,"section":0,"op":0,"gas":"0x2540be400","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"},
|
||||
{"gasUser":"0x0","gasTotal":"0x0","output":"0x"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"cli": [
|
||||
"--notime",
|
||||
"--json",
|
||||
"--code",
|
||||
"ef00010100040200010009030001001404000000008000035f355f5fa15f5fee00ef00010100040200010001040000000080000000",
|
||||
"--coinbase",
|
||||
"4444588443C3A91288C5002483449ABA1054192B",
|
||||
"--fork",
|
||||
"CancunEOF"
|
||||
],
|
||||
"stdin": "",
|
||||
"stdout": "To evaluate INITCODE mode EOF code use the --create flag\n"
|
||||
}
|
||||
Reference in New Issue
Block a user