Skip to content

Commit

Permalink
Merge branch 'master' into nitro-migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalodner authored Aug 31, 2022
2 parents 05c7349 + 0854f0b commit bdde908
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
10 changes: 5 additions & 5 deletions docs/Running_Nitro_Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Note: If you’re interested in accessing an Arbitrum chain, but you don’t wan

### Required Artifacts

- Latest Docker Image: `offchainlabs/nitro-node:v2.0.0-beta.9-f8a2ed7`
- Latest Docker Image: `offchainlabs/nitro-node:v2.0.0-292bbc4`

- Only if using Rinkeby: Rinkeby Nitro Seed Database Snapshot
- Use the parameter `--init.url="https://snapshot.arbitrum.io/rinkeby/nitro.tar"` on first startup to initialize Nitro database
Expand Down Expand Up @@ -36,7 +36,7 @@ Note: If you’re interested in accessing an Arbitrum chain, but you don’t wan
- Note that is important that `/some/local/dir/arbitrum` already exists, otherwise the directory might be created with `root` as owner, and the docker container won't be able to write to it.

```
docker run --rm -it -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v2.0.0-beta.9-f8a2ed7 --l1.url https://l1-node:8545 --l2.chain-id=<L2ChainId> --http.api=net,web3,eth,debug --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=*
docker run --rm -it -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v2.0.0-292bbc4 --l1.url https://l1-node:8545 --l2.chain-id=<L2ChainId> --http.api=net,web3,eth,debug --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=*
```

- Note that if you are running L1 node on localhost, you may need to add `--network host` right after `docker run` to use docker host-based networking
Expand Down Expand Up @@ -79,13 +79,13 @@ Note: If you’re interested in accessing an Arbitrum chain, but you don’t wan

### Arb-Relay

- When running more than one node, you want to run a single arb-relay which can provide a feed for all your nodes.
- When running more than one node, you want to run a single arb-relay per datacenter which can provide a feed for all your nodes, which will reduce ingress fees and increase stability.
The arb-relay is in the same docker image.
- Here is an example of how to run nitro-relay for Rinkeby:
```
docker run --rm -it -p 0.0.0.0:9642:9642 --entrypoint relay offchainlabs/nitro-node:v2.0.0-beta.9-f8a2ed7 --node.feed.output.addr=0.0.0.0 --node.feed.input.url wss://rinkeby.arbitrum.io/feed
docker run --rm -it -p 0.0.0.0:9642:9642 --entrypoint relay offchainlabs/nitro-node:v2.0.0-292bbc4 --node.feed.output.addr=0.0.0.0 --node.feed.input.url wss://rinkeby.arbitrum.io/feed
```
- Here is an example of how to run nitro-node for Rinkeby with custom relay:
```
docker run --rm -it -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v2.0.0-beta.9-f8a2ed7 --l1.url https://l1-rinkeby-node:8545 --l2.chain-id=421611 --http.api=net,web3,eth,debug --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=* --node.feed.input.url ws://local-relay-address:9642
docker run --rm -it -v /some/local/dir/arbitrum:/home/user/.arbitrum -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/nitro-node:v2.0.0-292bbc4 --l1.url https://l1-rinkeby-node:8545 --l2.chain-id=421611 --http.api=net,web3,eth,debug --http.corsdomain=* --http.addr=0.0.0.0 --http.vhosts=* --node.feed.input.url ws://local-relay-address:9642
```
13 changes: 7 additions & 6 deletions docs/Running_Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Note: If you’re interested in accessing the Arbitrum network but you don’t w

### Required Artifacts

- Latest Docker Image: offchainlabs/arb-node:v1.4.3-3485354
- Latest Docker Image: offchainlabs/arb-node:v1.4.4-7b84e5e

### Required parameter

