-
Notifications
You must be signed in to change notification settings - Fork 5
Bitcoin multisig address safe time source #325
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
Conversation
| // Getting time | ||
| val time = details[ADDRESS_GENERATION_TIME_KEY]!!.toLong() | ||
| // Removing generation time. Only public keys remain | ||
| details.remove(ADDRESS_GENERATION_TIME_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can rewrite it without line 98 since remove: @return the previous value associated with the key, or `null` if the key was not present in the map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds cool.
| } | ||
| logger.info { "Address $msAddress was added to wallet. Current wallet state:\n${walletFile.wallet}" } | ||
| } else if (notaryKeys.size != peers) { | ||
| logger.info { "Not enough keys are collected to generate a multisig address(${notaryKeys.size} out of ${peers})" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${peers} braces are redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah. You are right. It will be fixed.
| logger.info { "Address $msAddress was added to wallet. Current wallet state:\n${walletFile.wallet}" } | ||
| } else if (notaryKeys.size != peers) { | ||
| logger.info { "Not enough keys are collected to generate a multisig address(${notaryKeys.size} out of ${peers})" } | ||
| return@of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to throw something instead of just return@of ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It simply means that we are in the middle of the process.
| addressInfo.toJson(), | ||
| BigInteger.valueOf(generationTime) | ||
| ).fold({ | ||
| //TODO this save will probably corrupt the wallet file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it bad? What should we do with that in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very bad. But it also outdated)
| addressInfo.toJson(), | ||
| BigInteger.valueOf(generationTime) | ||
| ).fold({ | ||
| //TODO this save will probably corrupt the wallet file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make a task for that?
Release v0.2.1-alpha * Bitcoin deploy notes (#319) * Boot repackage was disabled (#315) * add more logs to eth registration * add more logs to eth registration * Bitcoin rollback (#321) * Bitcoin rollback in case of network failures (#323) * Bitcoin multisig address safe time source (#325) * Ignoring failed Iroha account creation command (#324) * Kill deposit if Iroha is not functioning (#326) * add automatic relay deployment logic * Separate shadow jar (#327) * optimized import * fix config helper * add Sora iroha account to genesis and tests for Sora integration * fix dogecoin precision (actual 9) * rename getAccountAsset -> getAccountAssetBalance * change getAccountAssets -> getIrohaAccountBalance * Bitcoin dynamic fee rate (#329) * Feature/healthcheck (#333) * Add readme * Add healthcheck endpoints * Fix test compiler error * Port increment * Remove registration endpoint * Transition to IPJ, Iroha rc2 version update (#335) * Feature/iroha pure java (#307) * move crypto to Iroha Pure Java library * Transition to IPJ, Iroha rc2 version update (#330) * Transition to IPJ * Iroha rc1 update * Test fixes * Iroha rc2 update * Updated permissions, roles, testing account * Test fixes * Update batches * Fixed status streaming and batch testing * Switched to ordered batches and to Query API of IPJ * More queries refactoring, changed wrapper * Unit tests fixes * Ignored one more unit test * Integration tests fixes * fixup! Integration tests fixes * fixup! Integration tests fixes * fixup! fixup! Integration tests fixes * Config test repaired * Environment variables configs (#336) * Added prioritized environment variables config loading * Fixed working directory of eth services (#338) * Fixed notary pub key (#340) * Fixed notary pub key * Deleted unused notary keys * fix 'mkdir -p' in Jenkins build-logs (#341) * Bitcoin services stabilization after migration to IPJ (#342) * Automatic BTC addresses generation (#337) * Bitcoin-cli in gradle (#344) * Feature/tester permissions (#343) * add permissions for tester account * fix duplication of can_read_assets * Fixed PeerGroup.stop() * Fixing IPJ listener bug (#346) * Relevant docker files (#345) * Updated docker files, added bitcoin services * Deleted variables * Fixed jenkinsfile variables names * Fixed main classes * Fix wait for iroha bug (#348) * Fix wait for iroha bug * Add network to dev * Fix typo * Fix btc docker. Move dw and address geneartion from single to full (#349) * Email notifications * Added build commands to Jenkinsfile (#351) * Feature/registration (#334) * Fixed message * Fixing build (#352) * Fixed peer group close() (#354) * SMTP dumbster integration test (#355) Signed-off-by: Alexey Chernyshov <[email protected]>
Description of the Bug
We use Iroha multisig transactions to create Bitcoin addresses. A previous source of time was a node time, meaning that multisig will never be succeeded because it will have different hash value on different nodes. Now we set time at caller level before address generation process starts. Those who starts address generation process also sets a time for a current address generation session. This time will be used by multiple nodes.