Skip to content

rpc: clean up the superblocks function and add magnitude to getmininginfo #1966

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

Merged
merged 2 commits into from
Nov 14, 2020

Conversation

jamescowens
Copy link
Member

@jamescowens jamescowens commented Nov 12, 2020

This cleans up the lookback logic in the superblocks rpc function and adds the cpid magnitude to the getmininginfo rpc function.

This function should simply return the specified lookback number
of superblocks rather than an approximation of days. This
implements the desired behavior.
@jamescowens jamescowens self-assigned this Nov 12, 2020
@jamescowens jamescowens added this to the Hilda milestone Nov 12, 2020
Copy link

@presciencia presciencia left a comment

Choose a reason for hiding this comment

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

Should last commit be squashed?

Sorry if I am being annoying, I am learning project policy. I read CONTRIBUTING.md a moment before...

If your pull request contains fixup commits (commits that change the same line of code repeatedly) or too fine-grained commits, you may be asked to squash your commits before it will be merged.

@jamescowens
Copy link
Member Author

jamescowens commented Nov 13, 2020

Only a little annoying. :) I know the policy since I approved it... :). I will probably squash everything once all of the reviews are in. Remember the PR simply tracks all of the commits from the reference branch...

@cyrossignol
Copy link
Member

@presciencia If you open a PR, please try to squash your frivolous commits when possible. It's a bit of trouble, but it helps in several ways. As a habit, I try to review each commit individually for security problems and potential issues with reverts/rebasing, and I use Git's blame, bisect, grep, log, etc. extensively to locate and understand changes. These are much more pleasant with a clean history.

Perhaps more importantly, individuals and business may give merit to well-managed projects. I remember reading a discussion about a different cryptocurrency's experience trying to get listing with Coinbase—the exchange was very scrupulous of code quality and source code management. I'm sure other businesses have similar standards—besides the financial risk, they may maintain custom implementations of project code for their services and need to review and merge upstream updates. We may attract business and strong developers by demonstrating good practices as we move forward.

Will an extra commit every now and then matter for any of this? Probably not. As a policy, though, I think it's beneficial to encourage reasonable squashing in PRs. Those piddly commits stick out like a sore thumb when the rest of the history is clean.

@jamescowens is very meticulous about this—no need to worry 🙂 It's a good question to ask, though.

@jamescowens
Copy link
Member Author

@cyrossignol is exactly right! :)

@jamescowens jamescowens merged commit c2445eb into gridcoin-community:development Nov 14, 2020
@presciencia
Copy link

Thank you @cyrossignol and @jamescowens for this info.

I did not intend offense. I wanted to confirm that I understand the policy.

I am glad knowing the project keeps good source code standards :)

@jamescowens jamescowens deleted the rpc_changes branch January 4, 2021 00:32
jamescowens added a commit that referenced this pull request Mar 1, 2021
 Added
 - gui: Add RAC column to wizard summary page projects table #1951 (@cyrossignol)
 - rpc: clean up the superblocks function and add magnitude to getmininginfo #1966 (@jamescowens)
 - rpc: Add transaction size to RPC output #1971 (@cyrossignol)
 - voting: Add user-facing support for poll response types #1976 (@cyrossignol)
 - gui: Port Bitcoin Intro class (implement the ability to choose a data directory via the GUI) #1978 (@jamescowens)
 - gui: Port Bitcoin MacOS app nap manager #1991 (@jamescowens)
 - mining, rpc: Implement staking efficiency measure and improve SelectCoinsForStaking and CreateCoinStake #1992 (@jamescowens)
 - accrual, rpc: Implement auditsnapshotaccruals #2001 (@jamescowens)
 - docs: add doxygen support #2000 (@div72)
 - beacon: Specialized beacon storage in leveldb #2009 (@jamescowens)
 - rpc: Add a call to dump contracts in binary form #2011 (@div72)
 - rpc: Add boolean option to report active beacons only in beaconreport #2013 (@jamescowens)
 - consensus: Set Hilda mainnet hardfork height to 2197000 #2022 (@jamescowens)

 Changed
 - refactor: [Memory optimization] Block index duplicate PoS state #1945 (@cyrossignol)
 - refactor: [Memory optimization] Block index superblock and contract flags #1950 (@cyrossignol)
 - refactor: [Memory optimization] Remove stake modifier checksums #1954 (@cyrossignol)
 - refactor: [Memory optimization] Block index allocation overhead #1957 (@cyrossignol)
 - refactor: [Memory optimization] Remove block index subsidy fields #1960 (@cyrossignol)
 - refactor: [Memory optimization] Separate chain trust from the block index #1961 (@cyrossignol)
 - refactor: [Memory optimization] Eliminate padding between block index fields #1962 (@cyrossignol)
 - beacon, gui: Add check for presence of beacon private key to updateBeacon() #1968 (@jamescowens)
 - util: Enhance ETTS calculation #1973 (@jamescowens)
 - refactor: Use new clamp in util.h #1975 (@jamescowens)
 - gui: Redo global status for overview #1983 (@jamescowens)
 - util: Improvements to MilliTimer class and use in the miner and init #1987 (@jamescowens)
 - rpc: Move rpc files to directory #1995 (@Pythonix)
 - rpc: Enhance consolidateunspent and fix fee calculation #1994 (@jamescowens)
 - contract: Double the lookback scope of contract replay #1998 (@jamescowens)
 - net: Don't rely on external IP resolvers #2002 (@Tetrix42)
 - beacon: Change beacon map to pointers #2008 (@jamescowens)
 - gui: Update bitcoin_sv.ts #2014 (@sweede-se)
 - util: Update snapshot URLs and add accrual directory #2019 (@jamescowens)
 - beacon: Tweak BeaconRegistry::Revert #2020 (@jamescowens)
 - rpc, qt: bump fees @2023 (@div72)

 Removed
 - researcher: Remove automatic legacy beacon key import #1963 (@cyrossignol)
 - util: Revert "Close LevelDB after loading the block index" #1969 (@cyrossignol)
 - ci: Fix python symlink issue & remove travis #1990 (@div72)
 - ci: remove python workaround #2005 (@div72)

 Fixed
 - gui: fix mandatory/leisure detection of upgrade check #1959 (@Pythonix)
 - voting: Fix title in "gettransaction" RPC for legacy poll contracts @1970 (@cyrossignol)
 - gui: Fix missing menu items on macOS #1972 (@scribblemaniac)
 - rpc: Fix answer offset in "votedetails" #1974 (@cyrossignol)
 - voting: Implement missing try-catch in VotingVoteDialog::vote #1980 (@jamescowens)
 - scraper: Add check for minimum housekeeping complete in scraper #1977 (@jamescowens)
 - voting: Fix nonsense vote weights for legacy polls #1988 (@cyrossignol)
 - voting: Fix incorrect field returned in ResolveMoneySupplyForPoll() #1989 (@cyrossignol)
 - consensus, accrual: Fix newbie accrual #2004 (@jamescowens)
 - log: grammar correction #2016 (@nathanielcwm)
 - wallet: Correct nMinFee fee calculation in CreateTransaction #2021 (@jamescowens)
 - rpc, miner: Correct GetLastStake #2026 (@jamescowens)
 - wallet: Fix bug in CreateTransaction causing insufficient fees #2029 (@jamescowens)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants