Comments (8)
is it okay to fail reading this file once? If yes we may just set nVersionRequired to 70100 on writing and instruct users to ignore the error one time at startup
from komodo.
The logic within ReadFeeEstimates seems to be there to protect the code from reading "older" versions. And to the code, a lower number is an older version.
Changing nVersionRequired in ReadFeeEstimates disables the "version protection" feature of the function, so I imagine that is not what you were suggesting.
Changing nVersionRequired in WriteFeeEstimates would fix this issue for new clients, but would not solve the problem for clients that had the previous version. The error would still appear. In addition, the "version protection" would not work as intended for versions between 70100 and 109900. I do not know the history of those version numbers, so am unsure if that is a real problem or not (I am guessing not).
Other possible options:
- Fix CLIENT_VERSION to something above 109900 (logical)
- Add logic that specifically looks for 109900 and "does the right thing" (yuck)
- change nVersionRequired as you suggested and deal with the error message, making sure each run of komodod writes the file so that the error only appears once, only after the "upgrade". (the lazy but tolerable fix)
Update: I have verified that the fee estimate file is written on komodod shutdown, so with option 3, the error will only appear once if komodod shuts down properly.
Sample test: https://github.com/KomodoPlatform/komodo/compare/dev...jmjatlanta:jmj_issue_523?expand=1
from komodo.
I agree that much better is to provide compatibility with the files written with the 109900 value
maybe we could make a special case for it:
from now on write with nVersionRequired == 70100
but allow also to read old files with 109900:
filein >> nVersionRequired >> nVersionThatWrote;
if (nVersionRequired > CLIENT_VERSION && nVersionRequired != 109900 /*allow old files*/)
return error("CTxMemPool::ReadFeeEstimates(): up-version (%d) fee estimate file", nVersionRequired);
assuming the format has never changed in our codebase. So we establish protection for future versions
from komodo.
My offer is to change version required to read in WriteFeeEstimates
to 70100, like:
bool
CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
{
try {
LOCK(cs);
fileout << 70100; // version required to read: 0.7.1.0 or later
And users with existing fee_estimates.dat
who will have the:
ERROR: CTxMemPool::ReadFeeEstimates(): up-version (109900) fee estimate file
should just delete the file and let the app re-create it.
from komodo.
Even no need to delete the file. The error would show once on the first startup and the file will be overwritten on next write.
But maybe we need to provide that the error won't show itself and the file is read okay even at the first run ?
from komodo.
Maybe. But i just don't like "special cases". What if we will add 109900 as an exception, but in future the format of this file will be changed and this exception will cause unforeseen consequences? I always vote for clean logic without "special cases" and "workaround of workarounds". Value of 109900 obviously was a mistake / oversight during version changing, so, i vote for totally get get rid of it, instead of turn it into exception.
from komodo.
Even no need to delete the file. The error would show once on the first startup and the file will be overwritten on next write. But maybe we need to provide that the error won't show itself and the file is read okay even at the first run ?
What about changing ERROR:
to Warning:
and perhaps changing the verbiage to denote that processing will continue (as does a nearby message)?
from komodo.
Maybe let's add a small PR with a fix like this DeckerSU/KomodoOcean@eccb8f7 to close this issue too
from komodo.
Related Issues (20)
- 'Make clean' does not clean .a lib files HOT 1
- -testnet flag crashes komodod HOT 2
- Potential Deadlock detected with cs_vSend cs_vRecvMsg
- Detect and handle corrupt or missing blocks or indexes HOT 4
- rm `test_block_ser` HOT 1
- No ARM release for Komodod version 0.7.2
- komodod with mining on sometimes appears to hang HOT 2
- komodod crash in mining code HOT 1
- Request for new parameter
- Please port z_gettreestate RPC. HOT 3
- komodod CI py tests fail to run on Macos and Windows HOT 1
- Ubuntu 22 crashes HOT 33
- Nodes do not restore last notarisation on start-up HOT 1
- [testnet] genesis block doesn't accept during reindex HOT 2
- Get rid of CWallet::OrderedTxItems and keep wallet transactions in memory always ordered
- libzcash::PHGRProof (SproutProofVerifier) don't work when libsnark compiled with enabled optimisations on gcc 11.x
- A request to get an on-chain dataset
- valuePools (sprout, sapling) monitoring / calculation works incorrectly HOT 1
- MacOS builds failing in GHA
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from komodo.