Skip to content

Commit

Permalink
Add --txpool.nolocals to forno full nodes (#8499)
Browse files Browse the repository at this point in the history
### Description

A small change made along with @piersy when forno was having some issues. `--txpool.nolocals` is recommended when exposing nodes publicly: ethereum/go-ethereum#18242 (comment).

We noticed it took a really long time for the command to find the most recent block timestamp, which was due to the `transactions.rlp` file being loaded. Adding `--txpool.nolocals` causes that to not be loaded or written to.

I added the `--txpool.nolocals` only for GCP-based full nodes, which I believe are only used for forno (@jcortejoso correct me if I'm wrong or if this will mess other infrastructure up that I'm not familiar with).

### Other changes

n/a

### Tested

Deployed forno full nodes

### Related issues

n/a

### Backwards compatibility

backward compatible

### Documentation

n/a
  • Loading branch information
tkporter committed Aug 10, 2021
1 parent 8146217 commit 7a6d0de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/celotool/src/lib/k8s-fullnode/gcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class GCPFullNodeDeployer extends BaseFullNodeDeployer {
`--set storage.storageClass=ssd`,
`--set geth.public_ip_per_node='{${staticIps}}'`,
`--set geth.create_network_endpoint_group=${this.deploymentConfig.createNEG}`,
`--set geth.flags='--txpool.nolocals'`,
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/helm-charts/common/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ prometheus.io/port: "{{ $pprof.port | default 6060 }}"
- "-c"
- |
if [ -d /root/.celo/celo/chaindata ]; then
lastBlockTimestamp=$(timeout 120 geth console --maxpeers 0 --light.maxpeers 0 --syncmode full --exec "eth.getBlock(\"latest\").timestamp")
lastBlockTimestamp=$(timeout 600 geth console --maxpeers 0 --light.maxpeers 0 --syncmode full --txpool.nolocals --exec "eth.getBlock(\"latest\").timestamp")
day=$(date +%s)
diff=$(($day - $lastBlockTimestamp))
# If lastBlockTimestamp is older than 1 day old, pull the chaindata rather than using the current PVC.
Expand Down

0 comments on commit 7a6d0de

Please sign in to comment.