This commit is contained in:
goldsquid
2025-09-06 20:35:39 +07:00
parent d57d2bf5e1
commit a1beda8723
3 changed files with 4 additions and 72 deletions

View File

@@ -8,9 +8,9 @@ if [ ! -f "$datadir/initialized" ]; then
url="${GENESIS:-https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g}" url="${GENESIS:-https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g}"
filename=$(basename "$url") filename=$(basename "$url")
wget -P "$datadir" "$url" exec wget -P "$datadir" "$url"
GOMEMLIMIT="${CACHE_GB}GiB" sonictool --datadir "$datadir" --cache "${CACHE_GB}000" genesis "$datadir/$filename" GOMEMLIMIT="${CACHE_GB}GiB" exec sonictool --datadir "$datadir" --cache "${CACHE_GB}000" genesis "$datadir/$filename"
rm "$datadir/$filename" rm "$datadir/$filename"
touch "$datadir/initialized" touch "$datadir/initialized"
@@ -19,7 +19,7 @@ if [ ! -f "$datadir/initialized" ]; then
else else
echo "Sonic is already initialized." echo "Sonic is already initialized."
# just in case because after every shutdown this shit is corrupted by default # just in case because after every shutdown this shit is corrupted by default
# GOMEMLIMIT=28GiB sonictool --datadir "$datadir" --cache 12000 heal # GOMEMLIMIT=28GiB exec sonictool --datadir "$datadir" --cache 12000 heal
fi fi
echo "Generating new Geth node key..." echo "Generating new Geth node key..."

View File

@@ -1,68 +0,0 @@
diff --git a/ethapi/api.go b/ethapi/api.go
index 5e921033..7557719c 100644
--- a/ethapi/api.go
+++ b/ethapi/api.go
@@ -2284,17 +2284,18 @@ func (api *PublicDebugAPI) traceBlock(ctx context.Context, block *evmcore.EvmBlo
}
res, err := api.traceTx(ctx, tx, msg, txctx, block.Header(), statedb, config, nil)
if err != nil {
- return nil, err
+ results[i] = &txTraceResult{TxHash: tx.Hash(), Error: err.Error()}
+ resultsLength += len(err.Error())
+ } else {
+ results[i] = &txTraceResult{TxHash: tx.Hash(), Result: res}
+ resultsLength += len(res)
}
+ statedb.Finalise()
// limit the response size.
- resultsLength += len(res)
if api.maxResponseSize > 0 && resultsLength > api.maxResponseSize {
return nil, ErrMaxResponseSize
}
-
- results[i] = &txTraceResult{TxHash: tx.Hash(), Result: res}
- statedb.Finalise()
}
return results, nil
}
@@ -2344,6 +2345,16 @@ func stateAtTransaction(ctx context.Context, block *evmcore.EvmBlock, txIndex in
statedb.Release()
return nil, nil, err
}
+
+ // For now, Sonic only supports Blob transactions without blob data.
+ if msg.BlobHashes != nil {
+ if len(msg.BlobHashes) > 0 {
+ continue // blob data is not supported - this tx will be skipped
+ }
+ // PreCheck requires non-nil blobHashes not to be empty
+ msg.BlobHashes = nil
+ }
+
statedb.SetTxContext(tx.Hash(), idx)
if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas())); err != nil {
statedb.Release()
diff --git a/evmcore/state_processor.go b/evmcore/state_processor.go
index 202ebe56..023b5ac5 100644
--- a/evmcore/state_processor.go
+++ b/evmcore/state_processor.go
@@ -113,6 +113,16 @@ func ApplyTransactionWithEVM(msg *core.Message, config *params.ChainConfig, gp *
txContext := NewEVMTxContext(msg)
evm.Reset(txContext, statedb)
+ // For now, Sonic only supports Blob transactions without blob data.
+ if msg.BlobHashes != nil {
+ if len(msg.BlobHashes) > 0 {
+ statedb.Finalise()
+ return nil, fmt.Errorf("blob data is not supported")
+ }
+ // PreCheck requires non-nil blobHashes not to be empty
+ msg.BlobHashes = nil
+ }
+
// Apply the transaction to the current state (included in the env).
result, err := core.ApplyMessage(evm, msg, gp)
if err != nil {
--
2.43.0

View File

@@ -66,7 +66,7 @@ services:
- 6060 - 6060
environment: environment:
- CACHE_GB=${SONIC_CACHE_GB:-28} - CACHE_GB=${SONIC_CACHE_GB:-28}
- GENESIS=https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic-39800-full.g - GENESIS=https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic-39800-pruned.g
- IP=${IP} - IP=${IP}
- SONIC_HOME=/var/sonic - SONIC_HOME=/var/sonic
command: command: