diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 53ae53828..e241cf129 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -651,18 +651,11 @@ func stateUpdateByHash(txn db.Transaction, hash *felt.Felt) (*core.StateUpdate, } func l1HandlerTxnHashByMsgHash(txn db.Transaction, l1HandlerMsgHash *common.Hash) (*felt.Felt, error) { - l1HandlerTxnHash := new(felt.Felt) - err := txn.Get(db.L1HandlerTxnHashByMsgHash.Key(l1HandlerMsgHash.Bytes()), func(val []byte) error { - if len(val) == 0 { - return db.ErrKeyNotFound - } + l1HandlerTxnHash := new(felt.Felt).SetUint64(0) + return l1HandlerTxnHash, txn.Get(db.L1HandlerTxnHashByMsgHash.Key(l1HandlerMsgHash.Bytes()), func(val []byte) error { l1HandlerTxnHash.Unmarshal(val) return nil }) - if err != nil { - return nil, err - } - return l1HandlerTxnHash, nil } // SanityCheckNewHeight checks integrity of a block and resulting state update diff --git a/node/node.go b/node/node.go index 442ecb31b..e677bd8b4 100644 --- a/node/node.go +++ b/node/node.go @@ -302,7 +302,9 @@ func New(cfg *Config, version string) (*Node, error) { //nolint:gocyclo,funlen return n, nil } -func newL1Client(ethNode string, includeMetrics bool, chain *blockchain.Blockchain, log utils.SimpleLogger) (*l1.Client, l1.Subscriber, error) { +func newL1Client(ethNode string, includeMetrics bool, chain *blockchain.Blockchain, + log utils.SimpleLogger, +) (*l1.Client, l1.Subscriber, error) { ethNodeURL, err := url.Parse(ethNode) if err != nil { return nil, nil, fmt.Errorf("parse Ethereum node URL: %w", err)