Updates pubkey from bytes32 to bytes - #630
Conversation
terencechain
left a comment
There was a problem hiding this comment.
Looks good. Please add a test case in validator_registration_test.go
Codecov Report
@@ Coverage Diff @@
## master #630 +/- ##
======================================
Coverage 75.9% 75.9%
======================================
Files 56 56
Lines 3748 3748
======================================
Hits 2845 2845
Misses 648 648
Partials 255 255 |
|
Don't you need to rebuild the go libraries? |
| // Deposit is a paid mutator transaction binding the contract method 0x881d2135. | ||
| // | ||
| // Solidity: function deposit(_pubkey bytes32, _withdrawalShardID uint256, _withdrawalAddressbytes32 address, _randaoCommitment bytes32) returns() | ||
| func (_ValidatorRegistration *ValidatorRegistrationTransactor) Deposit(opts *bind.TransactOpts, _pubkey [32]byte, _withdrawalShardID *big.Int, _withdrawalAddressbytes32 common.Address, _randaoCommitment [32]byte) (*types.Transaction, error) { |
There was a problem hiding this comment.
Did you regenerate validator_registration.go or manually changed it [48]byte?
Weird it still says function deposit(_pubkey bytes32,... at the top
|
Changing the mapping from |
|
What is wrong with a dynamic type other than being wasteful? https://solidity.readthedocs.io/en/v0.4.24/types.html#dynamically-sized-byte-array Can you store the pubkey as two byte32s and concat them? |
|
https://solidity.readthedocs.io/en/v0.4.25/types.html#mappings What would I concat them into though? I can't do a string (because dynamic length) or a number (48 bytes > 32 bytes). |
|
@IvanTheGreatDev Whats the status on this ? |
|
Still the same status. Solidity doesn't allow bytes as a key type for
mappings, so the max amount of bytes we can use is 32.
…On Sat, Oct 20, 2018, 1:31 AM Nishant Das ***@***.***> wrote:
@IvanTheGreatDev <https://github.com/IvanTheGreatDev> Whats the status on
this ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#630 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF9j9is9l3Ae20n_-DqMl5otAJGX4TJEks5umrUfgaJpZM4XMOh1>
.
|
|
@terenc3t @prestonvanloon What do you guys think ? Should we just store the hash of the pubkey instead in the mapping ? |
…hotfix/update-pubkey-to-bytes
Shoutouts to @KimiWu123
|
Alright, I changed it to just use the hash of the bytes array the user passes in. Good for review now. |
…anTheGreatDev/prysm into hotfix/update-pubkey-to-bytes
…atDev/prysm into hotfix/update-pubkey-to-bytes
Resolves issue #562
Changes pubkey from bytes32 to bytes
The changes made modify all the
bytes32tobytesand make sure its checks that it is a 48length byte array.Also changes pubKey mapping to a hashPubKey mapping due to the changes required.