Skip to content

Commit

Permalink
drop remnant from debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
anodar committed Oct 9, 2023
1 parent 4278196 commit e79daea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion arbnode/batch_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func AccessList(opts *AccessListOpts) types.AccessList {
StorageKeys: []common.Hash{
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000004"), // CommonParameters.{maxRefundeeBalance, extraGasMargin, calldataCost, maxGasTip}
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000005"), // CommonParameters.{maxGasCost, maxSingleGasUsage}
// allowedContracts[msg.sender]; for mainnet it's: "0x7686888b19bb7b75e46bb1aa328b65150743f4899443d722f0adf8e252ccda41".
// allowedContracts[msg.sender]; for mainnet it's: "0x7686888b19bb7b75e46bb1aa328b65150743f4899443d722f0adf8e252ccda41".
common.Hash(arbutil.PaddedKeccak256(opts.SequencerInboxAddr.Bytes(), []byte{1})),
// allowedRefundees[refundee]; for mainnet it's: "0xe85fd79f89ff278fc57d40aecb7947873df9f0beac531c8f71a98f630e1eab62".
common.Hash(arbutil.PaddedKeccak256(opts.DataPosterAddr.Bytes(), []byte{2})),
Expand Down
31 changes: 0 additions & 31 deletions arbutil/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package arbutil

import (
"bytes"
"encoding/binary"
"fmt"
"testing"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -83,32 +81,3 @@ func TestSumBytes(t *testing.T) {
})
}
}

func TestBrutforce(t *testing.T) {
M := map[common.Hash]bool{
common.HexToHash("0xa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688"): true,
common.HexToHash("0xf652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d40"): true,
common.HexToHash("0xf652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f"): true,
common.HexToHash("0xa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689"): true,
}

for i := 0; i < 256; i++ {
for j := 0; j < 256; j++ {
addr := SumBytes(PaddedKeccak256(intToBytes(t, i)), intToBytes(t, j))
if M[common.BytesToHash(addr)] {
t.Errorf("anodar yes, i: %v, j: %v, \taddr: %x", i, j, addr)
}
}

}
}

func intToBytes(t *testing.T, val int) []byte {
t.Helper()
buf := new(bytes.Buffer)
err := binary.Write(buf, binary.BigEndian, int64(val))
if err != nil {
fmt.Println("binary.Write failed:", err)
}
return buf.Bytes()
}

0 comments on commit e79daea

Please sign in to comment.