diff --git a/arbnode/node.go b/arbnode/node.go index c567746cc1..2a1106db9e 100644 --- a/arbnode/node.go +++ b/arbnode/node.go @@ -831,7 +831,7 @@ func createNodeImpl( getExtraGas := func() uint64 { return configFetcher.Get().Staker.ExtraGas } // TODO: factor this out into separate helper, and split rest of node // creation into multiple helpers. - var wallet staker.ValidatorWalletInterface = validatorwallet.NewNoOp(l1client) + var wallet staker.ValidatorWalletInterface = validatorwallet.NewNoOp(l1client, deployInfo.Rollup) if !strings.EqualFold(config.Staker.Strategy, "watchtower") { if config.Staker.UseSmartContractWallet || txOptsValidator == nil { var existingWalletAddress *common.Address diff --git a/arbnode/resourcemanager/resource_management.go b/arbnode/resourcemanager/resource_management.go index b8bbb1f3a3..cb1ae9d6ea 100644 --- a/arbnode/resourcemanager/resource_management.go +++ b/arbnode/resourcemanager/resource_management.go @@ -24,6 +24,8 @@ var ( limitCheckDurationHistogram = metrics.NewRegisteredHistogram("arb/rpc/limitcheck/duration", nil, metrics.NewBoundedHistogramSample()) limitCheckSuccessCounter = metrics.NewRegisteredCounter("arb/rpc/limitcheck/success", nil) limitCheckFailureCounter = metrics.NewRegisteredCounter("arb/rpc/limitcheck/failure", nil) + nitroMemLimit = metrics.GetOrRegisterGauge("arb/memory/limit", nil) + nitroMemUsage = metrics.GetOrRegisterGauge("arb/memory/usage", nil) errNotSupported = errors.New("not supported") ) @@ -46,7 +48,7 @@ func Init(conf *Config) error { var c limitChecker c, err := newCgroupsMemoryLimitCheckerIfSupported(limit) if errors.Is(err, errNotSupported) { - log.Error("no method for determining memory usage and limits was discovered, disabled memory limit RPC throttling") + log.Error("No method for determining memory usage and limits was discovered, disabled memory limit RPC throttling") c = &trivialLimitChecker{} } @@ -117,7 +119,7 @@ func (s *httpServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { exceeded, err := s.c.isLimitExceeded() limitCheckDurationHistogram.Update(time.Since(start).Nanoseconds()) if err != nil { - log.Error("error checking memory limit", "err", err, "checker", s.c) + log.Error("Error checking memory limit", "err", err, "checker", s.c.String()) } else if exceeded { http.Error(w, "Too many requests", http.StatusTooManyRequests) limitCheckFailureCounter.Inc(1) @@ -236,7 +238,13 @@ func (c *cgroupsMemoryLimitChecker) isLimitExceeded() (bool, error) { if inactive, err = readFromMemStats(c.files.statsFile, c.files.inactiveRe); err != nil { return false, err } - return limit-(usage-(active+inactive)) <= c.memLimitBytes, nil + + memLimit := limit - c.memLimitBytes + memUsage := usage - (active + inactive) + nitroMemLimit.Update(int64(memLimit)) + nitroMemUsage.Update(int64(memUsage)) + + return memUsage >= memLimit, nil } func (c cgroupsMemoryLimitChecker) String() string { diff --git a/cmd/chaininfo/arbitrum_chain_info.json b/cmd/chaininfo/arbitrum_chain_info.json index e66774d426..051ccd03c5 100644 --- a/cmd/chaininfo/arbitrum_chain_info.json +++ b/cmd/chaininfo/arbitrum_chain_info.json @@ -4,7 +4,7 @@ "parent-chain-id": 1, "parent-chain-is-arbitrum": false, "sequencer-url": "https://arb1-sequencer.arbitrum.io/rpc", - "feed-url": "wss://arb1.arbitrum.io/feed", + "feed-url": "wss://arb1-feed.arbitrum.io/feed", "has-genesis-state": true, "chain-config": { @@ -54,7 +54,7 @@ "parent-chain-id": 1, "parent-chain-is-arbitrum": false, "sequencer-url": "https://nova.arbitrum.io/rpc", - "feed-url": "wss://nova.arbitrum.io/feed", + "feed-url": "wss://nova-feed.arbitrum.io/feed", "das-index-url": "https://nova.arbitrum.io/das-servers", "chain-config": { diff --git a/staker/validatorwallet/noop.go b/staker/validatorwallet/noop.go index 0a1e66d098..b050ebe861 100644 --- a/staker/validatorwallet/noop.go +++ b/staker/validatorwallet/noop.go @@ -17,11 +17,15 @@ import ( // NoOp validator wallet is used for watchtower mode. type NoOp struct { - l1Client arbutil.L1Interface + l1Client arbutil.L1Interface + rollupAddress common.Address } -func NewNoOp(l1Client arbutil.L1Interface) *NoOp { - return &NoOp{l1Client: l1Client} +func NewNoOp(l1Client arbutil.L1Interface, rollupAddress common.Address) *NoOp { + return &NoOp{ + l1Client: l1Client, + rollupAddress: rollupAddress, + } } func (*NoOp) Initialize(context.Context) error { return nil } @@ -44,7 +48,7 @@ func (*NoOp) TimeoutChallenges(ctx context.Context, challenges []uint64) (*types func (n *NoOp) L1Client() arbutil.L1Interface { return n.l1Client } -func (*NoOp) RollupAddress() common.Address { return common.Address{} } +func (n *NoOp) RollupAddress() common.Address { return n.rollupAddress } func (*NoOp) ChallengeManagerAddress() common.Address { return common.Address{} } diff --git a/system_tests/staker_test.go b/system_tests/staker_test.go index 78fa7fa83b..36b112d03a 100644 --- a/system_tests/staker_test.go +++ b/system_tests/staker_test.go @@ -218,12 +218,7 @@ func stakerTestImpl(t *testing.T, faultyStaker bool, honestStakerInactive bool) err = valWalletB.Initialize(ctx) Require(t, err) } - dpC, err := arbnode.StakerDataposter(ctx, rawdb.NewTable(l2nodeB.ArbDB, storage.StakerPrefix), l2nodeA.L1Reader, &l1authA, NewFetcherFromConfig(arbnode.ConfigDefaultL1NonSequencerTest()), nil) - if err != nil { - t.Fatalf("Error creating validator dataposter: %v", err) - } - valWalletC, err := validatorwallet.NewContract(dpC, nil, l2nodeA.DeployInfo.ValidatorWalletCreator, l2nodeA.DeployInfo.Rollup, l2nodeA.L1Reader, nil, 0, func(common.Address) {}, func() uint64 { return 10000 }) - Require(t, err) + valWalletC := validatorwallet.NewNoOp(l1client, l2nodeA.DeployInfo.Rollup) valConfig.Strategy = "Watchtower" stakerC, err := staker.NewStaker( l2nodeA.L1Reader,