-
Notifications
You must be signed in to change notification settings - Fork 862
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
Polygon for DNS resolution #13202
Polygon for DNS resolution #13202
Conversation
c82bc9a
to
d684445
Compare
57dac57
to
632878d
Compare
6a730ce
to
04732b0
Compare
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.
Few comments for the sec team, but I didn't see a security review issue opened for this yet, but it looks like we're code owners on some of the changed files.
browser/net/decentralized_dns_network_delegate_helper_unittest.cc
Outdated
Show resolved
Hide resolved
bda3d8f
to
5126db2
Compare
does https://github.com/brave/brave-browser/wiki/Resolve-Methods-for-Unstoppable-Domains need an update here? also could you remind me what is the expected behavior in Tor windows? |
There are some issues in parallel regarding deprecation of DNS over HTTPS UD resolver:
UD and ENS resolvers are disabled for incognito browsers:
|
4f91656
to
80159b4
Compare
@@ -622,6 +622,8 @@ const char kAffiliateAddress[] = "0xbd9420A98a7Bd6B89765e5715e169481602D9c3d"; | |||
|
|||
const int64_t kBlockTrackerDefaultTimeInSeconds = 20; | |||
|
|||
const char kPolygonMainnetEndpoint[] = "https://mainnet-polygon.brave.com/"; |
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.
constexpr
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.
added many of them
7d207e0
@@ -92,37 +82,11 @@ void OnBeforeURLRequest_EnsRedirectWork( | |||
void OnBeforeURLRequest_UnstoppableDomainsRedirectWork( | |||
const brave::ResponseCallback& next_callback, | |||
std::shared_ptr<brave::BraveRequestInfo> ctx, |
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 think we should refactor std::shared_ptr
out. not in this PR, but as a separate issue.
cc @iefremov
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.
actually it has been with us for so long that I'm thinking of keeping it as a memorial
(just kidding)
"https://brave", | ||
"https://brave.com", | ||
"https://brave.zil", | ||
}; |
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.
the test could be simplified with struct TestCase { domain, is_valid }
to keep only one for
and altering an expected value inside.
// for more details. | ||
const constexpr char* const kRecordKeys[] = { | ||
"dweb.ipfs.hash", "ipfs.html.value", "dns.A", | ||
"dns.AAAA", "browser.redirect_url", "ipfs.redirect_domain.value"}; |
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.
a trailing comma can make such lists look better (and in-sync with the enum above).
"dweb.ipfs.hash", "ipfs.html.value", "dns.A", | ||
"dns.AAAA", "browser.redirect_url", "ipfs.redirect_domain.value"}; | ||
static_assert(static_cast<size_t>(RecordKeys::RECORD_KEY_COUNT) == | ||
sizeof(kRecordKeys) / sizeof(kRecordKeys[0]), |
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.
std::size(kRecordKeys)
should do the trick (it's now allowed).
namespace brave_wallet::unstoppable_domains { | ||
|
||
namespace { | ||
enum RecordKeys { |
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.
enum class
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.
kept plain enum so there are no static_casts when used as index in vector
DNS_AAAA, | ||
BROWSER_REDIRECT_URL, | ||
IPFS_REDIRECT_DOMAIN_VALUE, | ||
RECORD_KEY_COUNT, |
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.
kStyled
constants are preferred around Chromium. see also brave_wallet_types.h
.
https://google.github.io/styleguide/cppguide.html#Enumerator_Names
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.
chromium_src lgtm, but some other parts can be improved.
7d207e0
to
c07d7cb
Compare
@diracdeltas @kdenhartog PTAL |
"dns.AAAA", "browser.redirect_url", "ipfs.redirect_domain.value"}; | ||
static_assert(static_cast<size_t>(RecordKeys::RECORD_KEY_COUNT) == | ||
sizeof(kRecordKeys) / sizeof(kRecordKeys[0]), | ||
"dns.AAAA", "browser.redirect_url", "ipfs.redirect_domain.value", |
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.
huh, I was expecting that it will become a one column thing :)
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 seems it doesn't work like that :D
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.
if you add one more item then it will. I guess there's some logic "if it fits into two rows, keep it, otherwise do a column".
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.
Thanks, my concerns have been addressed. Looks good to me
EDIT: checked with Yan as well and she's good with this going forward. LGTM
Resolves brave/brave-browser#22147
Resolves brave/brave-browser#22151
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
These domains could be used to test polygon DNS resolution
uns-devtest-fda7a9.x
(transaction)uns-devtest-brave.x
(transaction)both should redirect to https://brave.com/