Skip to content
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

HD Mint upgrades and fixes #482

Merged
merged 15 commits into from Jul 4, 2019

Conversation

@riordant
Copy link
Contributor

commented Jul 2, 2019

  • Add "zapwalletmints" conf setting
  • Fixes for encrpytion of wallet - now storing all previous mints indexed by pubcoin hash
  • Various efficiency improvements
  • Code refactor
  • Use CMintMeta objects over CSigmaEntry when showing coins in GUI - this allows for data retrieval when wallet is locked (mint secret data is now part of the HDChain and so requires unlock to access) and means that we do not have to regenerate mints for every access
  • Add walletDB functions to get pairs of serial hashes and pubCoins (for easier regeneration of mint from chain)

Note that due to WalletDB updates, existing testnet HD Sigma mints (ie. those generated after the merge of #392) will not be accessible. The amount of code required to be added to make these accessible is not worth the time at this point. Zerocoins and non-HD Sigma mints are unaffected by this.

@reubenyap reubenyap added the sigma label Jul 3, 2019
@reubenyap reubenyap added this to In progress in Zcoin Core via automation Jul 3, 2019
src/hdmint/mintpool.cpp Outdated Show resolved Hide resolved
src/hdmint/mintpool.cpp Show resolved Hide resolved
src/hdmint/mintpool.h Outdated Show resolved Hide resolved
src/hdmint/tracker.cpp Show resolved Hide resolved
src/hdmint/tracker.cpp Show resolved Hide resolved
}

uint512 CHDMintWallet::GetZerocoinSeed(uint32_t n, CKeyID& seedId)
uint512 CHDMintWallet::CreateZerocoinSeed(int32_t& n, CKeyID& seedId, bool checkIndex)

This comment has been minimized.

Copy link
@thebevrishot

thebevrishot Jul 3, 2019

Member

If we do not modify n, please do not pass by reference.

This comment has been minimized.

Copy link
@thebevrishot

thebevrishot Jul 4, 2019

Member

Actually I except something like int32_t n.

This comment has been minimized.

Copy link
@riordant

riordant Jul 4, 2019

Author Contributor

It's passing by const reference now?

src/hdmint/wallet.h Outdated Show resolved Hide resolved
src/hdmint/wallet.h Outdated Show resolved Hide resolved
src/wallet/wallet.cpp Show resolved Hide resolved
src/wallet/walletdb.cpp Show resolved Hide resolved
}

bool CMintPool::Front(std::pair<CKeyID, uint32_t>& pMint)
bool CMintPool::Front(pair<uint256, MintPoolEntry> pMint)

This comment has been minimized.

Copy link
@levonpetrosyan93

levonpetrosyan93 Jul 4, 2019

Contributor

I could not find any use of this. If it is necessary, than we need to pass by reference I think.

{
if (empty())
return false;
pMint = *begin();
return true;
}

bool CMintPool::Next(pair<CKeyID, uint32_t>& pMint)
bool CMintPool::Next(pair<uint256, MintPoolEntry> pMint)

This comment has been minimized.

Copy link
@levonpetrosyan93

levonpetrosyan93 Jul 4, 2019

Contributor

Same here.

}
}

if(mintPoolEntries.size()>0)
zwalletMain->SyncWithChain(false, mintPoolEntries);

//overwrite any updates
for (CMintMeta& meta : updatedMeta)
UpdateState(meta);
}

void CHDMintTracker::UpdateSpendStateFromBlock(const sigma::spend_info_container& spentSerials){

This comment has been minimized.

Copy link
@levonpetrosyan93

levonpetrosyan93 Jul 4, 2019

Contributor

I see we have duplication of code in this 2 functions. Would be better somehow prevent that.

This comment has been minimized.

Copy link
@riordant

riordant Jul 4, 2019

Author Contributor

Created new function UpdateFromBlock

src/hdmint/wallet.cpp Show resolved Hide resolved
src/wallet/wallet.cpp Show resolved Hide resolved
Copy link
Member

left a comment

Please take a look old small issue and new one.

Andrey and others added 4 commits Jul 4, 2019
Andrey
Andrey
- Some refactor
- Add walletdb function to get pairs of serial hashes and pubcoins
- SetMintSeedSeen fix
@riordant

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2019

@thebevrishot @levonpetrosyan93 Updated to include fixes for your comments, please review.

Zcoin Core automation moved this from In progress to Reviewer approved Jul 4, 2019
Copy link
Member

left a comment

LGTM

@levonpetrosyan93 levonpetrosyan93 merged commit 10fed28 into master Jul 4, 2019
1 of 3 checks passed
1 of 3 checks passed
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
Zcoin Core automation moved this from Reviewer approved to Done Jul 4, 2019
@a-bezrukov a-bezrukov deleted the zap-sigma-mints branch Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Zcoin Core
  
Done
4 participants
You can’t perform that action at this time.