Skip to content

Commit bc1cd00

Browse files
committed
add more log
2 parents 40f85b3 + c88cc48 commit bc1cd00

File tree

15 files changed

+110
-20
lines changed

15 files changed

+110
-20
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ADD . /go-ethereum
2828

2929
ARG SCROLL_LIB_PATH
3030

31+
RUN apt update && apt install vim netcat-openbsd net-tools curl -y
3132
RUN mkdir -p $SCROLL_LIB_PATH
3233

3334
COPY --from=zkp-builder /app/target/release/libzkp.so $SCROLL_LIB_PATH

consensus/misc/eip1559.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header, parentL1BaseF
5555
return big.NewInt(10000000) // 0.01 Gwei
5656
}
5757
l2SequencerFee := big.NewInt(1000000) // 0.001 Gwei
58-
provingFee := big.NewInt(33700000) // 0.0337 Gwei
58+
provingFee := big.NewInt(38200000) // 0.0382 Gwei
5959

60-
// L1_base_fee * 0.0034
60+
// L1_base_fee * 0.00017
6161
verificationFee := parentL1BaseFee
62-
verificationFee = new(big.Int).Mul(verificationFee, big.NewInt(34))
63-
verificationFee = new(big.Int).Div(verificationFee, big.NewInt(10000))
62+
verificationFee = new(big.Int).Mul(verificationFee, big.NewInt(17))
63+
verificationFee = new(big.Int).Div(verificationFee, big.NewInt(100000))
6464

6565
baseFee := big.NewInt(0)
6666
baseFee.Add(baseFee, l2SequencerFee)

consensus/misc/eip1559_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ func TestCalcBaseFee(t *testing.T) {
112112
parentL1BaseFee int64
113113
expectedL2BaseFee int64
114114
}{
115-
{0, 34700000},
116-
{1000000000, 38100000},
117-
{2000000000, 41500000},
118-
{100000000000, 374700000},
119-
{111111111111, 412477777},
120-
{2164000000000, 7392300000},
121-
{2931000000000, 10000000000}, // cap at max L2 base fee
115+
{0, 39200000},
116+
{1000000000, 39370000},
117+
{2000000000, 39540000},
118+
{100000000000, 56200000},
119+
{111111111111, 58088888},
120+
{2164000000000, 407080000},
121+
{58592942000000, 10000000000}, // cap at max L2 base fee
122122
}
123123
for i, test := range tests {
124124
if have, want := CalcBaseFee(config(), nil, big.NewInt(test.parentL1BaseFee)), big.NewInt(test.expectedL2BaseFee); have.Cmp(want) != 0 {

core/state_processor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,13 @@ func TestStateProcessorErrors(t *testing.T) {
361361
txs: []*types.Transaction{
362362
mkDynamicCreationTx(0, 500000, common.Big0, misc.CalcBaseFee(config, genesis.Header(), parentL1BaseFee), tooBigInitCode[:]),
363363
},
364-
want: "could not apply tx 0 [0x8f780c3573ac61e2d7796f7b447afd0ad753623ed95bc99ef94eb083d9e0d039]: max initcode size exceeded: code size 49153 limit 49152",
364+
want: "could not apply tx 0 [0xa31de6e26bd5ffba0ca91a2bc29fc2eaad6a6cfc5ad9ab6ffb69cac121e0125c]: max initcode size exceeded: code size 49153 limit 49152",
365365
},
366366
{ // ErrIntrinsicGas: Not enough gas to cover init code
367367
txs: []*types.Transaction{
368368
mkDynamicCreationTx(0, 54299, common.Big0, misc.CalcBaseFee(config, genesis.Header(), parentL1BaseFee), smallInitCode[:]),
369369
},
370-
want: "could not apply tx 0 [0xbf812bb88c3f53402b6cf5488ac89360595e524b65582b648d1f4ef197690e89]: intrinsic gas too low: have 54299, want 54300",
370+
want: "could not apply tx 0 [0xf36b7d68cf239f956f7c36be26688a97aaa317ea5f5230d109bb30dbc8598ccb]: intrinsic gas too low: have 54299, want 54300",
371371
},
372372
} {
373373
block := GenerateBadBlock(genesis, ethash.NewFaker(), tt.txs, gspec.Config)

core/tx_pool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
707707
return ErrOversizedData
708708
}
709709
// Reject transactions that cannot fit into a block even as a single transaction
710-
if !pool.chainconfig.Scroll.IsValidBlockSize(tx.Size()) {
710+
if !pool.chainconfig.Scroll.IsValidBlockSizeForMining(tx.Size()) {
711711
return ErrOversizedData
712712
}
713713
// Check whether the init code size has been exceeded.
@@ -1378,7 +1378,7 @@ func (pool *TxPool) runReorg(done chan struct{}, reset *txpoolResetRequest, dirt
13781378
log.Debug("runReorg", "len(txs)", len(txs))
13791379
if len(txs) > dumpReorgTxHashThreshold {
13801380
for _, txs := range txs {
1381-
log.Debug("dumping runReorg tx hashes", "txHash", txs.Hash().Hex())
1381+
log.Info("dumping runReorg tx hashes", "txHash", txs.Hash().Hex())
13821382
}
13831383
}
13841384
}
@@ -1532,7 +1532,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans
15321532
hash := tx.Hash()
15331533
pool.all.Remove(hash)
15341534
pool.calculateTxsLifecycle(types.Transactions{tx}, time.Now())
1535-
log.Trace("Removed cap-exceeding queued transaction", "hash", hash)
1535+
log.Info("Removed cap-exceeding queued transaction", "hash", hash)
15361536
}
15371537
queuedRateLimitMeter.Mark(int64(len(caps)))
15381538
}

