Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Gas limit contract integration for Chiado #7727

Merged
merged 14 commits into from
Jun 19, 2023
12 changes: 12 additions & 0 deletions DEV_CHAIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ On the terminal you can type the following command to start node1.

```bash
./erigon --datadir=dev --chain=dev --private.api.addr=localhost:9090 --mine
```
Or, you could start the rpcdaemon internally together
```bash
./erigon --datadir=dev --chain=dev --private.api.addr=localhost:9090 --mine --http.api=eth,erigon,web3,net,debug,trace,txpool,parity,admin --http.corsdomain="*"
```

Argument notes:
Expand All @@ -32,6 +36,7 @@ On the terminal you can type the following command to start node1.
* private.api.addr=localhost:9090 : Tells where Eigon is going to listen for connections.
* mine : Add this if you want the node to mine.
* dev.period <number-of-seconds>: Add this to specify the timing interval among blocks. Number of seconds MUST be > 0 (if you want empty blocks) otherwise the default value 0 does not allow mining of empty blocks.
* http.api: List of services to start on http (rpc) access

The result will be something like this:

Expand Down Expand Up @@ -62,11 +67,18 @@ To tell Node 2 where Node 1 is we will use the Enode info of Node 1 we saved bef

Open terminal 3 and navigate to erigon/build/bin folder. Paste in the following command the Enode info and run it, be careful to remove the last part ?discport=0.

The node info of the first peer can also be obtained with an admin RPC call
```bash
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "admin_nodeInfo", "params": [], "id":83}' localhost:8545
somnathb1 marked this conversation as resolved.
Show resolved Hide resolved
```

```bash
./erigon --datadir=dev2 --chain=dev --private.api.addr=localhost:9091 \
--staticpeers="enode://d30d079163d7b69fcb261c0538c0c3faba4fb4429652970e60fa25deb02a789b4811e98b468726ba0be63b9dc925a019f433177eb6b45c23bb78892f786d8f7a@127.0.0.1:53171" \
--nodiscover
```

You might face a conflict with ports if you run it on the same machine. To specify different ports use, for instance ``--torrent.port 42079``, you might consider specifying all the other flags too: ``--port --http.port --authrpc.port ``

To check if the nodes are connected, you can go to the log of both nodes and look for the line

Expand Down
4 changes: 2 additions & 2 deletions cmd/state/exec3/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func (rw *Worker) RunTxTaskNoLock(txTask *exec22.TxTask) {
}
// Block initialisation
//fmt.Printf("txNum=%d, blockNum=%d, initialisation of the block\n", txTask.TxNum, txTask.BlockNum)
syscall := func(contract libcommon.Address, data []byte) ([]byte, error) {
return core.SysCallContract(contract, data, rw.chainConfig, ibs, header, rw.engine, false /* constCall */)
syscall := func(contract libcommon.Address, data []byte, ibs *state.IntraBlockState, header *types.Header, constCall bool) ([]byte, error) {
return core.SysCallContract(contract, data, rw.chainConfig, ibs, header, rw.engine, constCall /* constCall */)
}
rw.engine.Initialize(rw.chainConfig, rw.chain, header, ibs, txTask.Txs, txTask.Uncles, syscall)
case txTask.Final:
Expand Down
4 changes: 2 additions & 2 deletions cmd/state/exec3/state_recon.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ func (rw *ReconWorker) runTxTask(txTask *exec22.TxTask) error {
}
} else if txTask.TxIndex == -1 {
// Block initialisation
syscall := func(contract libcommon.Address, data []byte) ([]byte, error) {
return core.SysCallContract(contract, data, rw.chainConfig, ibs, txTask.Header, rw.engine, false /* constCall */)
syscall := func(contract libcommon.Address, data []byte, ibState *state.IntraBlockState, header *types.Header, constCall bool) ([]byte, error) {
return core.SysCallContract(contract, data, rw.chainConfig, ibState, header, rw.engine, constCall /* constCall */)
}

rw.engine.Initialize(rw.chainConfig, rw.chain, txTask.Header, ibs, txTask.Txs, txTask.Uncles, syscall)
Expand Down
Loading