') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Move `channel_reestablish` messages to the `simple` message fuzzer by TheBlueMatt · Pull Request #2266 · lightningdevkit/rust-lightning · GitHub
Skip to content

Move channel_reestablish messages to the simple message fuzzer - #2266

Closed
TheBlueMatt wants to merge 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2023-04-fix-reestablish-msg-fuzz
Closed

Move channel_reestablish messages to the simple message fuzzer#2266
TheBlueMatt wants to merge 1 commit into
lightningdevkit:mainfrom
TheBlueMatt:2023-04-fix-reestablish-msg-fuzz

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

In 16d0f2f the
ChannelReestablish messages was converted to the impl_writeable_msg serialization macro which handles a TLV stream suffix. In the case of our fuzzers, this implies we need to use the test_msg_simple checker rather than the test_msg one.

test_msg checks that any bytes which were read must be present when we write the message back out, which is useful for gossip processing, however if we don't store ignored TLVs we cannot possibly meet the requirements.

Instead, test_msg_simple only ensures that, if we serialized the message we can round-trip it exactly, i.e. at least the fields we understand round-trip.

In 16d0f2f the
`ChannelReestablish` messages was converted to the
`impl_writeable_msg` serialization macro which handles a TLV stream
suffix. In the case of our fuzzers, this implies we need to use the
`test_msg_simple` checker rather than the `test_msg` one.
`test_msg` checks that any bytes which were read must be present
when we write the message back out, which is useful for gossip
processing, however if we don't store ignored TLVs we cannot
possibly meet the requirements.
Instead, `test_msg_simple` only ensures that, if we serialized the
message we can round-trip it exactly, i.e. at least the fields we
understand round-trip.

@wpaulinowpaulino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW @dunxen fixed this in #1794.

@TheBlueMatt

TheBlueMatt commented May 4, 2023

Copy link
Copy Markdown
CollaboratorAuthor

Oh, right, I knew I'd seen this patch somewhere lol. I'm fine to leave it for that if we land that tomorrow, its just broken on main and CI is randomly failing.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Patch coverage has no change and project coverage change: -0.02⚠️

Comparison is base (e94647c) 91.50% compared to head (bce9cf2) 91.48%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@ Coverage Diff @@## main #2266 +/- ##
==========================================
- Coverage 91.50% 91.48% -0.02% 
==========================================
Files 104 104 Lines 52087 52087 Branches 52087 52087 ==========================================
- Hits 47660 47652 -8 - Misses 4427 4435 +8 

see 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TheBlueMatt

Copy link
Copy Markdown
CollaboratorAuthor

Eh, lets just land #1794 tomorrow.

@dunxen

Copy link
Copy Markdown
Contributor

Ugh, sorry about this. Should have copied it over. But I've addressed feedback in #1794 so hopefully good to go.

Sign up for freeto 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.

4 participants

@TheBlueMatt@codecov-commenter@dunxen@wpaulino