From a1beda87231d07cbbab91d163bf05df617790d2d Mon Sep 17 00:00:00 2001 From: goldsquid Date: Sat, 6 Sep 2025 20:35:39 +0700 Subject: [PATCH] fix --- sonic/scripts/entrypoint.sh | 6 +- sonic/sonic.patch | 68 ---------------------- sonic/sonic/sonic-mainnet-sonic-pruned.yml | 2 +- 3 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 sonic/sonic.patch diff --git a/sonic/scripts/entrypoint.sh b/sonic/scripts/entrypoint.sh index e1ece04c..d00e3242 100644 --- a/sonic/scripts/entrypoint.sh +++ b/sonic/scripts/entrypoint.sh @@ -8,9 +8,9 @@ if [ ! -f "$datadir/initialized" ]; then url="${GENESIS:-https://genesis.soniclabs.com/sonic-mainnet/genesis/sonic.g}" 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" touch "$datadir/initialized" @@ -19,7 +19,7 @@ if [ ! -f "$datadir/initialized" ]; then else echo "Sonic is already initialized." # 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 echo "Generating new Geth node key..." diff --git a/sonic/sonic.patch b/sonic/sonic.patch deleted file mode 100644 index 05826508..00000000 --- a/sonic/sonic.patch +++ /dev/null @@ -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 diff --git a/sonic/sonic/sonic-mainnet-sonic-pruned.yml b/sonic/sonic/sonic-mainnet-sonic-pruned.yml index ae497ac6..ccd73935 100644 --- a/sonic/sonic/sonic-mainnet-sonic-pruned.yml +++ b/sonic/sonic/sonic-mainnet-sonic-pruned.yml @@ -66,7 +66,7 @@ services: - 6060 environment: - 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} - SONIC_HOME=/var/sonic command: