From 1fb74c7830cea7768fe69176f6d47be7ede61a2e Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Wed, 12 Jul 2023 00:28:54 +0000 Subject: [PATCH] remove timestamp from ExpiredMerkleRootSnapshot event --- arbos/block_processor.go | 2 +- arbos/internal_tx.go | 3 +-- contracts | 2 +- precompiles/ArbRetryableTx.go | 4 ++-- precompiles/precompile.go | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/arbos/block_processor.go b/arbos/block_processor.go index 298d1e6482..49603c7071 100644 --- a/arbos/block_processor.go +++ b/arbos/block_processor.go @@ -44,7 +44,7 @@ var L2ToL1TxEventID common.Hash var EmitReedeemScheduledEvent func(*vm.EVM, uint64, uint64, [32]byte, [32]byte, common.Address, *big.Int, *big.Int) error var EmitTicketCreatedEvent func(*vm.EVM, [32]byte) error var EmitExpiredMerkleUpdateEvent func(*vm.EVM, [32]byte, *big.Int) error -var EmitExpiredMerkleRootSnapshotEvent func(*vm.EVM, [32]byte, uint64, uint64) error +var EmitExpiredMerkleRootSnapshotEvent func(*vm.EVM, [32]byte, uint64) error var EmitRetryableExpiredEvent func(*vm.EVM, [32]byte, *big.Int, [32]byte, uint64) error type L1Info struct { diff --git a/arbos/internal_tx.go b/arbos/internal_tx.go index 3eee4b6c47..0e46ddd7f7 100644 --- a/arbos/internal_tx.go +++ b/arbos/internal_tx.go @@ -114,8 +114,7 @@ func ApplyInternalTxUpdate(tx *types.ArbitrumInternalTx, state *arbosState.Arbos if err != nil { log.Error("Failed to try rotating expired root snapshots", "err", err) } else if newRootSnapshot != nil { - // TODO(magic) do we want to emit current time? it could be sourced later on based on block number in log, but probably would require query for the block header - if err = EmitExpiredMerkleRootSnapshotEvent(evm, *newRootSnapshot, expiredSize, currentTime); err != nil { + if err = EmitExpiredMerkleRootSnapshotEvent(evm, *newRootSnapshot, expiredSize); err != nil { log.Error("Failed to emit ExpiredMerkleRootSnapshot event", "err", err) } } diff --git a/contracts b/contracts index 31473f5aee..b73181034e 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit 31473f5aeec9c9cff00f0f6aa2c39bea809c3aa1 +Subproject commit b73181034e5c560e2a0f7fb0aa28dd81ac432b63 diff --git a/precompiles/ArbRetryableTx.go b/precompiles/ArbRetryableTx.go index 99012ac523..6a6c450660 100644 --- a/precompiles/ArbRetryableTx.go +++ b/precompiles/ArbRetryableTx.go @@ -24,14 +24,14 @@ type ArbRetryableTx struct { RedeemScheduled func(ctx, mech, bytes32, bytes32, uint64, uint64, addr, huge, huge) error Canceled func(ctx, mech, bytes32) error ExpiredMerkleUpdate func(ctx, mech, bytes32, huge) error - ExpiredMerkleRootSnapshot func(ctx, mech, bytes32, uint64, uint64) error + ExpiredMerkleRootSnapshot func(ctx, mech, bytes32, uint64) error RetryableExpired func(ctx, mech, bytes32, huge, bytes32, uint64) error TicketCreatedGasCost func(bytes32) (uint64, error) LifetimeExtendedGasCost func(bytes32, huge) (uint64, error) RedeemScheduledGasCost func(bytes32, bytes32, uint64, uint64, addr, huge, huge) (uint64, error) CanceledGasCost func(bytes32) (uint64, error) ExpiredMerkleUpdateGasCost func(bytes32, huge) (uint64, error) - ExpiredMerkleRootSnapshotGasCost func(bytes32, uint64, uint64) (uint64, error) + ExpiredMerkleRootSnapshotGasCost func(bytes32, uint64) (uint64, error) RetryableExpiredGasCost func(bytes32, huge, bytes32, uint64) (uint64, error) // deprecated event diff --git a/precompiles/precompile.go b/precompiles/precompile.go index d96a955ab0..90752b154a 100644 --- a/precompiles/precompile.go +++ b/precompiles/precompile.go @@ -577,9 +577,9 @@ func Precompiles() map[addr]ArbosPrecompile { context := eventCtx(ArbRetryableImpl.ExpiredMerkleUpdateGasCost(hash{}, common.Big0)) return ArbRetryableImpl.ExpiredMerkleUpdate(context, evm, nodeHash, position) } - arbos.EmitExpiredMerkleRootSnapshotEvent = func(evm mech, root bytes32, numLeaves uint64, timestamp uint64) error { - context := eventCtx(ArbRetryableImpl.ExpiredMerkleRootSnapshotGasCost(hash{}, 0, 0)) - return ArbRetryableImpl.ExpiredMerkleRootSnapshot(context, evm, root, numLeaves, timestamp) + arbos.EmitExpiredMerkleRootSnapshotEvent = func(evm mech, root bytes32, numLeaves uint64) error { + context := eventCtx(ArbRetryableImpl.ExpiredMerkleRootSnapshotGasCost(hash{}, 0)) + return ArbRetryableImpl.ExpiredMerkleRootSnapshot(context, evm, root, numLeaves) } arbos.EmitRetryableExpiredEvent = func(evm mech, nodeHash bytes32, position huge, ticketId bytes32, numTries uint64) error { context := eventCtx(ArbRetryableImpl.RetryableExpiredGasCost(hash{}, common.Big0, hash{}, 0))