Skip to content

Fix/client caching#765

Open
patricios-space wants to merge 18 commits into
mainfrom
fix/client-caching
Open

Fix/client caching#765
patricios-space wants to merge 18 commits into
mainfrom
fix/client-caching

Conversation

@patricios-space

@patricios-space patricios-space commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

TON LogPoller and TXM could permanently stall after node restart
No context timeout when calling CreateLiteserverConnectionPool / AddConnection

Once we create a client for LogPoller and TXM it never refreshes
If a RCP goes down, the LogPoller and TXM cannot recover
We should remove the commonutils.NewLazyLoadCtx as GetClient already has caching.

LogPoller is using a signed client when it shouldn’t
Only TXM needs a signed client.

@patricios-space patricios-space force-pushed the fix/client-caching branch 4 times, most recently from 2ec1f90 to 18a4d34 Compare June 18, 2026 16:40
Comment thread integration-tests/testutils/proxy/proxy.go Outdated
Comment thread pkg/relay/chain.go Outdated

@jadepark-dev jadepark-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test harness! I agree with the direction.

First I wasn't sure about removing NewLazyLoadCtx since it was introduced to handle unreachable RPC on startup, but IIRC we already had a case where CCIPProvider blocked the plugin start and fixed by feeding a clientProvider. So it seems reasonable to relying on GetClietnt.

Also I've read a bit more into NewLazyLoadCtx and figured we're missing a Reset implementation. However, it would be more heavy lifting if we wanted TTL-based invalidation in the shared util.

Left a few comments, let me know when you have follow-up tests

Comment thread integration-tests/chain/chain_test.go Outdated
Comment thread integration-tests/chain/chain_test.go Outdated
Comment thread integration-tests/testutils/proxy/proxy.go Outdated
Comment thread integration-tests/chain/chain_test.go Outdated
Comment thread pkg/logpoller/service.go Outdated
@patricios-space patricios-space force-pushed the fix/client-caching branch 3 times, most recently from 670cde5 to 9b95972 Compare June 24, 2026 19:16
@patricios-space patricios-space marked this pull request as ready for review June 24, 2026 20:10
@patricios-space patricios-space requested a review from a team as a code owner June 24, 2026 20:10
Comment thread pkg/logpoller/service.go Outdated
Comment thread pkg/relay/chain.go Outdated
Comment thread pkg/config/config.go
@patricios-space patricios-space force-pushed the fix/client-caching branch 2 times, most recently from c0ff66a to f3f14c6 Compare June 25, 2026 20:44

@jadepark-dev jadepark-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments, Can you utilize data we have? I'd suggest to aggregate error logs from live nodes to see where we are getting the not found errors most

Comment thread pkg/logpoller/block.go Outdated
}

var resp tl.Serializable
// TBD do we need to call .WaitForBlock(shardBlock.SeqNo) here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to check the internal of

ton.GetShardBlockProof{
		ID: shardBlock,
	}

but unlikely it's fetching account state.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found this error in production logs

Comment thread pkg/logpoller/block.go Outdated
Comment thread pkg/logpoller/loader/loader.go Outdated

@vicentevieytes vicentevieytes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work

@vicentevieytes

Copy link
Copy Markdown
Collaborator

I wonder if we could add a linter check that client should not be used before waitForBlock

@patricios-space

Copy link
Copy Markdown
Collaborator Author

Accidentally closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants