Skip to content

Commit

Permalink
Merge branch 'master' into express-lane-timeboost
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Jan 28, 2025
2 parents 4c8f61a + 3235413 commit 385e7c9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
20 changes: 11 additions & 9 deletions system_tests/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,15 +1337,17 @@ func deployOnParentChain(
ReplenishRateInBasis: 500, // 5%
}
cfg := rollupgen.Config{
MiniStakeValues: miniStakeValues,
ConfirmPeriodBlocks: 120,
StakeToken: stakeToken,
BaseStake: big.NewInt(1),
WasmModuleRoot: wasmModuleRoot,
Owner: parentChainTransactionOpts.From,
LoserStakeEscrow: parentChainTransactionOpts.From,
ChainId: chainConfig.ChainID,
ChainConfig: string(serializedChainConfig),
MiniStakeValues: miniStakeValues,
ConfirmPeriodBlocks: 120,
StakeToken: stakeToken,
BaseStake: big.NewInt(1),
WasmModuleRoot: wasmModuleRoot,
Owner: parentChainTransactionOpts.From,
LoserStakeEscrow: parentChainTransactionOpts.From,
MinimumAssertionPeriod: big.NewInt(75),
ValidatorAfkBlocks: 201600,
ChainId: chainConfig.ChainID,
ChainConfig: string(serializedChainConfig),
SequencerInboxMaxTimeVariation: rollupgen.ISequencerInboxMaxTimeVariation{
DelayBlocks: big.NewInt(60 * 60 * 24 / 15),
FutureBlocks: big.NewInt(12),
Expand Down
12 changes: 10 additions & 2 deletions system_tests/debugapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestPrestateTracingSimple(t *testing.T) {
value := big.NewInt(1e6)
tx := builder.L2Info.PrepareTx("Owner", "User2", builder.L2Info.TransferGas, value, nil)
Require(t, builder.L2.Client.SendTransaction(ctx, tx))
_, err = builder.L2.EnsureTxSucceeded(tx)
receipt, err := builder.L2.EnsureTxSucceeded(tx)
Require(t, err)

l2rpc := builder.L2.Stack.Attach()
Expand All @@ -116,9 +116,17 @@ func TestPrestateTracingSimple(t *testing.T) {
if !arbmath.BigEquals(result.Pre[receiver].Balance.ToInt(), user2OldBalance) {
Fatal(t, "Unexpected initial balance of receiver")
}
if !arbmath.BigEquals(result.Post[sender].Balance.ToInt(), arbmath.BigSub(ownerOldBalance, value)) {
expBalance := arbmath.BigSub(ownerOldBalance, value)
gas := arbmath.BigMulByUint(receipt.EffectiveGasPrice, receipt.GasUsed)
expBalance = arbmath.BigSub(expBalance, gas)
if !arbmath.BigEquals(result.Post[sender].Balance.ToInt(), expBalance) {
Fatal(t, "Unexpected final balance of sender")
}
onchain, err := builder.L2.Client.BalanceAt(ctx, sender, receipt.BlockNumber)
Require(t, err)
if !arbmath.BigEquals(result.Post[sender].Balance.ToInt(), onchain) {
Fatal(t, "Final balance of sender does not fit chain")
}
if !arbmath.BigEquals(result.Post[receiver].Balance.ToInt(), value) {
Fatal(t, "Unexpected final balance of receiver")
}
Expand Down

0 comments on commit 385e7c9

Please sign in to comment.