Skip to content

Commit

Permalink
Merge pull request #9937 from filecoin-project/raulk/merge-wallaby
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk authored Dec 23, 2022
2 parents f44bd27 + 5c8a02f commit f532825
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
Binary file removed build/genesis/wallabynet.car
Binary file not shown.
10 changes: 10 additions & 0 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
Data: make([]byte, 65),
},
}
default:
// XXX: Hack to make sending from f099 (and others) "just work".
// REMOVE ME.
msgApply = &types.SignedMessage{
Message: *msg,
Signature: crypto.Signature{
Type: crypto.SigTypeSecp256k1,
Data: make([]byte, 65),
},
}
}

ret, err = vmi.ApplyMessage(ctx, msgApply)
Expand Down
25 changes: 14 additions & 11 deletions node/impl/full/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ var (
_ EthEventAPI = *new(api.FullNode)
)

var EmptyLogsBloom = make([]byte, 256)

// EthModule provides the default implementation of the standard Ethereum JSON-RPC API.
//
// # Execution model reconciliation
Expand Down Expand Up @@ -650,16 +648,22 @@ func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.Et
}

func (a *EthModule) ethCallToFilecoinMessage(ctx context.Context, tx ethtypes.EthCall) (*types.Message, error) {
var err error
var from address.Address
if tx.From == nil {
if tx.From == nil || *tx.From == (ethtypes.EthAddress{}) {
// TODO: We're sending from the "burnt funds" account for now, because we need to
// send from an actual account till we deploy an EVM _account_ to this address, not
// an empty EVM contract.
//
// See https://github.com/filecoin-project/ref-fvm/issues/1173
from = builtinactors.BurntFundsActorAddr
// Send from the filecoin "system" address.
from, err = (ethtypes.EthAddress{}).ToFilecoinAddress()
if err != nil {
return nil, fmt.Errorf("failed to construct the ethereum system address: %w", err)
}
// from, err = (api.EthAddress{}).ToFilecoinAddress()
// if err != nil {
// return nil, fmt.Errorf("failed to construct the ethereum system address: %w", err)
// }
} else {
// The from address must be translatable to an f4 address.
var err error
from, err = tx.From.ToFilecoinAddress()
if err != nil {
return nil, fmt.Errorf("failed to translate sender address (%s): %w", tx.From.String(), err)
Expand Down Expand Up @@ -1637,8 +1641,8 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
BlockHash: blockHash,
BlockNumber: blockNumber,
Type: ethtypes.EthUint64(2),
LogsBloom: EmptyLogsBloom,
Logs: make([]ethtypes.EthLog, 0),
Logs: []ethtypes.EthLog{}, // empty log array is compulsory when no logs, or libraries like ethers.js break
LogsBloom: ethtypes.EmptyEthBloom[:],
}

if receipt.To == nil && lookup.Receipt.ExitCode.IsSuccess() {
Expand All @@ -1662,7 +1666,6 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
// TODO return a dummy non-zero bloom to signal that there are logs
// need to figure out how worth it is to populate with a real bloom
// should be feasible here since we are iterating over the logs anyway
receipt.LogsBloom = make([]byte, 256)
receipt.LogsBloom[255] = 0x01

receipt.Logs = make([]ethtypes.EthLog, 0, len(events))
Expand Down

0 comments on commit f532825

Please sign in to comment.