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

feat(nodebuilder/state): Provide stubbed state module if a core endpoint not provided #2577

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

renaynay
Copy link
Member

This is a pre-requisite for #2511

It makes a check in CoreAccessor constructor to see if a core endpoint was provided, and returns nil CoreAccessor if not. A stubbed state module will then be provided if no core endpoint was provided so that errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial inside CoreAccessor.Start was non-blocking so it could silently fail under the hood and any calls made on state Module would return errors from the inability to reach the address that is the default for the core config (which was confusing).

@renaynay renaynay added area:node Node area:state Related to fetching state and state execution kind:feat Attached to feature PRs area:api Related to celestia-node API labels Aug 17, 2023
@renaynay renaynay self-assigned this Aug 17, 2023
nodebuilder/core/config.go Outdated Show resolved Hide resolved
nodebuilder/core/config.go Outdated Show resolved Hide resolved
nodebuilder/state/core.go Outdated Show resolved Hide resolved
nodebuilder/state/core.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #2577 (1b24356) into main (79a195c) will decrease coverage by 0.24%.
Report is 5 commits behind head on main.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main    #2577      +/-   ##
==========================================
- Coverage   51.23%   50.99%   -0.24%     
==========================================
  Files         158      158              
  Lines       10409    10444      +35     
==========================================
- Hits         5333     5326       -7     
- Misses       4613     4653      +40     
- Partials      463      465       +2     
Files Changed Coverage Δ
nodebuilder/settings.go 49.60% <80.00%> (-1.56%) ⬇️
state/core_access.go 27.97% <100.00%> (+1.02%) ⬆️

... and 4 files with indirect coverage changes

Wondertan
Wondertan previously approved these changes Aug 18, 2023
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Optional simplification nits

nodebuilder/settings.go Show resolved Hide resolved
nodebuilder/state/core.go Outdated Show resolved Hide resolved
distractedm1nd
distractedm1nd previously approved these changes Aug 21, 2023
@renaynay renaynay dismissed stale reviews from distractedm1nd and Wondertan via 2d64795 August 21, 2023 14:20
@renaynay renaynay enabled auto-merge (squash) August 21, 2023 14:27
@renaynay renaynay merged commit 13e9b1f into celestiaorg:main Aug 21, 2023
13 of 15 checks passed
renaynay added a commit to renaynay/celestia-node that referenced this pull request Aug 23, 2023
…int not provided (celestiaorg#2577)

This is a pre-requisite for celestiaorg#2511 

It makes a check in CoreAccessor constructor to see if a core endpoint
was provided, and returns nil CoreAccessor if not. A stubbed state
module will then be provided if no core endpoint was provided so that
errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial
inside CoreAccessor.Start was non-blocking so it could silently fail
under the hood and any calls made on state Module would return errors
from the inability to reach the address that is the default for the core
config (which was confusing).
walldiss pushed a commit to walldiss/celestia-node that referenced this pull request Sep 22, 2023
…int not provided (celestiaorg#2577)

This is a pre-requisite for celestiaorg#2511

It makes a check in CoreAccessor constructor to see if a core endpoint
was provided, and returns nil CoreAccessor if not. A stubbed state
module will then be provided if no core endpoint was provided so that
errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial
inside CoreAccessor.Start was non-blocking so it could silently fail
under the hood and any calls made on state Module would return errors
from the inability to reach the address that is the default for the core
config (which was confusing).

(cherry picked from commit 13e9b1f)
walldiss pushed a commit that referenced this pull request Sep 22, 2023
…int not provided (#2577)

This is a pre-requisite for #2511

It makes a check in CoreAccessor constructor to see if a core endpoint
was provided, and returns nil CoreAccessor if not. A stubbed state
module will then be provided if no core endpoint was provided so that
errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial
inside CoreAccessor.Start was non-blocking so it could silently fail
under the hood and any calls made on state Module would return errors
from the inability to reach the address that is the default for the core
config (which was confusing).

(cherry picked from commit 13e9b1f)
walldiss pushed a commit to walldiss/celestia-node that referenced this pull request Sep 22, 2023
…int not provided (celestiaorg#2577)

This is a pre-requisite for celestiaorg#2511

It makes a check in CoreAccessor constructor to see if a core endpoint
was provided, and returns nil CoreAccessor if not. A stubbed state
module will then be provided if no core endpoint was provided so that
errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial
inside CoreAccessor.Start was non-blocking so it could silently fail
under the hood and any calls made on state Module would return errors
from the inability to reach the address that is the default for the core
config (which was confusing).

(cherry picked from commit 13e9b1f)
walldiss pushed a commit to walldiss/celestia-node that referenced this pull request Sep 25, 2023
…int not provided (celestiaorg#2577)

This is a pre-requisite for celestiaorg#2511

It makes a check in CoreAccessor constructor to see if a core endpoint
was provided, and returns nil CoreAccessor if not. A stubbed state
module will then be provided if no core endpoint was provided so that
errors are more readable.

Previously, node start logic relied on the fact that the grpc Dial
inside CoreAccessor.Start was non-blocking so it could silently fail
under the hood and any calls made on state Module would return errors
from the inability to reach the address that is the default for the core
config (which was confusing).

(cherry picked from commit 13e9b1f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Related to celestia-node API area:node Node area:state Related to fetching state and state execution kind:feat Attached to feature PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants