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

Change the MONITORISM_LOOP_INTERVAL_MSEC as the sleepInterval for the main monitor. #51

Open
Ethnical opened this issue Aug 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Ethnical
Copy link
Collaborator

Bug Description
The MONITORISM_LOOP_INTERVAL_MSEC is used as the sleep interval for a given Monitor.
However, this can be an issue when a monitor service is trying to sync from the past.

func (m *Monitor) Run(ctx context.Context) {
	callOpts := &bind.CallOpts{Context: ctx}

	// Check for available outputs to validate

	nextOutputIndex, err := m.l2OO.NextOutputIndex(callOpts)
	if err != nil {
		m.log.Error("failed to query next output index", "err", err)
		m.nodeConnectionFailures.WithLabelValues("l1", "nextOutputIndex").Inc()
		return
	}
	if m.currOutputIndex >= nextOutputIndex.Uint64() {
		m.log.Info("waiting for next output", "index", m.currOutputIndex, "next_index", nextOutputIndex)
		return
	}

//....

}

Steps to Reproduce

Run the analyzer with an old block of the past (more than 1 week).

Expected behavior
The idea would be to ensure we are not too aggressive with the nodes RPC and also not too slow to sync monitoring.

Configurations:

go run ../cmd/monitorism withdrawals  --l1.node.url https://proxyd-l1-consensus.primary.mainnet.prod.oplabs.cloud --loop.interval.msec 200 --optimismportal.address 0xbEb5Fc579115071764c7423A4f12eDde41f106Ed --start.block.height 20349662 --l2.node.url https://proxyd-l2-consensus.primary.mainnet.prod.oplabs.cloud

Logs:
We can see some issue with the latest block is out of range for example.

INFO [08-15|18:05:40.007] no new blocks                            next_height=20,535,111 latest_height=20,535,110
INFO [08-15|18:05:40.206] no new blocks                            next_height=20,535,111 latest_height=20,535,110
INFO [08-15|18:05:40.406] no new blocks                            next_height=20,535,111 latest_height=20,535,110
INFO [08-15|18:05:40.607] querying block range                     from_height=20,535,111 to_height=20,535,111
ERROR[08-15|18:05:40.640] failed to query withdrawal proven event logs err="400 Bad Request: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32019,\"message\":\"block is out of range\"},\"id\":1945}\n"

Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.

@Ethnical Ethnical added the bug Something isn't working label Aug 15, 2024
@Ethnical Ethnical added enhancement New feature or request and removed bug Something isn't working labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant