Skip to content

Commit

Permalink
fix: validate 4844 header failed
Browse files Browse the repository at this point in the history
  • Loading branch information
fearlessfe authored and GrapeBaBa committed Mar 20, 2024
1 parent 7a225ea commit bed6cd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 0 additions & 3 deletions portalnetwork/history/history_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,6 @@ func ValidateBlockHeaderBytes(headerBytes []byte, blockHash []byte) (*types.Head
if err != nil {
return nil, err
}
if header.ExcessBlobGas != nil {
return nil, errors.New("EIP-4844 not yet implemented")
}
hash := header.Hash()
if !bytes.Equal(hash[:], blockHash) {
return nil, ErrInvalidBlockHash
Expand Down
13 changes: 13 additions & 0 deletions portalnetwork/history/history_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,19 @@ func TestValidateContents(t *testing.T) {
require.NoError(t, err)
}

func TestValidateContentForCancun(t *testing.T) {
master, err := NewMasterAccumulator()
require.NoError(t, err)
historyNetwork := &HistoryNetwork{
masterAccumulator: &master,
}

key := hexutil.MustDecode("0x002149dec8fb41655fb32437a011294d7c99babb08f6adaf0bb39427d99f03521d")
value := hexutil.MustDecode("0x0800000060020000f90255a087bac4b2f672ada2dc2c840dc9c6f6ee0c334bd1a56a985b9e7ab8ce6bbd7dd4a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d493479495222290dd7278aa3ddd389cc1e1d165cc4bafe5a0e55e04845685845dced4651a6f3d0e50b356ff4c43a659aa2699db0e7b0ea463a0e93c75c5ad3c88ee280f383f4f4a17f2852640f06ebc6397e2012108b890e7d4a015cfe3074ab21cc714aaa33c951877467f7fd3c32a8ba3331d50b6451c006379b901000121100a000000020000020080201000084080000202008000000000080000000040008000000020000000020020000002010000080020000440040000280100200001080000800c080000090000002000000101204405000000000008201000000000000000000000009000000000004000000800000440900050102008060002000040000000000000000001000800000000204100080806000040000000000220006050002000000000808200020004040000000001040340001000080000000000030008800000a000000000100000002000040010100000000a00000000001320020004002000000200000000000000520012040000000000000010040080840128fca98401c9c3808310f22c8465f8821b8f6265617665726275696c642e6f7267a00b93e63eedf5c0d976e80761a4869868f3d507551095a7ae9db02d58ccd88200880000000000000000850b978050aca03d4fc5f03a4a2fac8ab5cf1050b840ae1ff004bcdf9dac16ec5f5412d2b6b78f8080a00241b464d0c5f42d85568d6611b76f84f393320981227266c2686428ca28778700")
err = historyNetwork.validateContent(key, value)
require.NoError(t, err)
}

type contentEntry struct {
key []byte
value []byte
Expand Down

0 comments on commit bed6cd9

Please sign in to comment.