Skip to content

Commit

Permalink
fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Jan 28, 2022
1 parent 74e1d67 commit e5ce400
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,17 @@ func TestProcessStateless(t *testing.T) {
blockchain, _ := NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{}, nil, nil)
defer blockchain.Stop()
var blockGasUsedExpected uint64
chain, _ := GenerateVerkleChain(gspec.Config, genesis, ethash.NewFaker(), db, 1, func(i int, gen *BlockGen) {
chain, _ := GenerateVerkleChain(gspec.Config, genesis, ethash.NewFaker(), db, 2, func(i int, gen *BlockGen) {
// TODO need to check that the tx cost provided is the exact amount used (no remaining left-over)
txCost := params.WitnessBranchWriteCost*2 + params.WitnessBranchReadCost*2 + params.WitnessChunkWriteCost*3 + params.WitnessChunkReadCost*12 + params.TxGas
blockGasUsedExpected += txCost * 2
tx, _ := types.SignTx(types.NewTransaction(uint64(i) * 3, common.Address{1, 2, 3}, big.NewInt(999), txCost, big.NewInt(875000000), nil), signer, testKey)
tx, _ := types.SignTx(types.NewTransaction(uint64(i)*3, common.Address{1, 2, 3}, big.NewInt(999), txCost, big.NewInt(875000000), nil), signer, testKey)
gen.AddTx(tx)
tx, _ = types.SignTx(types.NewTransaction(uint64(i) * 3 + 1, common.Address{}, big.NewInt(999), txCost, big.NewInt(875000000), nil), signer, testKey)
tx, _ = types.SignTx(types.NewTransaction(uint64(i)*3+1, common.Address{}, big.NewInt(999), txCost, big.NewInt(875000000), nil), signer, testKey)
gen.AddTx(tx)
txCost = params.WitnessBranchWriteCost + params.WitnessBranchReadCost*2 + params.WitnessChunkWriteCost*2 + params.WitnessChunkReadCost*10 + params.TxGas
blockGasUsedExpected += txCost
tx, _ = types.SignTx(types.NewTransaction(uint64(i) * 3 + 2, common.Address{}, big.NewInt(0), txCost, big.NewInt(875000000), nil), signer, testKey)
tx, _ = types.SignTx(types.NewTransaction(uint64(i)*3+2, common.Address{}, big.NewInt(0), txCost, big.NewInt(875000000), nil), signer, testKey)
gen.AddTx(tx)
})

Expand Down
4 changes: 0 additions & 4 deletions core/types/access_witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ func (aw *AccessWitness) touchAddressOnWrite(addr []byte) (bool, bool, bool) {
chunkValue.mode |= AccessWitnessWriteFlag
aw.Chunks[common.BytesToHash(addr)] = chunkValue
}
gas += aw.TouchAddressAndChargeGas(utils.GetTreeKeyCodeSize(addr[:]), nil)
gas += aw.TouchAddressAndChargeGas(utils.GetTreeKeyCodeKeccak(addr[:]), nil)
return gas
}

// TODO charge chunk filling costs if the leaf was previously empty in the state
/*
Expand Down

0 comments on commit e5ce400

Please sign in to comment.