core/tx_pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ func TestValidateTxBlockSize(t *testing.T) {
26852685
account := crypto.PubkeyToAddress(key.PublicKey)
26862686
testAddBalance(pool, account, big.NewInt(1000000000000000000))
26872687

2688-
validTx := pricedDataTransaction(1, 2100000, big.NewInt(1), key, uint64(*pool.chainconfig.Scroll.MaxTxPayloadBytesPerBlock)-128)
2688+
validTx := pricedDataTransaction(1, 2100000, big.NewInt(1), key, uint64(float64(*pool.chainconfig.Scroll.MaxTxPayloadBytesPerBlock)*float64(0.9)))
26892689
oversizedTx := pricedDataTransaction(2, 2100000, big.NewInt(1), key, uint64(*pool.chainconfig.Scroll.MaxTxPayloadBytesPerBlock))
26902690

26912691
tests := []struct {

eth/api.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,32 @@ func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
254254
return true, nil
255255
}
256256

257+
// SetRollupEventSyncedL1Height sets the synced L1 height for rollup event synchronization
258+
func (api *PrivateAdminAPI) SetRollupEventSyncedL1Height(height uint64) error {
259+
rollupSyncService := api.eth.GetRollupSyncService()
260+
if rollupSyncService == nil {
261+
return errors.New("RollupSyncService is not available")
262+
}
263+
264+
log.Info("Setting rollup event synced L1 height", "height", height)
265+
rollupSyncService.ResetStartSyncHeight(height)
266+
267+
return nil
268+
}
269+
270+
// SetL1MessageSyncedL1Height sets the synced L1 height for L1 message synchronization
271+
func (api *PrivateAdminAPI) SetL1MessageSyncedL1Height(height uint64) error {
272+
syncService := api.eth.GetSyncService()
273+
if syncService == nil {
274+
return errors.New("SyncService is not available")
275+
}
276+
277+
log.Info("Setting L1 message synced L1 height", "height", height)
278+
syncService.ResetStartSyncHeight(height)
279+
280+
return nil
281+
}
282+
257283
// PublicDebugAPI is the collection of Ethereum full node APIs exposed
258284
// over the public debugging endpoint.
259285
type PublicDebugAPI struct {

eth/backend.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,3 +609,15 @@ func (s *Ethereum) Stop() error {
609609

610610
return nil
611611
}
612+
613+
// GetRollupSyncService returns the RollupSyncService of the Ethereum instance.
614+
// It returns nil if the service is not initialized.
615+
func (e *Ethereum) GetRollupSyncService() *rollup_sync_service.RollupSyncService {
616+
return e.rollupSyncService
617+
}
618+
619+
// GetSyncService returns the SyncService of the Ethereum instance.
620+
// It returns nil if the service is not initialized.
621+
func (e *Ethereum) GetSyncService() *sync_service.SyncService {
622+
return e.syncService
623+
}

internal/web3ext/web3ext.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ web3._extend({
190190
name: 'stopWS',
191191
call: 'admin_stopWS'
192192
}),
193+
new web3._extend.Method({
194+
name: 'setRollupEventSyncedL1Height',
195+
call: 'admin_setRollupEventSyncedL1Height',
196+
params: 1
197+
}),
198+
new web3._extend.Method({
199+
name: 'setL1MessageSyncedL1Height',
200+
call: 'admin_setL1MessageSyncedL1Height',
201+
params: 1
202+
}),
193203
],
194204
properties: [
195205
new web3._extend.Property({

miner/scroll_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
742742
return false, ErrUnexpectedL1MessageIndex
743743
}
744744

745-
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSize(w.current.blockSize+tx.Size()) {
745+
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSizeForMining(w.current.blockSize+tx.Size()) {
746746
// can't fit this txn in this block, silently ignore and continue looking for more txns
747747
return false, errors.New("tx too big")
748748
}

0 commit comments

Comments
 (0)