forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* setting up some initial work to link sequences stage to the txpool * vendoring the txpool into erigon * transactions getting from the pool to the sequencer stage * some progress on the sequencer creating a block * interhashes progress for sequencer * tweaks to sequencer work * further work on sequencer * txpool erigon-lib code removal * some more txpool erigon-lib removal * extracting some zk concerns from send raw transaction call
- Loading branch information
Showing
23 changed files
with
4,421 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package commands | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/ledgerwatch/erigon-lib/common" | ||
"github.com/ledgerwatch/erigon-lib/common/hexutility" | ||
"github.com/ledgerwatch/erigon/zk/sequencer" | ||
"github.com/ledgerwatch/erigon/zk/zkchainconfig" | ||
"github.com/ledgerwatch/erigon/zkevm/jsonrpc/client" | ||
"math/big" | ||
) | ||
|
||
func (api *APIImpl) isZkNonSequencer(chainId *big.Int) bool { | ||
return !sequencer.IsSequencer() && zkchainconfig.IsZk(chainId.Uint64()) | ||
} | ||
|
||
func (api *APIImpl) sendTxZk(rpcUrl string, encodedTx hexutility.Bytes, chainId uint64) (common.Hash, error) { | ||
res, err := client.JSONRPCCall(rpcUrl, "eth_sendRawTransaction", encodedTx) | ||
if err != nil { | ||
return common.Hash{}, err | ||
} | ||
|
||
if res.Error != nil { | ||
return common.Hash{}, fmt.Errorf("RPC error response: %s", res.Error.Message) | ||
} | ||
|
||
//hash comes in escaped quotes, so we trim them here | ||
// \"0x1234\" -> 0x1234 | ||
hashHex := strings.Trim(string(res.Result), "\"") | ||
|
||
return common.HexToHash(hashHex), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.