diff --git a/api/api_full.go b/api/api_full.go index b7eb20027..0ef20a52c 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -778,15 +778,15 @@ type FullNode interface { EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash EthHash, txIndex EthUint64) (EthTx, error) //perm:read EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum EthUint64, txIndex EthUint64) (EthTx, error) //perm:read - EthGetCode(ctx context.Context, address EthAddress, blkOpt string) (EthBytes, error) //perm:read - EthGetStorageAt(ctx context.Context, address EthAddress, position EthBytes, blkParam string) (EthBytes, error) //perm:read - EthGetBalance(ctx context.Context, address EthAddress, blkParam string) (EthBigInt, error) //perm:read - EthChainId(ctx context.Context) (EthUint64, error) //perm:read - NetVersion(ctx context.Context) (string, error) //perm:read - NetListening(ctx context.Context) (bool, error) //perm:read - EthProtocolVersion(ctx context.Context) (EthUint64, error) //perm:read - EthGasPrice(ctx context.Context) (EthBigInt, error) //perm:read - EthFeeHistory(ctx context.Context, blkCount uint64, newestBlk string) (EthFeeHistory, error) //perm:read + EthGetCode(ctx context.Context, address EthAddress, blkOpt string) (EthBytes, error) //perm:read + EthGetStorageAt(ctx context.Context, address EthAddress, position EthBytes, blkParam string) (EthBytes, error) //perm:read + EthGetBalance(ctx context.Context, address EthAddress, blkParam string) (EthBigInt, error) //perm:read + EthChainId(ctx context.Context) (EthUint64, error) //perm:read + NetVersion(ctx context.Context) (string, error) //perm:read + NetListening(ctx context.Context) (bool, error) //perm:read + EthProtocolVersion(ctx context.Context) (EthUint64, error) //perm:read + EthGasPrice(ctx context.Context) (EthBigInt, error) //perm:read + EthFeeHistory(ctx context.Context, blkCount uint64, newestBlk string, rewardPercentiles [][]int64) (EthFeeHistory, error) //perm:read EthMaxPriorityFeePerGas(ctx context.Context) (EthBigInt, error) //perm:read EthEstimateGas(ctx context.Context, tx EthCall) (EthUint64, error) //perm:read diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index db4f71683..e070bf914 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -997,18 +997,18 @@ func (mr *MockFullNodeMockRecorder) EthEstimateGas(arg0, arg1 interface{}) *gomo } // EthFeeHistory mocks base method. -func (m *MockFullNode) EthFeeHistory(arg0 context.Context, arg1 uint64, arg2 string) (api.EthFeeHistory, error) { +func (m *MockFullNode) EthFeeHistory(arg0 context.Context, arg1 uint64, arg2 string, arg3 [][]int64) (api.EthFeeHistory, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EthFeeHistory", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "EthFeeHistory", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(api.EthFeeHistory) ret1, _ := ret[1].(error) return ret0, ret1 } // EthFeeHistory indicates an expected call of EthFeeHistory. -func (mr *MockFullNodeMockRecorder) EthFeeHistory(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockFullNodeMockRecorder) EthFeeHistory(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthFeeHistory", reflect.TypeOf((*MockFullNode)(nil).EthFeeHistory), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthFeeHistory", reflect.TypeOf((*MockFullNode)(nil).EthFeeHistory), arg0, arg1, arg2, arg3) } // EthGasPrice mocks base method. diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 4b6ff6181..064fe3b3e 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -34,7 +34,7 @@ import ( "github.com/filecoin-project/go-state-types/proof" apitypes "github.com/filecoin-project/lotus/api/types" - "github.com/filecoin-project/lotus/chain/actors/builtin" + abuiltin "github.com/filecoin-project/lotus/chain/actors/builtin" lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/journal/alerting" @@ -230,7 +230,7 @@ type FullNodeStruct struct { EthEstimateGas func(p0 context.Context, p1 EthCall) (EthUint64, error) `perm:"read"` - EthFeeHistory func(p0 context.Context, p1 uint64, p2 string) (EthFeeHistory, error) `perm:"read"` + EthFeeHistory func(p0 context.Context, p1 uint64, p2 string, p3 [][]int64) (EthFeeHistory, error) `perm:"read"` EthGasPrice func(p0 context.Context) (EthBigInt, error) `perm:"read"` @@ -733,7 +733,7 @@ type StorageMinerStruct struct { ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data) (abi.PieceInfo, error) `perm:"admin"` - ComputeProof func(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) `perm:"read"` + ComputeProof func(p0 context.Context, p1 []abuiltin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]abuiltin.PoStProof, error) `perm:"read"` ComputeWindowPoSt func(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) `perm:"admin"` @@ -1896,14 +1896,14 @@ func (s *FullNodeStub) EthEstimateGas(p0 context.Context, p1 EthCall) (EthUint64 return *new(EthUint64), ErrNotSupported } -func (s *FullNodeStruct) EthFeeHistory(p0 context.Context, p1 uint64, p2 string) (EthFeeHistory, error) { +func (s *FullNodeStruct) EthFeeHistory(p0 context.Context, p1 uint64, p2 string, p3 [][]int64) (EthFeeHistory, error) { if s.Internal.EthFeeHistory == nil { return *new(EthFeeHistory), ErrNotSupported } - return s.Internal.EthFeeHistory(p0, p1, p2) + return s.Internal.EthFeeHistory(p0, p1, p2, p3) } -func (s *FullNodeStub) EthFeeHistory(p0 context.Context, p1 uint64, p2 string) (EthFeeHistory, error) { +func (s *FullNodeStub) EthFeeHistory(p0 context.Context, p1 uint64, p2 string, p3 [][]int64) (EthFeeHistory, error) { return *new(EthFeeHistory), ErrNotSupported } @@ -4470,15 +4470,15 @@ func (s *StorageMinerStub) ComputeDataCid(p0 context.Context, p1 abi.UnpaddedPie return *new(abi.PieceInfo), ErrNotSupported } -func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) { +func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []abuiltin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]abuiltin.PoStProof, error) { if s.Internal.ComputeProof == nil { - return *new([]builtin.PoStProof), ErrNotSupported + return *new([]abuiltin.PoStProof), ErrNotSupported } return s.Internal.ComputeProof(p0, p1, p2, p3, p4) } -func (s *StorageMinerStub) ComputeProof(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) { - return *new([]builtin.PoStProof), ErrNotSupported +func (s *StorageMinerStub) ComputeProof(p0 context.Context, p1 []abuiltin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]abuiltin.PoStProof, error) { + return *new([]abuiltin.PoStProof), ErrNotSupported } func (s *StorageMinerStruct) ComputeWindowPoSt(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) { diff --git a/api/rlp_test.go b/api/rlp_test.go index a2422564b..a6823e5ad 100644 --- a/api/rlp_test.go +++ b/api/rlp_test.go @@ -173,3 +173,17 @@ func TestDecodeError(t *testing.T) { require.NotNil(t, err, hex.EncodeToString(tc)) } } + +func TestDecode1(t *testing.T) { + b := mustDecodeHex("0x02f8758401df5e7680832c8411832c8411830767f89452963ef50e27e06d72d59fcb4f3c2a687be3cfef880de0b6b3a764000080c080a094b11866f453ad85a980e0e8a2fc98cbaeb4409618c7734a7e12ae2f66fd405da042dbfb1b37af102023830ceeee0e703ffba0b8b3afeb8fe59f405eca9ed61072") + decoded, err := ParseEthTxArgs(b) + require.NoError(t, err) + orig, err := decoded.OriginalRlpMsg() + fmt.Println(hex.EncodeToString(orig)) + + // correct f4 addr: f410fkkld55ioe7qg24wvt7fu6pbknb56ht7pt4zamxa + + fmt.Println(decoded.Sender()) + + fmt.Printf("%+v", decoded) +} diff --git a/chain/actors/builtin/builtin.go b/chain/actors/builtin/builtin.go index 6c66f6ee8..82e80365a 100644 --- a/chain/actors/builtin/builtin.go +++ b/chain/actors/builtin/builtin.go @@ -125,15 +125,6 @@ func IsBuiltinActor(c cid.Cid) bool { return false } -func IsEmbryo(c cid.Cid) bool { - name, _, ok := actors.GetActorMetaByCode(c) - if ok { - return name == "embryo" - } - - return false -} - func IsAccountActor(c cid.Cid) bool { name, _, ok := actors.GetActorMetaByCode(c) if ok { diff --git a/chain/actors/builtin/embryo.go b/chain/actors/builtin/embryo.go new file mode 100644 index 000000000..c1205c711 --- /dev/null +++ b/chain/actors/builtin/embryo.go @@ -0,0 +1,16 @@ +package builtin + +import ( + "github.com/ipfs/go-cid" + + "github.com/filecoin-project/lotus/chain/actors" +) + +func IsEmbryo(c cid.Cid) bool { + name, _, ok := actors.GetActorMetaByCode(c) + if ok { + return name == "embryo" + } + + return false +} diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index c6876077a..32e0d2615 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -6,7 +6,6 @@ import ( "encoding/json" "fmt" - builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" cbor "github.com/ipfs/go-ipld-cbor" @@ -17,6 +16,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" actorstypes "github.com/filecoin-project/go-state-types/actors" "github.com/filecoin-project/go-state-types/big" + builtintypes "github.com/filecoin-project/go-state-types/builtin" "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/network" builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" diff --git a/cli/chain.go b/cli/chain.go index 996a29f13..fdf79d464 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -17,8 +17,6 @@ import ( "strings" "time" - builtintypes "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v8/eam" "github.com/ipfs/go-cid" "github.com/urfave/cli/v2" cbg "github.com/whyrusleeping/cbor-gen" @@ -29,7 +27,9 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" + builtintypes "github.com/filecoin-project/go-state-types/builtin" evm "github.com/filecoin-project/go-state-types/builtin/v10/evm" + "github.com/filecoin-project/go-state-types/builtin/v8/eam" init8 "github.com/filecoin-project/go-state-types/builtin/v8/init" "github.com/filecoin-project/specs-actors/actors/builtin" diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index abb5dee62..08ee12dfd 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -45,7 +45,7 @@ type EthModuleAPI interface { EthGetCode(ctx context.Context, address api.EthAddress, blkOpt string) (api.EthBytes, error) EthGetStorageAt(ctx context.Context, address api.EthAddress, position api.EthBytes, blkParam string) (api.EthBytes, error) EthGetBalance(ctx context.Context, address api.EthAddress, blkParam string) (api.EthBigInt, error) - EthFeeHistory(ctx context.Context, blkCount uint64, newestBlk string) (api.EthFeeHistory, error) + EthFeeHistory(ctx context.Context, blkCount uint64, newestBlk string, rewardPercentiles [][]int64) (api.EthFeeHistory, error) EthChainId(ctx context.Context) (api.EthUint64, error) NetVersion(ctx context.Context) (string, error) NetListening(ctx context.Context) (bool, error) @@ -378,7 +378,7 @@ func (a *EthModule) EthChainId(ctx context.Context) (api.EthUint64, error) { return api.EthUint64(build.Eip155ChainId), nil } -func (a *EthModule) EthFeeHistory(ctx context.Context, blkCount uint64, newestBlkNum string) (api.EthFeeHistory, error) { +func (a *EthModule) EthFeeHistory(ctx context.Context, blkCount uint64, newestBlkNum string, rewardPercentiles [][]int64) (api.EthFeeHistory, error) { if blkCount > 1024 { return api.EthFeeHistory{}, fmt.Errorf("block count should be smaller than 1024") }