-
Notifications
You must be signed in to change notification settings - Fork 266
Add chain-pair to prevent a header and entry mismatch #1860
Conversation
…ndent code to use chain_pair and ChainPair, add custom error variant HeaderEntryMismatch, fixing some format errors
…ors introduced due to unimplemented traits Ord and Display for contained types
…into 946-feature-chain-pair
|
Still working on this, just offline. I'm not pushing to not trigger as many CI builds. |
Add fixes. Use a convenience function, try_validate_from_entry_and_header
…nually from develop, but I should pull upstream develop
…into 946-feature-chain-pair
…p, but need a more automated way
…rs in a merge conflict 'fix'
…into 946-feature-chain-pair
…into 946-feature-chain-pair
|
|
|
i like the naming of "pair", i always have, but it seems to be very confusing to other people so 🤷♂️ |
|
Looks good to me, if tests pass... I noticed there is no diff to remove |
|
@thedavidmeister I can do a CTRL+F to rename it if preferred. Calling it just @maackle The tests were passing before the latest upstream changes were merged. Currently I can't test the latest builds since CircleCI says I have exceeded the resource usage for my plan, so tests don't build, and my laptop freezes when trying to test locally, even with swappiness on 100. Internet still hasn't been setup, there's ongoing delays. I thought I changed all |
…h_header; no need cloning chain_pair.entry() and chain_pair.header().
|
Notes: I've fixed more tests locally, but can't get I might be able to get tests to pass but it's very slow and inefficient... |
|
yeah, i found this too, rust development on anything under 16GB is not fun :/ |
|
It's failing locally on linking, presumably due to the RAM being insufficient, even with swappiness set to 100: A related question: https://stackoverflow.com/questions/5682854/why-is-the-linker-terminating-on-me-when-i-build-clang, although I don't think there's a way for me to fix this other than using a VM or my desktop with more RAM. Note: I actually cancelled the laptop order and instead ordered a wireless router that can work in client mode (this, so I can use my hotspot with the desktop via Ethernet. |
|
right, this is the main reason our CI tasks are all set to xlarge :( i don't have a solution for you (otherwise i would have fixed it for our CI) right now, but even if we fix the RAM issue it is relatively well known that compiling rust on a higher end machine runs much faster than something resource constrained RAM and CPUs make a big different i have found |
|
No worries, I just received the router today, and am just getting my mobile data back. So I should be able to use the internet on the desktop soon, and thus get everything set up and usable. |
|
@jamesray1 nice, unfortunately i think there is a price tag associated with rust work, i also had to buy several new machines to hit windows, linux, etc. |
|
Pushing from laptop, going to pull to desktop to test and finish up. |
|
See #2006 |
PR summary
Aims to close #946
By changing
EntryWithHeaderto aChainPairtuple struct (with getters etc.), and using atry_from_header_and_entry()as a constructor and not anew()constructor, this introduces a log of changes, and not only with renaming. (If people prefer I can rename back toEntryWithHeader, etc., however I made the change as I thought it would be best to make it clear that it is backwards incompatible, and it is also shows intent more clearly since the header and entry must match in a pair, rather than being any header and any entry.) The change also broke a couple of tests, since the header and entry in them didn't match, and these tests have been fixed.I also ran
cargo fmt, using a recent nightly, rather than from within the next shell. I think this is why there are a lot of changes with formatting.Contextual notes: Please bear in mind that work has been much less productive and frustratingly slow as I'm yet to sort out connecting my desktop to the internet, and my laptop only has 4 GB RAM so is slow to use and compile and/or freezes, and adjusting the swappiness etc. hasn't been effective (high swappiness—too laggy, low—too freeze-prone). This is combined with fixing merge conflicts, and further compiling, adjustments etc. Admittedly I should've arranged switching to my desktop ASAP much more quickly, and not have tried to persist with the CI build and then the laptop for so long. I'm expected to have fixed, fast, fibre internet working on Dec 2 (rather than using mobile data), so can then switch to using my desktop!testing/benchmarking notes
( if any manual testing or benchmarking was/should be done, add notes and/or screenshots here )
followups
( any new tickets/concerns that were discovered or created during this work but aren't in scope for review here )
changelog
documentation