From bb762a2c9cb7d52b65852f893a264d55fbc1a6ff Mon Sep 17 00:00:00 2001 From: Dhruv Bodani Date: Fri, 14 Jul 2023 10:47:26 +0530 Subject: [PATCH 1/4] update timestamp format in ssz hash of builder registration --- cluster/ssz.go | 4 +++- cluster/testdata/cluster_lock_v1_7_0.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster/ssz.go b/cluster/ssz.go index 7da20fa45..d788c0d56 100644 --- a/cluster/ssz.go +++ b/cluster/ssz.go @@ -3,6 +3,8 @@ package cluster import ( + "time" + ssz "github.com/ferranbt/fastssz" "github.com/obolnetwork/charon/app/errors" @@ -695,7 +697,7 @@ func hashRegistration(r Registration, hh ssz.HashWalker) error { hh.PutUint64(uint64(r.GasLimit)) // Field (2) 'Timestamp' Bytes48 - hh.PutBytes([]byte(r.Timestamp.String())) + hh.PutBytes([]byte(r.Timestamp.Format(time.RFC3339))) // Field (3) 'PubKey' Bytes48 if err := putBytesN(hh, r.PubKey, sszLenPubKey); err != nil { diff --git a/cluster/testdata/cluster_lock_v1_7_0.json b/cluster/testdata/cluster_lock_v1_7_0.json index 90cd22e64..03b319f39 100644 --- a/cluster/testdata/cluster_lock_v1_7_0.json +++ b/cluster/testdata/cluster_lock_v1_7_0.json @@ -86,7 +86,7 @@ } ], "signature_aggregate": "0x9347800979d1830356f2a54c3deab2a4b4475d63afbe8fb56987c77f5818526f", - "lock_hash": "0xd8f5ed74036f6d4ba863b8659dc0116ce553483b7d93e0442859465fef9944ab", + "lock_hash": "0xe40e9ad1d5ebdf9ca6cb370919eca903c93138879ca10291fb5d1e616e694dd7", "node_signatures": [ "0xb38b19f53784c19e9beac03c875a27db029de37ae37a42318813487685929359", "0xca8c5eb94e152dc1af42ea3d1676c1bdd19ab8e2925c6daee4de5ef9f9dcf08d" From a596e2523668e57b6261cbe3a2ed5145ce0a6c79 Mon Sep 17 00:00:00 2001 From: Dhruv Bodani Date: Fri, 14 Jul 2023 11:54:33 +0530 Subject: [PATCH 2/4] fix tests --- cluster/manifest/testdata/TestLegacyLock_cluster.golden | 4 ++-- cluster/manifest/testdata/TestLegacyLock_proto.golden | 2 +- cluster/manifest/testdata/lock.json | 2 +- cmd/testdata/Test_viewClusterManifest.golden | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cluster/manifest/testdata/TestLegacyLock_cluster.golden b/cluster/manifest/testdata/TestLegacyLock_cluster.golden index ca951c025..11e60d87d 100644 --- a/cluster/manifest/testdata/TestLegacyLock_cluster.golden +++ b/cluster/manifest/testdata/TestLegacyLock_cluster.golden @@ -1,5 +1,5 @@ -initial_mutation_hash: "\t~e\xaeV\x92\xf4\xbf\\mj\xd6`\x9a\x96h\x1dw\x0b\x1d\xc0Z\xc5s]\x17T\xa9\x13\x0b\x97\x95" -latest_mutation_hash: "\t~e\xaeV\x92\xf4\xbf\\mj\xd6`\x9a\x96h\x1dw\x0b\x1d\xc0Z\xc5s]\x17T\xa9\x13\x0b\x97\x95" +initial_mutation_hash: "\xa9\x17\xf8\x82\x81\x89\xf6Ȟ\x16\x8b<\xcf\xee\xf9=\xb3X;;\x19\x1f\x03\x03x\xdd2N\xff\xff\x9fK" +latest_mutation_hash: "\xa9\x17\xf8\x82\x81\x89\xf6Ȟ\x16\x8b<\xcf\xee\xf9=\xb3X;;\x19\x1f\x03\x03x\xdd2N\xff\xff\x9fK" name: "test cluster" threshold: 3 dkg_algorithm: "frost" diff --git a/cluster/manifest/testdata/TestLegacyLock_proto.golden b/cluster/manifest/testdata/TestLegacyLock_proto.golden index 5319b8d4e..f47d1bb65 100644 --- a/cluster/manifest/testdata/TestLegacyLock_proto.golden +++ b/cluster/manifest/testdata/TestLegacyLock_proto.golden @@ -3,7 +3,7 @@ mutation: { type: "dv/legacy_lock/v0.0.1" data: { [type.googleapis.com/cluster.manifestpb.v1.LegacyLock]: { - json: "{\"cluster_definition\":{\"name\":\"test cluster\",\"creator\":{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"config_signature\":\"0x7ac969a117c2005fc7b2ce13e3abae5461b80891d0c11d8baea2cdeac7f9def672af39c6c1ec28d897833d5918980ce326a7517d607153427eeeb36b8a6a1c1700\"},\"operators\":[{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"enr\":\"enr:-HW4QIHPUOMb34YoizKGhz7nsDNQ7hCaiuwyscmeaOQ04awdH05gDnGrZhxDfzcfHssCDeB-esi99A2RoZia6UaYBCuAgmlkgnY0iXNlY3AyNTZrMaECTUts0TYQMsqb0q652QCqTUXZ6tgKyUIzdMRRpyVNB2Y\",\"config_signature\":\"0x038c2aa1d93d3492c46d6486e9747445f7a48d0d8658489ef90e3c348f2055a8475579fa9868cc649062e858460a32c2e55a9b47eca05188f9a68e80fa82c56800\",\"enr_signature\":\"0x20b5b4ba720053c6ea35a710cdd9d81440ae3a69c204edb06184ea2328ff3a290bd00c256d71f6f4daed2f995931b38c3f6bd0b17796f4e121278073e049086800\"},{\"address\":\"0x3325a78425F17a7E487Eb5666b2bFd93aBb06c70\",\"enr\":\"enr:-HW4QDztNDqgEPAgJoHkcF4LfXyjXUo1r_xYoNv48H0PFItwYx-OnviqgfHxEz51RDOGvUMiTpXyo0HBjK5ZZ8YxS9WAgmlkgnY0iXNlY3AyNTZrMaECUx_mBoE0UD0nIxMyJ8hnrI-myDxTfppEw8W9vcsf4zc\",\"config_signature\":\"0xc73465e844871675719518b4b402bbc89d33ad32c8107192a503a921c23d400f5de154b7c2fa21c054d74c98cebb468f29b713ba070d17aa5fcbefdbc40f25d100\",\"enr_signature\":\"0x9aa50b499754e19b7e30e12d6b2d63abc916edc7810aae9f3427f7d2a3cc33ad10f84d638ccb73817cd6a6eee311a52d45ea24f0d0f5452dc845ef24749e71ca00\"},{\"address\":\"0xc48B812bB43401392c037381AcA934F4069C0517\",\"enr\":\"enr:-HW4QGSS-HN3zRfCJGISFmDT59Cpo-daC4U2vSjqPZWegHVSJklFsDs0f1fF_E7X4q8NUbR3bWDlX7IifsjQ_Xrm7QuAgmlkgnY0iXNlY3AyNTZrMaEDRid5rUqtOVFGFHUacQhfLxDhx6WT5OAw77W4chzlWws\",\"config_signature\":\"0x3d0c45744c06bd6681e9426ee3ef177ee465eee0469b5ee4028e23e698676b2a77f20ceef5a67079402414f14967b32c248f9209a406e73678d6ec28a443815b00\",\"enr_signature\":\"0x6ecb15dda256fd34ea09a04db6c140387790d6902509df81fabab3889de4980f30c5d07480b12a0d4f3c6f75f56fe8c0f2b344311e092f53cd959367c5d67f7201\"},{\"address\":\"0xd09Ad14080d4b257a819a4f579b8485Be88f086c\",\"enr\":\"enr:-HW4QGFxPElPQZLydQ9Ach--g-jHJ0N4LO6uuIvyfw-Tg2K_R-R6iMCfzGryG80gmdPQwz9asajtn3CF88-rpu38YoKAgmlkgnY0iXNlY3AyNTZrMaEDYsCgRtrM6G3dA0PG08fHnCIIug2cnPJKbQRtIdIfkPc\",\"config_signature\":\"0x51462ad01f973b79e35339d02d63425f3c6918f0de0547f8cbb205bd168f9e95582660af8774fda452d73801e76ec7a487e866206ae2d6405b2ec11c9a2582e000\",\"enr_signature\":\"0x088602fe90f2ff191ef80fb7e3e3fa3e1fe38fea41ad4de2aa0d452875c5490563a88ed5a8c32b32602e929918accd4ec5b30df0184a2da3ab507667d52b037f00\"}],\"uuid\":\"6325253F-EC73-8DD7-A9E2-8BF921119C16\",\"version\":\"v1.7.0\",\"timestamp\":\"2023-05-24T20:17:34+05:30\",\"num_validators\":2,\"threshold\":3,\"validators\":[{\"fee_recipient_address\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"withdrawal_address\":\"0x0b4b373970115e82ed6f4125c8fa7311e4d7defa\"},{\"fee_recipient_address\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"withdrawal_address\":\"0xb04883e56a156a8de563afa467d49dec6a40e9a1\"}],\"dkg_algorithm\":\"frost\",\"fork_version\":\"0x00001020\",\"config_hash\":\"0xe24af47d3eb1cc995dcb47d0c960fe8923bc1783ad3068f6cb2f79d61fa5d70c\",\"definition_hash\":\"0x0dbd688eba2c92374b548f3283fdb1e9673fbb16179021d4bbc85b3ebad2ca98\"},\"distributed_validators\":[{\"distributed_public_key\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"public_shares\":[\"0xa3feea30fa15c31057f8854242635970282ae537215a3e250dad08d4302452511c395d9648bec87714b4f31575c9b65a\",\"0x8c6428b3f82208b6646ade1ecc9a20be28f2f2681b928fbbfd65efecfb42813f7ccc1e3bcfad9e361c29e33f12f59c8a\",\"0xa08cc49bd4cb498c3169f52c3fd939c16d10d21213920c28326ada1a857c63ecedf0f596bed975a8bd0990d6ffb073b4\",\"0xa3f6ce5eedce78b8607cb6d8e3f2ba20b6743aad73f02810d9d07ac8160cc12cb1a5f69f68547a85ca6f08b442fa0ec8\"],\"deposit_data\":{\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"withdrawal_credentials\":\"0x0100000000000000000000000b4b373970115e82ed6f4125c8fa7311e4d7defa\",\"amount\":\"32000000000\",\"signature\":\"0xb9f2267c573dfd26c046fbef8e5c2e102d5126e14ff488a462748564d5ccea0806fd2d4b8cc0c45dc6bc284c79ca5bea0e1ee0b7882e370f0b9481a1c6369dc0cd92a300bef7365f648aacac797856cc7cac6d51f0e8103592a0356fcefbf3f4\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\"},\"signature\":\"0x8dde908a5e0e0ceaa9043d0460954c20114feef74c8f7ec2af582993c343aeb58006439ac9591bdb80b124f4eba2b3b70ffdb4460ebed8cc29461b67e08e83bd4075cf770bda7ef4c610602d1cd45b85822386dc13d4af5d24ad7d0ed316a3b4\"}},{\"distributed_public_key\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"public_shares\":[\"0xa816a77dbb19902100ffb6e9aeec49907a0bbbe14c1d7da75ffbba8ab9c9505415abaa4941aab4d3e2564fcb2913d5d8\",\"0x98eaebe6e1f24bb75723355df5c337cd154213131102e59c1782ca9e75f2b7a315d8ec6784fd2898e0b0f14cfbc355f6\",\"0xb72a34d8339f26dbcfa680cacd059b284b719a46561caad84a0aa91472139ea99860e036a588e3f9d7d81d34d11b1808\",\"0x80f18a37ae951bc6658b23b7420e68972a5071df5e08e361e4c3bf2fcbbfa5ad74cdaa3c4c665d19c3fb70351f343adb\"],\"deposit_data\":{\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"withdrawal_credentials\":\"0x010000000000000000000000b04883e56a156a8de563afa467d49dec6a40e9a1\",\"amount\":\"32000000000\",\"signature\":\"0xae7b3294921037689be3e13c837f41a299aa3dd12943c4847ec0c8897afee4e8354863d9c038489fff338d2ea1a38779004f8c3e4d62339354864aaa014b6b89b0ea8ee51d0ef79d54f4c727ae468c43e28b6424daf9d78cac8a4e5abf1aa837\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\"},\"signature\":\"0x8a5bc9c5b71ede0457a6d9b019992e51c33aa785378ff709b327c625b519eecd313aca77291261df8b552d8751ecb27605a9e7d6ea4413e1e7fda4e8949c3ed1833aba7de26a4a06cd15f51d57669f24395a1ce6832d768d796de268921bc6d2\"}}],\"signature_aggregate\":\"0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3\",\"lock_hash\":\"0x097e65ae5692f4bf5c6d6ad6609a96681d770b1dc05ac5735d1754a9130b9795\",\"node_signatures\":[\"0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000\",\"0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400\",\"0xf80a81198f476a66b87eb77044c30abd8ff1ff3e4aaa91de2fc735bdc6f07fe36e60c3fee0067e2bbc568ab65c3a598be0acd1bc6e2e11dde8bee888133f9ed800\",\"0x5b360dfd19d58b88197860190a52b8312f8a0fc66a509e77ff5028336fd94ee813b071f9abbd1dd1c7831584d40e34a4ef961ff37b75805cd6ea2a45f85cf4b300\"]}" + json: "{\"cluster_definition\":{\"name\":\"test cluster\",\"creator\":{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"config_signature\":\"0x7ac969a117c2005fc7b2ce13e3abae5461b80891d0c11d8baea2cdeac7f9def672af39c6c1ec28d897833d5918980ce326a7517d607153427eeeb36b8a6a1c1700\"},\"operators\":[{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"enr\":\"enr:-HW4QIHPUOMb34YoizKGhz7nsDNQ7hCaiuwyscmeaOQ04awdH05gDnGrZhxDfzcfHssCDeB-esi99A2RoZia6UaYBCuAgmlkgnY0iXNlY3AyNTZrMaECTUts0TYQMsqb0q652QCqTUXZ6tgKyUIzdMRRpyVNB2Y\",\"config_signature\":\"0x038c2aa1d93d3492c46d6486e9747445f7a48d0d8658489ef90e3c348f2055a8475579fa9868cc649062e858460a32c2e55a9b47eca05188f9a68e80fa82c56800\",\"enr_signature\":\"0x20b5b4ba720053c6ea35a710cdd9d81440ae3a69c204edb06184ea2328ff3a290bd00c256d71f6f4daed2f995931b38c3f6bd0b17796f4e121278073e049086800\"},{\"address\":\"0x3325a78425F17a7E487Eb5666b2bFd93aBb06c70\",\"enr\":\"enr:-HW4QDztNDqgEPAgJoHkcF4LfXyjXUo1r_xYoNv48H0PFItwYx-OnviqgfHxEz51RDOGvUMiTpXyo0HBjK5ZZ8YxS9WAgmlkgnY0iXNlY3AyNTZrMaECUx_mBoE0UD0nIxMyJ8hnrI-myDxTfppEw8W9vcsf4zc\",\"config_signature\":\"0xc73465e844871675719518b4b402bbc89d33ad32c8107192a503a921c23d400f5de154b7c2fa21c054d74c98cebb468f29b713ba070d17aa5fcbefdbc40f25d100\",\"enr_signature\":\"0x9aa50b499754e19b7e30e12d6b2d63abc916edc7810aae9f3427f7d2a3cc33ad10f84d638ccb73817cd6a6eee311a52d45ea24f0d0f5452dc845ef24749e71ca00\"},{\"address\":\"0xc48B812bB43401392c037381AcA934F4069C0517\",\"enr\":\"enr:-HW4QGSS-HN3zRfCJGISFmDT59Cpo-daC4U2vSjqPZWegHVSJklFsDs0f1fF_E7X4q8NUbR3bWDlX7IifsjQ_Xrm7QuAgmlkgnY0iXNlY3AyNTZrMaEDRid5rUqtOVFGFHUacQhfLxDhx6WT5OAw77W4chzlWws\",\"config_signature\":\"0x3d0c45744c06bd6681e9426ee3ef177ee465eee0469b5ee4028e23e698676b2a77f20ceef5a67079402414f14967b32c248f9209a406e73678d6ec28a443815b00\",\"enr_signature\":\"0x6ecb15dda256fd34ea09a04db6c140387790d6902509df81fabab3889de4980f30c5d07480b12a0d4f3c6f75f56fe8c0f2b344311e092f53cd959367c5d67f7201\"},{\"address\":\"0xd09Ad14080d4b257a819a4f579b8485Be88f086c\",\"enr\":\"enr:-HW4QGFxPElPQZLydQ9Ach--g-jHJ0N4LO6uuIvyfw-Tg2K_R-R6iMCfzGryG80gmdPQwz9asajtn3CF88-rpu38YoKAgmlkgnY0iXNlY3AyNTZrMaEDYsCgRtrM6G3dA0PG08fHnCIIug2cnPJKbQRtIdIfkPc\",\"config_signature\":\"0x51462ad01f973b79e35339d02d63425f3c6918f0de0547f8cbb205bd168f9e95582660af8774fda452d73801e76ec7a487e866206ae2d6405b2ec11c9a2582e000\",\"enr_signature\":\"0x088602fe90f2ff191ef80fb7e3e3fa3e1fe38fea41ad4de2aa0d452875c5490563a88ed5a8c32b32602e929918accd4ec5b30df0184a2da3ab507667d52b037f00\"}],\"uuid\":\"6325253F-EC73-8DD7-A9E2-8BF921119C16\",\"version\":\"v1.7.0\",\"timestamp\":\"2023-05-24T20:17:34+05:30\",\"num_validators\":2,\"threshold\":3,\"validators\":[{\"fee_recipient_address\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"withdrawal_address\":\"0x0b4b373970115e82ed6f4125c8fa7311e4d7defa\"},{\"fee_recipient_address\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"withdrawal_address\":\"0xb04883e56a156a8de563afa467d49dec6a40e9a1\"}],\"dkg_algorithm\":\"frost\",\"fork_version\":\"0x00001020\",\"config_hash\":\"0xe24af47d3eb1cc995dcb47d0c960fe8923bc1783ad3068f6cb2f79d61fa5d70c\",\"definition_hash\":\"0x0dbd688eba2c92374b548f3283fdb1e9673fbb16179021d4bbc85b3ebad2ca98\"},\"distributed_validators\":[{\"distributed_public_key\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"public_shares\":[\"0xa3feea30fa15c31057f8854242635970282ae537215a3e250dad08d4302452511c395d9648bec87714b4f31575c9b65a\",\"0x8c6428b3f82208b6646ade1ecc9a20be28f2f2681b928fbbfd65efecfb42813f7ccc1e3bcfad9e361c29e33f12f59c8a\",\"0xa08cc49bd4cb498c3169f52c3fd939c16d10d21213920c28326ada1a857c63ecedf0f596bed975a8bd0990d6ffb073b4\",\"0xa3f6ce5eedce78b8607cb6d8e3f2ba20b6743aad73f02810d9d07ac8160cc12cb1a5f69f68547a85ca6f08b442fa0ec8\"],\"deposit_data\":{\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"withdrawal_credentials\":\"0x0100000000000000000000000b4b373970115e82ed6f4125c8fa7311e4d7defa\",\"amount\":\"32000000000\",\"signature\":\"0xb9f2267c573dfd26c046fbef8e5c2e102d5126e14ff488a462748564d5ccea0806fd2d4b8cc0c45dc6bc284c79ca5bea0e1ee0b7882e370f0b9481a1c6369dc0cd92a300bef7365f648aacac797856cc7cac6d51f0e8103592a0356fcefbf3f4\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\"},\"signature\":\"0x8dde908a5e0e0ceaa9043d0460954c20114feef74c8f7ec2af582993c343aeb58006439ac9591bdb80b124f4eba2b3b70ffdb4460ebed8cc29461b67e08e83bd4075cf770bda7ef4c610602d1cd45b85822386dc13d4af5d24ad7d0ed316a3b4\"}},{\"distributed_public_key\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"public_shares\":[\"0xa816a77dbb19902100ffb6e9aeec49907a0bbbe14c1d7da75ffbba8ab9c9505415abaa4941aab4d3e2564fcb2913d5d8\",\"0x98eaebe6e1f24bb75723355df5c337cd154213131102e59c1782ca9e75f2b7a315d8ec6784fd2898e0b0f14cfbc355f6\",\"0xb72a34d8339f26dbcfa680cacd059b284b719a46561caad84a0aa91472139ea99860e036a588e3f9d7d81d34d11b1808\",\"0x80f18a37ae951bc6658b23b7420e68972a5071df5e08e361e4c3bf2fcbbfa5ad74cdaa3c4c665d19c3fb70351f343adb\"],\"deposit_data\":{\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"withdrawal_credentials\":\"0x010000000000000000000000b04883e56a156a8de563afa467d49dec6a40e9a1\",\"amount\":\"32000000000\",\"signature\":\"0xae7b3294921037689be3e13c837f41a299aa3dd12943c4847ec0c8897afee4e8354863d9c038489fff338d2ea1a38779004f8c3e4d62339354864aaa014b6b89b0ea8ee51d0ef79d54f4c727ae468c43e28b6424daf9d78cac8a4e5abf1aa837\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\"},\"signature\":\"0x8a5bc9c5b71ede0457a6d9b019992e51c33aa785378ff709b327c625b519eecd313aca77291261df8b552d8751ecb27605a9e7d6ea4413e1e7fda4e8949c3ed1833aba7de26a4a06cd15f51d57669f24395a1ce6832d768d796de268921bc6d2\"}}],\"signature_aggregate\":\"0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3\",\"lock_hash\":\"0xa917f8828189f6c89e168b3ccfeef93db3583b3b191f030378dd324effff9f4b\",\"node_signatures\":[\"0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000\",\"0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400\",\"0xf80a81198f476a66b87eb77044c30abd8ff1ff3e4aaa91de2fc735bdc6f07fe36e60c3fee0067e2bbc568ab65c3a598be0acd1bc6e2e11dde8bee888133f9ed800\",\"0x5b360dfd19d58b88197860190a52b8312f8a0fc66a509e77ff5028336fd94ee813b071f9abbd1dd1c7831584d40e34a4ef961ff37b75805cd6ea2a45f85cf4b300\"]}" } } } diff --git a/cluster/manifest/testdata/lock.json b/cluster/manifest/testdata/lock.json index e9bc96cdb..bd6e18df4 100644 --- a/cluster/manifest/testdata/lock.json +++ b/cluster/manifest/testdata/lock.json @@ -102,7 +102,7 @@ } ], "signature_aggregate": "0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3", - "lock_hash": "0x097e65ae5692f4bf5c6d6ad6609a96681d770b1dc05ac5735d1754a9130b9795", + "lock_hash": "0xa917f8828189f6c89e168b3ccfeef93db3583b3b191f030378dd324effff9f4b", "node_signatures": [ "0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000", "0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400", diff --git a/cmd/testdata/Test_viewClusterManifest.golden b/cmd/testdata/Test_viewClusterManifest.golden index dfbe1ba5c..59330fded 100644 --- a/cmd/testdata/Test_viewClusterManifest.golden +++ b/cmd/testdata/Test_viewClusterManifest.golden @@ -1,8 +1,8 @@ { "dkg_algorithm": "default", "fork_version": "0x00001020", - "initial_mutation_hash": "0x4b6cfd31a24e6c720651c6be0ee76320715f06c5f0aed851efa9deabbcf045d3", - "latest_mutation_hash": "0x4b6cfd31a24e6c720651c6be0ee76320715f06c5f0aed851efa9deabbcf045d3", + "initial_mutation_hash": "0x9341f42d4f1aed5380f25b7134754774141d6f0cb59028c6e9c6253f70619dda", + "latest_mutation_hash": "0x9341f42d4f1aed5380f25b7134754774141d6f0cb59028c6e9c6253f70619dda", "name": "test cluster", "operators": [ { From 4d7bc0b5a576234e4a9ef2da23ac015f7f00c738 Mon Sep 17 00:00:00 2001 From: Dhruv Bodani Date: Mon, 17 Jul 2023 13:24:37 +0530 Subject: [PATCH 3/4] update timestamp with unix format to align with go-eth2-client --- cluster/distvalidator.go | 11 ++---- cluster/lock.go | 8 +--- cluster/registration.go | 17 +++----- cluster/ssz.go | 8 ++-- cluster/ssz_internal_test.go | 48 +++++++++++++++++++++++ cluster/testdata/cluster_lock_v1_7_0.json | 6 +-- eth2util/network.go | 4 +- 7 files changed, 65 insertions(+), 37 deletions(-) create mode 100644 cluster/ssz_internal_test.go diff --git a/cluster/distvalidator.go b/cluster/distvalidator.go index 764f063c5..fddd356bf 100644 --- a/cluster/distvalidator.go +++ b/cluster/distvalidator.go @@ -231,7 +231,7 @@ func byteSliceArrayToEthHex(data [][]byte) []ethHex { return ret } -func distValidatorsFromV1x7OrLater(distValidators []distValidatorJSONv1x7) ([]DistValidator, error) { +func distValidatorsFromV1x7OrLater(distValidators []distValidatorJSONv1x7) []DistValidator { var resp []DistValidator for _, dv := range distValidators { var shares [][]byte @@ -239,18 +239,13 @@ func distValidatorsFromV1x7OrLater(distValidators []distValidatorJSONv1x7) ([]Di shares = append(shares, share) } - reg, err := registrationFromJSON(dv.BuilderRegistration) - if err != nil { - return nil, errors.Wrap(err, "registration from json") - } - resp = append(resp, DistValidator{ PubKey: dv.PubKey, PubShares: shares, DepositData: depositDataFromJSON(dv.DepositData), - BuilderRegistration: reg, + BuilderRegistration: registrationFromJSON(dv.BuilderRegistration), }) } - return resp, nil + return resp } diff --git a/cluster/lock.go b/cluster/lock.go index dde0a3ddb..3ee0c3369 100644 --- a/cluster/lock.go +++ b/cluster/lock.go @@ -374,20 +374,14 @@ func unmarshalLockV1x7OrLater(data []byte) (lock Lock, err error) { return Lock{}, errors.Wrap(err, "unmarshal definition") } - vals, err := distValidatorsFromV1x7OrLater(lockJSON.Validators) - if err != nil { - return Lock{}, err - } - var nodeSignatures [][]byte - for _, ns := range lockJSON.NodeSignatures { nodeSignatures = append(nodeSignatures, ns) } lock = Lock{ Definition: lockJSON.Definition, - Validators: vals, + Validators: distValidatorsFromV1x7OrLater(lockJSON.Validators), SignatureAggregate: lockJSON.SignatureAggregate, LockHash: lockJSON.LockHash, NodeSignatures: nodeSignatures, diff --git a/cluster/registration.go b/cluster/registration.go index 787874946..2c97ad85b 100644 --- a/cluster/registration.go +++ b/cluster/registration.go @@ -4,8 +4,6 @@ package cluster import ( "time" - - "github.com/obolnetwork/charon/app/errors" ) // BuilderRegistration defines pre-generated signed validator builder registration to be sent to builder network. @@ -32,7 +30,7 @@ type builderRegistrationJSON struct { type registrationJSON struct { FeeRecipient ethHex `json:"fee_recipient"` GasLimit int `json:"gas_limit"` - Timestamp string `json:"timestamp"` + Timestamp int `json:"timestamp"` PubKey ethHex `json:"pubkey"` } @@ -42,7 +40,7 @@ func registrationToJSON(b BuilderRegistration) builderRegistrationJSON { Message: registrationJSON{ FeeRecipient: b.Message.FeeRecipient, GasLimit: b.Message.GasLimit, - Timestamp: b.Message.Timestamp.Format(time.RFC3339), + Timestamp: int(b.Message.Timestamp.Unix()), PubKey: b.Message.PubKey, }, Signature: b.Signature, @@ -50,19 +48,14 @@ func registrationToJSON(b BuilderRegistration) builderRegistrationJSON { } // registrationFromJSON converts registrationFromJSON to BuilderRegistration. -func registrationFromJSON(b builderRegistrationJSON) (BuilderRegistration, error) { - timestamp, err := time.Parse(time.RFC3339, b.Message.Timestamp) - if err != nil { - return BuilderRegistration{}, errors.Wrap(err, "parse timestamp") - } - +func registrationFromJSON(b builderRegistrationJSON) BuilderRegistration { return BuilderRegistration{ Message: Registration{ FeeRecipient: b.Message.FeeRecipient, GasLimit: b.Message.GasLimit, - Timestamp: timestamp, + Timestamp: time.Unix(int64(b.Message.Timestamp), 0), PubKey: b.Message.PubKey, }, Signature: b.Signature, - }, nil + } } diff --git a/cluster/ssz.go b/cluster/ssz.go index d788c0d56..c183a957e 100644 --- a/cluster/ssz.go +++ b/cluster/ssz.go @@ -3,8 +3,6 @@ package cluster import ( - "time" - ssz "github.com/ferranbt/fastssz" "github.com/obolnetwork/charon/app/errors" @@ -693,11 +691,11 @@ func hashRegistration(r Registration, hh ssz.HashWalker) error { // Field (0) 'FeeRecipient' hh.PutBytes(r.FeeRecipient) - // Field (1) 'GasLimit' Bytes48 + // Field (1) 'GasLimit' uint64 hh.PutUint64(uint64(r.GasLimit)) - // Field (2) 'Timestamp' Bytes48 - hh.PutBytes([]byte(r.Timestamp.Format(time.RFC3339))) + // Field (2) 'Timestamp' uint64 + hh.PutUint64(uint64(r.Timestamp.Unix())) // Field (3) 'PubKey' Bytes48 if err := putBytesN(hh, r.PubKey, sszLenPubKey); err != nil { diff --git a/cluster/ssz_internal_test.go b/cluster/ssz_internal_test.go new file mode 100644 index 000000000..a98ce14f0 --- /dev/null +++ b/cluster/ssz_internal_test.go @@ -0,0 +1,48 @@ +// Copyright © 2022-2023 Obol Labs Inc. Licensed under the terms of a Business Source License 1.1 + +package cluster + +import ( + "testing" + + eth2v1 "github.com/attestantio/go-eth2-client/api/v1" + "github.com/attestantio/go-eth2-client/spec/bellatrix" + ssz "github.com/ferranbt/fastssz" + "github.com/stretchr/testify/require" + + "github.com/obolnetwork/charon/core" +) + +func TestHashBuilderRegistration(t *testing.T) { + const network = "goerli" + clusterReg := RandomRegistration(t, network) + + var feeRecipient bellatrix.ExecutionAddress + copy(feeRecipient[:], clusterReg.Message.FeeRecipient) + + pubkey, err := core.PubKeyFromBytes(clusterReg.Message.PubKey) + require.NoError(t, err) + + eth2Pubkey, err := pubkey.ToETH2() + require.NoError(t, err) + + eth2Reg := ð2v1.SignedValidatorRegistration{ + Message: ð2v1.ValidatorRegistration{ + FeeRecipient: feeRecipient, + Timestamp: clusterReg.Message.Timestamp, + GasLimit: uint64(clusterReg.Message.GasLimit), + Pubkey: eth2Pubkey, + }, + } + + eth2hash, err := eth2Reg.Message.HashTreeRoot() + require.NoError(t, err) + + hh := ssz.DefaultHasherPool.Get() + defer ssz.DefaultHasherPool.Put(hh) + + require.NoError(t, hashRegistration(clusterReg.Message, hh)) + clusterRegHash, err := hh.HashRoot() + require.NoError(t, err) + require.Equal(t, eth2hash, clusterRegHash) +} diff --git a/cluster/testdata/cluster_lock_v1_7_0.json b/cluster/testdata/cluster_lock_v1_7_0.json index 03b319f39..717b61b7a 100644 --- a/cluster/testdata/cluster_lock_v1_7_0.json +++ b/cluster/testdata/cluster_lock_v1_7_0.json @@ -56,7 +56,7 @@ "message": { "fee_recipient": "0x89b79bf504cfb57c7601232d589baccea9d6e263", "gas_limit": 30000000, - "timestamp": "2022-06-20T14:00:00Z", + "timestamp": 1655733600, "pubkey": "0x1814be823350eab13935f31d84484517e924aef78ae151c00755925836b7075885650c30ec29a3703934bf50a28da102" }, "signature": "0xd313c8a3b4c1c0e05447f4ba370eb36dbcfdec90b302dcdc3b9ef522e2a6f1ed0afec1f8e20faabedf6b162e717d3a748a58677a0c56348f8921a266b11d0f334c62fe52ba53af19779cb2948b6570ffa0b773963c130ad797ddeafe4e3ad29b" @@ -78,7 +78,7 @@ "message": { "fee_recipient": "0x72e6415a761f03abaa40abc9448fddeb2191d945", "gas_limit": 30000000, - "timestamp": "2022-06-20T14:00:00Z", + "timestamp": 1655733600, "pubkey": "0x5125210f0ef1c314090f07c79a6f571c246f3e9ac0b7413ef110bd58b00ce73bff706f7ff4b6f44090a32711f3208e4e" }, "signature": "0xe65a31bd5d41e2d2ce9c2b17892f0fea1931a290220777a93143dfdcbfa68406e877073ff08834e197a4034aa48afa3f85b8a62708caebbac880b5b89b93da53810164402104e648b6226a1b78021851f5d9ac0f313a89ddfc454c5f8f72ac89" @@ -86,7 +86,7 @@ } ], "signature_aggregate": "0x9347800979d1830356f2a54c3deab2a4b4475d63afbe8fb56987c77f5818526f", - "lock_hash": "0xe40e9ad1d5ebdf9ca6cb370919eca903c93138879ca10291fb5d1e616e694dd7", + "lock_hash": "0x7177c0faf0cc62a6c96bb18214673d01be975a1ff367f605f3c9296887647ec3", "node_signatures": [ "0xb38b19f53784c19e9beac03c875a27db029de37ae37a42318813487685929359", "0xca8c5eb94e152dc1af42ea3d1676c1bdd19ab8e2925c6daee4de5ef9f9dcf08d" diff --git a/eth2util/network.go b/eth2util/network.go index 4884ce981..19b6ae075 100644 --- a/eth2util/network.go +++ b/eth2util/network.go @@ -118,7 +118,7 @@ func ValidNetwork(name string) bool { func NetworkToGenesisTime(name string) (time.Time, error) { for _, network := range supportedNetworks { if name == network.Name { - return time.Unix(network.GenesisTimestamp, 0).UTC(), nil + return time.Unix(network.GenesisTimestamp, 0), nil } } @@ -128,7 +128,7 @@ func NetworkToGenesisTime(name string) (time.Time, error) { func ForkVersionToGenesisTime(forkVersion []byte) (time.Time, error) { for _, network := range supportedNetworks { if fmt.Sprintf("%#x", forkVersion) == network.GenesisForkVersionHex { - return time.Unix(network.GenesisTimestamp, 0).UTC(), nil + return time.Unix(network.GenesisTimestamp, 0), nil } } From 8ef605dcc41e859ef3e1df91fa10b4d6ec4b5da1 Mon Sep 17 00:00:00 2001 From: Dhruv Bodani Date: Mon, 17 Jul 2023 14:04:18 +0530 Subject: [PATCH 4/4] cleanup --- cluster/manifest/testdata/TestLegacyLock_cluster.golden | 4 ++-- cluster/manifest/testdata/TestLegacyLock_proto.golden | 2 +- cluster/manifest/testdata/lock.json | 6 +++--- cmd/testdata/Test_viewClusterManifest.golden | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cluster/manifest/testdata/TestLegacyLock_cluster.golden b/cluster/manifest/testdata/TestLegacyLock_cluster.golden index 11e60d87d..bfb8d7d5d 100644 --- a/cluster/manifest/testdata/TestLegacyLock_cluster.golden +++ b/cluster/manifest/testdata/TestLegacyLock_cluster.golden @@ -1,5 +1,5 @@ -initial_mutation_hash: "\xa9\x17\xf8\x82\x81\x89\xf6Ȟ\x16\x8b<\xcf\xee\xf9=\xb3X;;\x19\x1f\x03\x03x\xdd2N\xff\xff\x9fK" -latest_mutation_hash: "\xa9\x17\xf8\x82\x81\x89\xf6Ȟ\x16\x8b<\xcf\xee\xf9=\xb3X;;\x19\x1f\x03\x03x\xdd2N\xff\xff\x9fK" +initial_mutation_hash: "@$n\xca\x03\xa9\x01\xa6\xa1m\xbc]\x1c\xae:\xf5@\xb3`\x1a\x8b\xde5^\xa7\xb9\xd3\xc6\x06i\x83\xa6" +latest_mutation_hash: "@$n\xca\x03\xa9\x01\xa6\xa1m\xbc]\x1c\xae:\xf5@\xb3`\x1a\x8b\xde5^\xa7\xb9\xd3\xc6\x06i\x83\xa6" name: "test cluster" threshold: 3 dkg_algorithm: "frost" diff --git a/cluster/manifest/testdata/TestLegacyLock_proto.golden b/cluster/manifest/testdata/TestLegacyLock_proto.golden index f47d1bb65..247aad2d0 100644 --- a/cluster/manifest/testdata/TestLegacyLock_proto.golden +++ b/cluster/manifest/testdata/TestLegacyLock_proto.golden @@ -3,7 +3,7 @@ mutation: { type: "dv/legacy_lock/v0.0.1" data: { [type.googleapis.com/cluster.manifestpb.v1.LegacyLock]: { - json: "{\"cluster_definition\":{\"name\":\"test cluster\",\"creator\":{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"config_signature\":\"0x7ac969a117c2005fc7b2ce13e3abae5461b80891d0c11d8baea2cdeac7f9def672af39c6c1ec28d897833d5918980ce326a7517d607153427eeeb36b8a6a1c1700\"},\"operators\":[{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"enr\":\"enr:-HW4QIHPUOMb34YoizKGhz7nsDNQ7hCaiuwyscmeaOQ04awdH05gDnGrZhxDfzcfHssCDeB-esi99A2RoZia6UaYBCuAgmlkgnY0iXNlY3AyNTZrMaECTUts0TYQMsqb0q652QCqTUXZ6tgKyUIzdMRRpyVNB2Y\",\"config_signature\":\"0x038c2aa1d93d3492c46d6486e9747445f7a48d0d8658489ef90e3c348f2055a8475579fa9868cc649062e858460a32c2e55a9b47eca05188f9a68e80fa82c56800\",\"enr_signature\":\"0x20b5b4ba720053c6ea35a710cdd9d81440ae3a69c204edb06184ea2328ff3a290bd00c256d71f6f4daed2f995931b38c3f6bd0b17796f4e121278073e049086800\"},{\"address\":\"0x3325a78425F17a7E487Eb5666b2bFd93aBb06c70\",\"enr\":\"enr:-HW4QDztNDqgEPAgJoHkcF4LfXyjXUo1r_xYoNv48H0PFItwYx-OnviqgfHxEz51RDOGvUMiTpXyo0HBjK5ZZ8YxS9WAgmlkgnY0iXNlY3AyNTZrMaECUx_mBoE0UD0nIxMyJ8hnrI-myDxTfppEw8W9vcsf4zc\",\"config_signature\":\"0xc73465e844871675719518b4b402bbc89d33ad32c8107192a503a921c23d400f5de154b7c2fa21c054d74c98cebb468f29b713ba070d17aa5fcbefdbc40f25d100\",\"enr_signature\":\"0x9aa50b499754e19b7e30e12d6b2d63abc916edc7810aae9f3427f7d2a3cc33ad10f84d638ccb73817cd6a6eee311a52d45ea24f0d0f5452dc845ef24749e71ca00\"},{\"address\":\"0xc48B812bB43401392c037381AcA934F4069C0517\",\"enr\":\"enr:-HW4QGSS-HN3zRfCJGISFmDT59Cpo-daC4U2vSjqPZWegHVSJklFsDs0f1fF_E7X4q8NUbR3bWDlX7IifsjQ_Xrm7QuAgmlkgnY0iXNlY3AyNTZrMaEDRid5rUqtOVFGFHUacQhfLxDhx6WT5OAw77W4chzlWws\",\"config_signature\":\"0x3d0c45744c06bd6681e9426ee3ef177ee465eee0469b5ee4028e23e698676b2a77f20ceef5a67079402414f14967b32c248f9209a406e73678d6ec28a443815b00\",\"enr_signature\":\"0x6ecb15dda256fd34ea09a04db6c140387790d6902509df81fabab3889de4980f30c5d07480b12a0d4f3c6f75f56fe8c0f2b344311e092f53cd959367c5d67f7201\"},{\"address\":\"0xd09Ad14080d4b257a819a4f579b8485Be88f086c\",\"enr\":\"enr:-HW4QGFxPElPQZLydQ9Ach--g-jHJ0N4LO6uuIvyfw-Tg2K_R-R6iMCfzGryG80gmdPQwz9asajtn3CF88-rpu38YoKAgmlkgnY0iXNlY3AyNTZrMaEDYsCgRtrM6G3dA0PG08fHnCIIug2cnPJKbQRtIdIfkPc\",\"config_signature\":\"0x51462ad01f973b79e35339d02d63425f3c6918f0de0547f8cbb205bd168f9e95582660af8774fda452d73801e76ec7a487e866206ae2d6405b2ec11c9a2582e000\",\"enr_signature\":\"0x088602fe90f2ff191ef80fb7e3e3fa3e1fe38fea41ad4de2aa0d452875c5490563a88ed5a8c32b32602e929918accd4ec5b30df0184a2da3ab507667d52b037f00\"}],\"uuid\":\"6325253F-EC73-8DD7-A9E2-8BF921119C16\",\"version\":\"v1.7.0\",\"timestamp\":\"2023-05-24T20:17:34+05:30\",\"num_validators\":2,\"threshold\":3,\"validators\":[{\"fee_recipient_address\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"withdrawal_address\":\"0x0b4b373970115e82ed6f4125c8fa7311e4d7defa\"},{\"fee_recipient_address\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"withdrawal_address\":\"0xb04883e56a156a8de563afa467d49dec6a40e9a1\"}],\"dkg_algorithm\":\"frost\",\"fork_version\":\"0x00001020\",\"config_hash\":\"0xe24af47d3eb1cc995dcb47d0c960fe8923bc1783ad3068f6cb2f79d61fa5d70c\",\"definition_hash\":\"0x0dbd688eba2c92374b548f3283fdb1e9673fbb16179021d4bbc85b3ebad2ca98\"},\"distributed_validators\":[{\"distributed_public_key\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"public_shares\":[\"0xa3feea30fa15c31057f8854242635970282ae537215a3e250dad08d4302452511c395d9648bec87714b4f31575c9b65a\",\"0x8c6428b3f82208b6646ade1ecc9a20be28f2f2681b928fbbfd65efecfb42813f7ccc1e3bcfad9e361c29e33f12f59c8a\",\"0xa08cc49bd4cb498c3169f52c3fd939c16d10d21213920c28326ada1a857c63ecedf0f596bed975a8bd0990d6ffb073b4\",\"0xa3f6ce5eedce78b8607cb6d8e3f2ba20b6743aad73f02810d9d07ac8160cc12cb1a5f69f68547a85ca6f08b442fa0ec8\"],\"deposit_data\":{\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"withdrawal_credentials\":\"0x0100000000000000000000000b4b373970115e82ed6f4125c8fa7311e4d7defa\",\"amount\":\"32000000000\",\"signature\":\"0xb9f2267c573dfd26c046fbef8e5c2e102d5126e14ff488a462748564d5ccea0806fd2d4b8cc0c45dc6bc284c79ca5bea0e1ee0b7882e370f0b9481a1c6369dc0cd92a300bef7365f648aacac797856cc7cac6d51f0e8103592a0356fcefbf3f4\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\"},\"signature\":\"0x8dde908a5e0e0ceaa9043d0460954c20114feef74c8f7ec2af582993c343aeb58006439ac9591bdb80b124f4eba2b3b70ffdb4460ebed8cc29461b67e08e83bd4075cf770bda7ef4c610602d1cd45b85822386dc13d4af5d24ad7d0ed316a3b4\"}},{\"distributed_public_key\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"public_shares\":[\"0xa816a77dbb19902100ffb6e9aeec49907a0bbbe14c1d7da75ffbba8ab9c9505415abaa4941aab4d3e2564fcb2913d5d8\",\"0x98eaebe6e1f24bb75723355df5c337cd154213131102e59c1782ca9e75f2b7a315d8ec6784fd2898e0b0f14cfbc355f6\",\"0xb72a34d8339f26dbcfa680cacd059b284b719a46561caad84a0aa91472139ea99860e036a588e3f9d7d81d34d11b1808\",\"0x80f18a37ae951bc6658b23b7420e68972a5071df5e08e361e4c3bf2fcbbfa5ad74cdaa3c4c665d19c3fb70351f343adb\"],\"deposit_data\":{\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"withdrawal_credentials\":\"0x010000000000000000000000b04883e56a156a8de563afa467d49dec6a40e9a1\",\"amount\":\"32000000000\",\"signature\":\"0xae7b3294921037689be3e13c837f41a299aa3dd12943c4847ec0c8897afee4e8354863d9c038489fff338d2ea1a38779004f8c3e4d62339354864aaa014b6b89b0ea8ee51d0ef79d54f4c727ae468c43e28b6424daf9d78cac8a4e5abf1aa837\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"gas_limit\":30000000,\"timestamp\":\"2021-03-23T14:00:00Z\",\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\"},\"signature\":\"0x8a5bc9c5b71ede0457a6d9b019992e51c33aa785378ff709b327c625b519eecd313aca77291261df8b552d8751ecb27605a9e7d6ea4413e1e7fda4e8949c3ed1833aba7de26a4a06cd15f51d57669f24395a1ce6832d768d796de268921bc6d2\"}}],\"signature_aggregate\":\"0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3\",\"lock_hash\":\"0xa917f8828189f6c89e168b3ccfeef93db3583b3b191f030378dd324effff9f4b\",\"node_signatures\":[\"0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000\",\"0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400\",\"0xf80a81198f476a66b87eb77044c30abd8ff1ff3e4aaa91de2fc735bdc6f07fe36e60c3fee0067e2bbc568ab65c3a598be0acd1bc6e2e11dde8bee888133f9ed800\",\"0x5b360dfd19d58b88197860190a52b8312f8a0fc66a509e77ff5028336fd94ee813b071f9abbd1dd1c7831584d40e34a4ef961ff37b75805cd6ea2a45f85cf4b300\"]}" + json: "{\"cluster_definition\":{\"name\":\"test cluster\",\"creator\":{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"config_signature\":\"0x7ac969a117c2005fc7b2ce13e3abae5461b80891d0c11d8baea2cdeac7f9def672af39c6c1ec28d897833d5918980ce326a7517d607153427eeeb36b8a6a1c1700\"},\"operators\":[{\"address\":\"0x5050A4F4b3f9338C3472dcC01A87C76A144b3c9c\",\"enr\":\"enr:-HW4QIHPUOMb34YoizKGhz7nsDNQ7hCaiuwyscmeaOQ04awdH05gDnGrZhxDfzcfHssCDeB-esi99A2RoZia6UaYBCuAgmlkgnY0iXNlY3AyNTZrMaECTUts0TYQMsqb0q652QCqTUXZ6tgKyUIzdMRRpyVNB2Y\",\"config_signature\":\"0x038c2aa1d93d3492c46d6486e9747445f7a48d0d8658489ef90e3c348f2055a8475579fa9868cc649062e858460a32c2e55a9b47eca05188f9a68e80fa82c56800\",\"enr_signature\":\"0x20b5b4ba720053c6ea35a710cdd9d81440ae3a69c204edb06184ea2328ff3a290bd00c256d71f6f4daed2f995931b38c3f6bd0b17796f4e121278073e049086800\"},{\"address\":\"0x3325a78425F17a7E487Eb5666b2bFd93aBb06c70\",\"enr\":\"enr:-HW4QDztNDqgEPAgJoHkcF4LfXyjXUo1r_xYoNv48H0PFItwYx-OnviqgfHxEz51RDOGvUMiTpXyo0HBjK5ZZ8YxS9WAgmlkgnY0iXNlY3AyNTZrMaECUx_mBoE0UD0nIxMyJ8hnrI-myDxTfppEw8W9vcsf4zc\",\"config_signature\":\"0xc73465e844871675719518b4b402bbc89d33ad32c8107192a503a921c23d400f5de154b7c2fa21c054d74c98cebb468f29b713ba070d17aa5fcbefdbc40f25d100\",\"enr_signature\":\"0x9aa50b499754e19b7e30e12d6b2d63abc916edc7810aae9f3427f7d2a3cc33ad10f84d638ccb73817cd6a6eee311a52d45ea24f0d0f5452dc845ef24749e71ca00\"},{\"address\":\"0xc48B812bB43401392c037381AcA934F4069C0517\",\"enr\":\"enr:-HW4QGSS-HN3zRfCJGISFmDT59Cpo-daC4U2vSjqPZWegHVSJklFsDs0f1fF_E7X4q8NUbR3bWDlX7IifsjQ_Xrm7QuAgmlkgnY0iXNlY3AyNTZrMaEDRid5rUqtOVFGFHUacQhfLxDhx6WT5OAw77W4chzlWws\",\"config_signature\":\"0x3d0c45744c06bd6681e9426ee3ef177ee465eee0469b5ee4028e23e698676b2a77f20ceef5a67079402414f14967b32c248f9209a406e73678d6ec28a443815b00\",\"enr_signature\":\"0x6ecb15dda256fd34ea09a04db6c140387790d6902509df81fabab3889de4980f30c5d07480b12a0d4f3c6f75f56fe8c0f2b344311e092f53cd959367c5d67f7201\"},{\"address\":\"0xd09Ad14080d4b257a819a4f579b8485Be88f086c\",\"enr\":\"enr:-HW4QGFxPElPQZLydQ9Ach--g-jHJ0N4LO6uuIvyfw-Tg2K_R-R6iMCfzGryG80gmdPQwz9asajtn3CF88-rpu38YoKAgmlkgnY0iXNlY3AyNTZrMaEDYsCgRtrM6G3dA0PG08fHnCIIug2cnPJKbQRtIdIfkPc\",\"config_signature\":\"0x51462ad01f973b79e35339d02d63425f3c6918f0de0547f8cbb205bd168f9e95582660af8774fda452d73801e76ec7a487e866206ae2d6405b2ec11c9a2582e000\",\"enr_signature\":\"0x088602fe90f2ff191ef80fb7e3e3fa3e1fe38fea41ad4de2aa0d452875c5490563a88ed5a8c32b32602e929918accd4ec5b30df0184a2da3ab507667d52b037f00\"}],\"uuid\":\"6325253F-EC73-8DD7-A9E2-8BF921119C16\",\"version\":\"v1.7.0\",\"timestamp\":\"2023-05-24T20:17:34+05:30\",\"num_validators\":2,\"threshold\":3,\"validators\":[{\"fee_recipient_address\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"withdrawal_address\":\"0x0b4b373970115e82ed6f4125c8fa7311e4d7defa\"},{\"fee_recipient_address\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"withdrawal_address\":\"0xb04883e56a156a8de563afa467d49dec6a40e9a1\"}],\"dkg_algorithm\":\"frost\",\"fork_version\":\"0x00001020\",\"config_hash\":\"0xe24af47d3eb1cc995dcb47d0c960fe8923bc1783ad3068f6cb2f79d61fa5d70c\",\"definition_hash\":\"0x0dbd688eba2c92374b548f3283fdb1e9673fbb16179021d4bbc85b3ebad2ca98\"},\"distributed_validators\":[{\"distributed_public_key\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"public_shares\":[\"0xa3feea30fa15c31057f8854242635970282ae537215a3e250dad08d4302452511c395d9648bec87714b4f31575c9b65a\",\"0x8c6428b3f82208b6646ade1ecc9a20be28f2f2681b928fbbfd65efecfb42813f7ccc1e3bcfad9e361c29e33f12f59c8a\",\"0xa08cc49bd4cb498c3169f52c3fd939c16d10d21213920c28326ada1a857c63ecedf0f596bed975a8bd0990d6ffb073b4\",\"0xa3f6ce5eedce78b8607cb6d8e3f2ba20b6743aad73f02810d9d07ac8160cc12cb1a5f69f68547a85ca6f08b442fa0ec8\"],\"deposit_data\":{\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\",\"withdrawal_credentials\":\"0x0100000000000000000000000b4b373970115e82ed6f4125c8fa7311e4d7defa\",\"amount\":\"32000000000\",\"signature\":\"0xb9f2267c573dfd26c046fbef8e5c2e102d5126e14ff488a462748564d5ccea0806fd2d4b8cc0c45dc6bc284c79ca5bea0e1ee0b7882e370f0b9481a1c6369dc0cd92a300bef7365f648aacac797856cc7cac6d51f0e8103592a0356fcefbf3f4\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x4c7215a3b539eb1e5849c6077dbb5722f5717a28\",\"gas_limit\":30000000,\"timestamp\":1616508000,\"pubkey\":\"0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be\"},\"signature\":\"0x8dde908a5e0e0ceaa9043d0460954c20114feef74c8f7ec2af582993c343aeb58006439ac9591bdb80b124f4eba2b3b70ffdb4460ebed8cc29461b67e08e83bd4075cf770bda7ef4c610602d1cd45b85822386dc13d4af5d24ad7d0ed316a3b4\"}},{\"distributed_public_key\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"public_shares\":[\"0xa816a77dbb19902100ffb6e9aeec49907a0bbbe14c1d7da75ffbba8ab9c9505415abaa4941aab4d3e2564fcb2913d5d8\",\"0x98eaebe6e1f24bb75723355df5c337cd154213131102e59c1782ca9e75f2b7a315d8ec6784fd2898e0b0f14cfbc355f6\",\"0xb72a34d8339f26dbcfa680cacd059b284b719a46561caad84a0aa91472139ea99860e036a588e3f9d7d81d34d11b1808\",\"0x80f18a37ae951bc6658b23b7420e68972a5071df5e08e361e4c3bf2fcbbfa5ad74cdaa3c4c665d19c3fb70351f343adb\"],\"deposit_data\":{\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\",\"withdrawal_credentials\":\"0x010000000000000000000000b04883e56a156a8de563afa467d49dec6a40e9a1\",\"amount\":\"32000000000\",\"signature\":\"0xae7b3294921037689be3e13c837f41a299aa3dd12943c4847ec0c8897afee4e8354863d9c038489fff338d2ea1a38779004f8c3e4d62339354864aaa014b6b89b0ea8ee51d0ef79d54f4c727ae468c43e28b6424daf9d78cac8a4e5abf1aa837\"},\"builder_registration\":{\"message\":{\"fee_recipient\":\"0x24abf7df866baa56038367ad6145de1ee8f4a8b0\",\"gas_limit\":30000000,\"timestamp\":1616508000,\"pubkey\":\"0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b\"},\"signature\":\"0x8a5bc9c5b71ede0457a6d9b019992e51c33aa785378ff709b327c625b519eecd313aca77291261df8b552d8751ecb27605a9e7d6ea4413e1e7fda4e8949c3ed1833aba7de26a4a06cd15f51d57669f24395a1ce6832d768d796de268921bc6d2\"}}],\"signature_aggregate\":\"0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3\",\"lock_hash\":\"0x40246eca03a901a6a16dbc5d1cae3af540b3601a8bde355ea7b9d3c6066983a6\",\"node_signatures\":[\"0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000\",\"0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400\",\"0xf80a81198f476a66b87eb77044c30abd8ff1ff3e4aaa91de2fc735bdc6f07fe36e60c3fee0067e2bbc568ab65c3a598be0acd1bc6e2e11dde8bee888133f9ed800\",\"0x5b360dfd19d58b88197860190a52b8312f8a0fc66a509e77ff5028336fd94ee813b071f9abbd1dd1c7831584d40e34a4ef961ff37b75805cd6ea2a45f85cf4b300\"]}" } } } diff --git a/cluster/manifest/testdata/lock.json b/cluster/manifest/testdata/lock.json index bd6e18df4..8a397c517 100644 --- a/cluster/manifest/testdata/lock.json +++ b/cluster/manifest/testdata/lock.json @@ -70,7 +70,7 @@ "message": { "fee_recipient": "0x4c7215a3b539eb1e5849c6077dbb5722f5717a28", "gas_limit": 30000000, - "timestamp": "2021-03-23T14:00:00Z", + "timestamp": 1616508000, "pubkey": "0xacff76ec0c853e376d49a30b6fb9aaec53d265f5d1248d5dbd0f074a5a537b0ac2524c8875d522e32db84474f52497be" }, "signature": "0x8dde908a5e0e0ceaa9043d0460954c20114feef74c8f7ec2af582993c343aeb58006439ac9591bdb80b124f4eba2b3b70ffdb4460ebed8cc29461b67e08e83bd4075cf770bda7ef4c610602d1cd45b85822386dc13d4af5d24ad7d0ed316a3b4" @@ -94,7 +94,7 @@ "message": { "fee_recipient": "0x24abf7df866baa56038367ad6145de1ee8f4a8b0", "gas_limit": 30000000, - "timestamp": "2021-03-23T14:00:00Z", + "timestamp": 1616508000, "pubkey": "0x879ecd7484e1d5b3e70806881518248e22c3033c4adf99f4c3252932191b97b334284b00fca1913e4fd30a9bb094b29b" }, "signature": "0x8a5bc9c5b71ede0457a6d9b019992e51c33aa785378ff709b327c625b519eecd313aca77291261df8b552d8751ecb27605a9e7d6ea4413e1e7fda4e8949c3ed1833aba7de26a4a06cd15f51d57669f24395a1ce6832d768d796de268921bc6d2" @@ -102,7 +102,7 @@ } ], "signature_aggregate": "0xb71c1347770a94076705376c28b03c7773f4a99a5ebef223aa1054164aa24bc5e2f56fee614e0c88dddd8f392198b180180f364f1c11a82d1ce894016a9877d0902080716be812de49853e2cd8192a9e2f8d16b87f559461d280bded903006e3", - "lock_hash": "0xa917f8828189f6c89e168b3ccfeef93db3583b3b191f030378dd324effff9f4b", + "lock_hash": "0x40246eca03a901a6a16dbc5d1cae3af540b3601a8bde355ea7b9d3c6066983a6", "node_signatures": [ "0xc9772a16bd180f225ed208017ac1a3d6da5f0fc167fd7ac3bb3a95c90a5599ad4d66e4c69f589ec4cb423d3c62bd5361c61dcd44b7371023f1ef8afad606e56000", "0x09dd97256be0adc2d8b99c42b2acce6aa4b36095f919020f67b90c42702df331271a4e91245bcc3b876a29678bccd620dee3c2e9c7d4a57e9c361aba29442e0400", diff --git a/cmd/testdata/Test_viewClusterManifest.golden b/cmd/testdata/Test_viewClusterManifest.golden index 59330fded..f0aadd23e 100644 --- a/cmd/testdata/Test_viewClusterManifest.golden +++ b/cmd/testdata/Test_viewClusterManifest.golden @@ -1,8 +1,8 @@ { "dkg_algorithm": "default", "fork_version": "0x00001020", - "initial_mutation_hash": "0x9341f42d4f1aed5380f25b7134754774141d6f0cb59028c6e9c6253f70619dda", - "latest_mutation_hash": "0x9341f42d4f1aed5380f25b7134754774141d6f0cb59028c6e9c6253f70619dda", + "initial_mutation_hash": "0x6ed14a6e2679c2b47b26c2f92061c4d8c7466d3726d623d7746172ea598e4536", + "latest_mutation_hash": "0x6ed14a6e2679c2b47b26c2f92061c4d8c7466d3726d623d7746172ea598e4536", "name": "test cluster", "operators": [ {