Expand All @@ -28,11 +28,11 @@ Note: If you’re interested in accessing the Arbitrum network but you don’t w
- When running docker image, an external volume should be mounted to persist the database across restarts. The mount point should be `/home/user/.arbitrum/mainnet` or `/home/user/.arbitrum/rinkeby` depending on what chain you are connecting to.
- Here is an example of how to run arb-node for mainnet:
```
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.3-3485354 --l1.url=https://l1-node:8545
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.4-7b84e5e --l1.url=https://l1-node:8545
```
- Here is an example of how to run arb-node for rinkeby (only good for archive requests on pre-Nitro blocks, so probably want to enable archive as well):
```
docker run --rm -it -v /some/local/dir/arbitrum-rinkeby/:/home/user/.arbitrum/rinkeby -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.3-3485354 --l1.url=https://l1-rinkeby-node:8545
docker run --rm -it -v /some/local/dir/arbitrum-rinkeby/:/home/user/.arbitrum/rinkeby -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.4-7b84e5e --l1.url=https://l1-rinkeby-node:8545
```

### Note on permissions
Expand Down Expand Up @@ -75,14 +75,15 @@ Note: If you’re interested in accessing the Arbitrum network but you don’t w

### Arb-Relay

- When running more than one node, you want to run a single arb-relay which can provide a feed for all your nodes.
- When running more than one node, you want to run a single arb-relay per datacenter which can provide a feed for all your nodes, which will reduce ingress fees and increase stability.
The arb-relay is in the same docker image.
- Note that rinkeby testnet has been upgraded to Nitro, so rinkeby feed messages cannot be parsed by the classic node and classic relay is not required.
- Note that arb-relay now requires the extra parameter `--node.chain-id=<L2 chain id>`
- Here is an example of how to run arb-relay for mainnet:
```
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:9642:9642 --entrypoint /home/user/go/bin/arb-relay offchainlabs/arb-node:v1.4.3-3485354 --feed.input.url=wss://arb1.arbitrum.io/feed --node.chain-id=42161
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:9642:9642 --entrypoint /home/user/go/bin/arb-relay offchainlabs/arb-node:v1.4.4-7b84e5e --feed.input.url=wss://arb1.arbitrum.io/feed --node.chain-id=42161
```
- Here is an example of how to run arb-node for mainnet with custom relay:
```
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.3-3485354 --l1.url=https://l1-node:8545 --feed.input.url=ws://local-relay-address:9642
docker run --rm -it -v /some/local/dir/arbitrum-mainnet/:/home/user/.arbitrum/mainnet -p 0.0.0.0:8547:8547 -p 0.0.0.0:8548:8548 offchainlabs/arb-node:v1.4.4-7b84e5e --l1.url=https://l1-node:8545 --feed.input.url=ws://local-relay-address:9642
```
2 changes: 1 addition & 1 deletion packages/arb-rpc-node/dev/fees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func TestNonAggregatorFee(t *testing.T) {
To: &simpleAddr,
Data: (*hexutil.Bytes)(&data),
Aggregator: &emptyAgg,
})
}, nil)
test.FailIfError(t, err)
userOpts.GasLimit = uint64(estimatedGas)
t.Log("estimate:", userOpts.GasLimit)
Expand Down
9 changes: 6 additions & 3 deletions packages/arb-rpc-node/web3/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,16 @@ func (s *Server) Call(ctx context.Context, callArgs CallTxArgs, blockNum rpc.Blo
return res.ReturnData, nil
}

func (s *Server) EstimateGas(ctx context.Context, args CallTxArgs) (hexutil.Uint64, error) {
func (s *Server) EstimateGas(ctx context.Context, args CallTxArgs, optBlockNum *rpc.BlockNumberOrHash) (hexutil.Uint64, error) {
if args.To != nil && *args.To == arbos.ARB_NODE_INTERFACE_ADDRESS {
// Fake gas for call
return hexutil.Uint64(21000), nil
}
blockNum := rpc.PendingBlockNumber
snap, err := s.getSnapshot(ctx, &blockNum)
blockNum := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
if optBlockNum != nil {
blockNum = *optBlockNum
}
snap, err := s.getSnapshotForNumberOrHash(ctx, blockNum)
if err != nil {
return 0, err
}
Expand Down
2 changes: 1 addition & 1 deletion packages/arb-rpc-node/web3/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (c *EthClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uin
Value: (*hexutil.Big)(call.Value),
Data: (*hexutil.Bytes)(&call.Data),
}
gas, err := c.srv.EstimateGas(ctx, args)
gas, err := c.srv.EstimateGas(ctx, args, nil)
if err != nil {
return 0, err
}
Expand Down

0 comments on commit bdde908

Please sign in to comment.