-
Notifications
You must be signed in to change notification settings - Fork 162
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
Improve offchain #1860
Improve offchain #1860
Conversation
Needs testing |
httpGetOffChainVoteData gateways vurl metaHash anchorType = do | ||
case useIpfsGatewayMaybe vurl gateways of | ||
Nothing -> httpGetOffChainVoteDataSingle vurl metaHash anchorType | ||
Just [] -> left $ OCFErrNoIpfsGateway (OffChainVoteUrl vurl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just make this a NonEmpty
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be reading this wrong, but it looks to me like having empty gateways
is an error here. If that's correct, can we make gateways a nonempty? That would push the check up to a config check and make everywhere else a safer call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an error that doesn't bubble up. It ends up in the off_chain_vote_fetch_error table.
The user has to specify a list of gateaways, if he wants to support ipfs links
@@ -103,6 +104,7 @@ syncNodeConfig loggingCfg = | |||
<*> triggerHardFork | |||
<*> triggerHardFork | |||
<*> syncInsertOptions | |||
<*> pure [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be useful to generate ipfs_gateway
values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions for a generator to be used here? Not bvery familiar with these tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a minor hlint related comment
@@ -112,6 +112,7 @@ classifyFetchError tf fe = | |||
OCFErrIOException {} -> tf {tfIOException = tfIOException tf + 1} | |||
OCFErrTimeout {} -> tf {tfTimeout = tfTimeout tf + 1} | |||
OCFErrConnectionFailure {} -> tf {tfConnectionFailure = tfConnectionFailure tf + 1} | |||
_ -> tf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hlint always complains about _ ->
that's the only reason I've been doing _otherwise
🤷
After testing this on mainnet
|
774396d
to
27f8621
Compare
27f8621
to
19cc86e
Compare
Description
Add your description here, if it fixes a particular issue please provide a link to the issue.
Checklist
fourmolu
on version 0.10.1.0 (which can be run withscripts/fourmolize.sh
)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.