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

fix: Server config index-events incorrectly marshaled #10067

Merged
merged 7 commits into from
Sep 8, 2021
Merged

fix: Server config index-events incorrectly marshaled #10067

merged 7 commits into from
Sep 8, 2021

Conversation

dwedul-figure
Copy link
Collaborator

@dwedul-figure dwedul-figure commented Sep 2, 2021

Description

Closes: #10016

Update the server config toml template to properly marshal the index-events string slice when not empty.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change (not needed)
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules (not applicable)
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code (not applicable)
  • updated the relevant documentation or specification (not applicable)
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@dwedul-figure
Copy link
Collaborator Author

Looks like a maintainer needs to give authorization in order for the CI workflows to run.

https://github.com/cosmos/cosmos-sdk/actions/runs/1195217037

This workflow is awaiting approval from a maintainer in #10067

Once that's done, and they run, I'll check off the last Author Checklist task.

@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #10067 (fb1c76f) into master (744c85b) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10067      +/-   ##
==========================================
+ Coverage   63.56%   63.58%   +0.02%     
==========================================
  Files         572      572              
  Lines       53584    53584              
==========================================
+ Hits        34059    34074      +15     
+ Misses      17582    17565      -17     
- Partials     1943     1945       +2     
Impacted Files Coverage Δ
server/config/toml.go 76.00% <ø> (+56.00%) ⬆️
crypto/keys/internal/ecdsa/privkey.go 84.21% <0.00%> (+1.75%) ⬆️

Comment on lines 235 to 237
tmpl := template.New("appConfigFileTemplate").Funcs(template.FuncMap{
"StringsJoin": strings.Join,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

i reverted this line and the tests still passed, do we need this change? (im not to well versed in this side of the code so i could be very wrong)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. I was copying stuff from the Tendermint config toml.go and thought that was needed, but it's not. I've removed it and also added a unit test on the SetConfigTemplate function to hopefully catch something being changed there and not init() or vice versa.

For reference, that "StringsJoin" is only used in the Tendermint config in one spot: rpc_servers = "{{ StringsJoin .StateSync.RPCServers "," }}". The StateSync.RPCServers field is a []string but looks like a single string in the config file. So that's not the correct thing to use for index-events where we still want it to be a list of strings in the config file.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah i see! thank you for the explanation 😄

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

tACK 👍🏻

@technicallyty technicallyty added the A:automerge Automatically merge PR once all prerequisites pass. label Sep 8, 2021
@technicallyty technicallyty merged commit eb0113e into cosmos:master Sep 8, 2021
@orijbot
Copy link

orijbot commented Sep 8, 2021

@alexanderbez
Copy link
Contributor

Thank you for the contribution @dwedul-figure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WriteConfigFile incorrectly marshals the IndexEvents field.
4 participants