diff --git a/common/compress.go b/common/compress.go index e34eed45e..0d92f2548 100644 --- a/common/compress.go +++ b/common/compress.go @@ -7,7 +7,8 @@ import ( "github.com/klauspost/compress/zstd" ) -// FIXME update this to the latest data format +// FIXME have a cmd to make some random transactions, snapshots and +// or other data to compress, then make different dicts respectively // //go:embed data/zstd.dic var ZstdEmbed []byte diff --git a/common/custodian_test.go b/common/custodian_test.go index b0c8724b1..210baed04 100644 --- a/common/custodian_test.go +++ b/common/custodian_test.go @@ -144,7 +144,7 @@ type testCustodianStore struct { custodianUpdateNodesTimestamp uint64 } -func (s *testCustodianStore) ReadCustodian(ts uint64) (*CustodianUpdateRequest, error) { +func (s *testCustodianStore) ReadCustodian(_ uint64) (*CustodianUpdateRequest, error) { if s.custodianUpdateNodesExtra == nil { if s.domain == nil { return nil, nil diff --git a/common/transaction.go b/common/transaction.go index 1fe93293a..a59f018be 100644 --- a/common/transaction.go +++ b/common/transaction.go @@ -370,8 +370,8 @@ func (tx *Transaction) AddScriptOutput(accounts []*Address, s Script, amount Int func (tx *Transaction) AddRandomScriptOutput(accounts []*Address, s Script, amount Integer) { seed := make([]byte, 64) - _, err := rand.Read(seed) - if err != nil { + n, err := rand.Read(seed) + if err != nil || n != 64 { panic(err) } tx.AddScriptOutput(accounts, s, amount, seed) diff --git a/common/transaction_test.go b/common/transaction_test.go index 228b93e5a..d9041879d 100644 --- a/common/transaction_test.go +++ b/common/transaction_test.go @@ -291,11 +291,11 @@ func (store storeImpl) ReadUTXOLock(hash crypto.Hash, index int) (*UTXOWithLock, return utxo, nil } -func (store storeImpl) LockGhostKeys(keys []*crypto.Key, tx crypto.Hash, fork bool) error { +func (store storeImpl) LockGhostKeys(_ []*crypto.Key, _ crypto.Hash, _ bool) error { return nil } -func (store storeImpl) LockUTXOs(inputs []*Input, tx crypto.Hash, fork bool) error { +func (store storeImpl) LockUTXOs(_ []*Input, _ crypto.Hash, _ bool) error { return nil } @@ -303,27 +303,27 @@ func (store storeImpl) ReadAllNodes(_ uint64, _ bool) []*Node { return nil } -func (store storeImpl) ReadTransaction(hash crypto.Hash) (*VersionedTransaction, string, error) { +func (store storeImpl) ReadTransaction(_ crypto.Hash) (*VersionedTransaction, string, error) { return nil, "", nil } -func (store storeImpl) CheckDepositInput(deposit *DepositData, tx crypto.Hash) error { +func (store storeImpl) CheckDepositInput(_ *DepositData, _ crypto.Hash) error { return nil } -func (store storeImpl) LockDepositInput(deposit *DepositData, tx crypto.Hash, fork bool) error { +func (store storeImpl) LockDepositInput(_ *DepositData, _ crypto.Hash, _ bool) error { return nil } -func (store storeImpl) ReadLastMintDistribution(batch uint64) (*MintDistribution, error) { +func (store storeImpl) ReadLastMintDistribution(_ uint64) (*MintDistribution, error) { return nil, nil } -func (store storeImpl) LockMintInput(mint *MintData, tx crypto.Hash, fork bool) error { +func (store storeImpl) LockMintInput(_ *MintData, _ crypto.Hash, _ bool) error { return nil } -func (store storeImpl) ReadCustodian(ts uint64) (*CustodianUpdateRequest, error) { +func (store storeImpl) ReadCustodian(_ uint64) (*CustodianUpdateRequest, error) { return &CustodianUpdateRequest{Custodian: store.custodian}, nil } diff --git a/crypto/batch.go b/crypto/batch.go index 5cef4468b..0e3952204 100644 --- a/crypto/batch.go +++ b/crypto/batch.go @@ -143,8 +143,11 @@ func (v *BatchVerifier) Verify() bool { } buf := make([]byte, 32) - rand.Read(buf[:16]) - _, err := Rcoeffs[i].SetCanonicalBytes(buf) + n, err := rand.Read(buf[:16]) + if err != nil || n != 16 { + panic(err) + } + _, err = Rcoeffs[i].SetCanonicalBytes(buf) if err != nil { return false } diff --git a/kernel/custodian.go b/kernel/custodian.go index be861eb5b..b3aa97d0f 100644 --- a/kernel/custodian.go +++ b/kernel/custodian.go @@ -42,9 +42,6 @@ func (node *Node) validateCustodianUpdateNodes(s *common.Snapshot, tx *common.Ve if err != nil { return err } - if prev == nil { - panic("FIXME genesis check") - } eh := crypto.Blake3Hash(tx.Extra[:len(tx.Extra)-64]) if !prev.Custodian.PublicSpendKey.Verify(eh, *curs.Signature) { return fmt.Errorf("invalid custodian update approval signature %x", tx.Extra) diff --git a/kernel/genesis.go b/kernel/genesis.go index 8102e43fa..1cea8afd1 100644 --- a/kernel/genesis.go +++ b/kernel/genesis.go @@ -143,8 +143,9 @@ func buildCustodianSnapshot(networkId crypto.Hash, epoch uint64, gns *Genesis) ( addr := common.NewAddressFromSeed(make([]byte, 64)) script := common.NewThresholdScript(64) accounts := []*common.Address{&addr} + amount := common.NewInteger(100).Mul(len(gns.Nodes)) tx.Inputs = []*common.Input{{Genesis: networkId[:]}} - tx.AddOutputWithType(common.OutputTypeCustodianUpdateNodes, accounts, script, common.NewInteger(50000), seed) + tx.AddOutputWithType(common.OutputTypeCustodianUpdateNodes, accounts, script, amount, seed) tx.Extra = append(tx.Extra, gns.Custodian.PublicSpendKey[:]...) tx.Extra = append(tx.Extra, gns.Custodian.PublicViewKey[:]...) diff --git a/kernel/genesis_test.go b/kernel/genesis_test.go index 22312301e..1996622c8 100644 --- a/kernel/genesis_test.go +++ b/kernel/genesis_test.go @@ -89,5 +89,5 @@ var ( "f0d33a4768bf9987b45018cc758e098fe681bc73134ce1253d7dbecdd6185cd3", "f75ab04c4ddd6391baad5af45f961152177132498cbb244bee5555bc4061df09", } - genesisSnapshotsData = `[{"hash":"7c83d32a6fdbde3e789869ebecf294e51e8d063264227312ab8edfd011c8db05","hex":"777700022181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f000000000000000000000001d4943cc2f3acf240ce068965c910788f46d7f1323cf37e496492658a3d7e7ad015875e0b77cd000000000000000000000000000000000000","node":"2181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f","references":null,"round":0,"timestamp":1551312000000000000,"topology":0,"transactions":["d4943cc2f3acf240ce068965c910788f46d7f1323cf37e496492658a3d7e7ad0"],"version":2,"witness":{"signature":"3d119f73deed79bbcc4b648a6bb8d5bf419ddf945a4cdac7affa040c81ee0eb672c4783b41a159a8d58ce04694089200e4f146a0e9f7168905219626bb5f490f","timestamp":1696955053661575526}},{"hash":"7d5bced03fb388352fe817f288cc7b76e1b970d4e382e0391fefe6ef14e2f693","hex":"7777000272ddc2d80b2c45d759aa35d392ceaabcbd1e58341b22e1d2b8c588455d9f5273000000000000000000000001c8629d37759c2652e9752b9ee44f9426003509a8c89818c2d2459cf8a295f6dd15875e0b77cd000000000000000000000000000000000001","node":"72ddc2d80b2c45d759aa35d392ceaabcbd1e58341b22e1d2b8c588455d9f5273","references":null,"round":0,"timestamp":1551312000000000000,"topology":1,"transactions":["c8629d37759c2652e9752b9ee44f9426003509a8c89818c2d2459cf8a295f6dd"],"version":2,"witness":{"signature":"beca304c7a44d08cbb02bc8c68824f98c5de66a78875617f19af3554ff2ab0241bb86828abcf14098b8537fe27b74d2ad6784f197b62a6a9773ed554bbffb206","timestamp":1696955053661737919}},{"hash":"7bf45f6cab454981a92a22766ddf4b6a5c848749b79749abc51c46ec2a382295","hex":"777700028467616ad7a46564a659c9436b1e3ae969efe7bb6c10ce45fa689ab0fe5178180000000000000000000000017523942f68e0d04a5a887e53a8632e53fc2ea3a91341af68406785eb8a0bb05e15875e0b77cd000000000000000000000000000000000002","node":"8467616ad7a46564a659c9436b1e3ae969efe7bb6c10ce45fa689ab0fe517818","references":null,"round":0,"timestamp":1551312000000000000,"topology":2,"transactions":["7523942f68e0d04a5a887e53a8632e53fc2ea3a91341af68406785eb8a0bb05e"],"version":2,"witness":{"signature":"46da6bd2ca178a5396fa321d315b3374fd957ce24544682d106fd56a6f4d089dd83ce5c1a4072d44e7c6aae043d227ae3af527546fad84e7817e7a9b126ebe0f","timestamp":1696955053661893586}},{"hash":"2ac55e8b43d0a0d10d81380e7ed65ae3471ef494e5d0f1b6cfca1133ed6d19ae","hex":"777700027de3e4ebdb74df93fdc63a3fefdf7d9852c1997b402a619cff6104f753034f00000000000000000000000001692076963feb2d845a1a600d75cb6865bc4c8d44f683c6e1060c3edc3d5a030315875e0b77cd000000000000000000000000000000000003","node":"7de3e4ebdb74df93fdc63a3fefdf7d9852c1997b402a619cff6104f753034f00","references":null,"round":0,"timestamp":1551312000000000000,"topology":3,"transactions":["692076963feb2d845a1a600d75cb6865bc4c8d44f683c6e1060c3edc3d5a0303"],"version":2,"witness":{"signature":"d070223a022f18e06525597e54de13c9776c9441386fd378e398381adf277be450c893e0389e8761b49b72073b524f215a63ad7ff44f40e7f415e3aa3606060a","timestamp":1696955053662048551}},{"hash":"1b2c840765a2872643f7ed3b8d5859293743f2247ed62e7e74f0684aebaf25dd","hex":"7777000278cc5e7430fe43a0516ddc8d425fe1314207b4ff39e2cbb25e89807e06d65954000000000000000000000001a059fdace5260d77acc79160e605b267043bc3aad566d40efe6f5ecc98efcee215875e0b77cd000000000000000000000000000000000004","node":"78cc5e7430fe43a0516ddc8d425fe1314207b4ff39e2cbb25e89807e06d65954","references":null,"round":0,"timestamp":1551312000000000000,"topology":4,"transactions":["a059fdace5260d77acc79160e605b267043bc3aad566d40efe6f5ecc98efcee2"],"version":2,"witness":{"signature":"ecc78a1099c4d9eeb0bdebbbf54d37c1b6eb47359f1ba8e68067cfee867274f0f609bfc118e04d9c74c56c899b7b2d86cd910f7ec26ccf7ac1bd81f249c7ae09","timestamp":1696955053662202963}},{"hash":"d692a47551ab4d5a47992f0eef9821f509ae91ad9c43c3eb3c991ae738386fe2","hex":"77770002f75ab04c4ddd6391baad5af45f961152177132498cbb244bee5555bc4061df090000000000000000000000015a41c3de860236c99b797e48f3fd2fad1fcc7fcbb2ecaef7d88ed3e454d13ed615875e0b77cd000000000000000000000000000000000005","node":"f75ab04c4ddd6391baad5af45f961152177132498cbb244bee5555bc4061df09","references":null,"round":0,"timestamp":1551312000000000000,"topology":5,"transactions":["5a41c3de860236c99b797e48f3fd2fad1fcc7fcbb2ecaef7d88ed3e454d13ed6"],"version":2,"witness":{"signature":"fef8273672e43e34f55b52b7e3a195b4454df46d11fb7f3218a6436a48b5d20990cf8fa620a779af8e5b72e768e49694b8e30ea3d044af91e6abdd3baefc0802","timestamp":1696955053662280446}},{"hash":"273e7ee1e7b13a70200932ae385785536c8f81ac7f7c3be490309ccc5bdc2371","hex":"777700023176875e209ddfd6cfc4bf743746e5ca04c354439010d188b246e01bc39b81530000000000000000000000019c99a5e288ccac85b774689aa04d675cdb5f8849c230fdef29369b9572eff23815875e0b77cd000000000000000000000000000000000006","node":"3176875e209ddfd6cfc4bf743746e5ca04c354439010d188b246e01bc39b8153","references":null,"round":0,"timestamp":1551312000000000000,"topology":6,"transactions":["9c99a5e288ccac85b774689aa04d675cdb5f8849c230fdef29369b9572eff238"],"version":2,"witness":{"signature":"fbbf69cf99da0e109fa1065560a3de1fb4fd95e9d97a953b03413171f85a45837c2a17bbeda707ef1be8f7c19a96121c611d9f00ce922b46378cd99230acb90e","timestamp":1696955053662349788}},{"hash":"3b01d0e177c123178572fddf6b4cab37df7519cdaf9eaee5bcdeb518d720ce7a","hex":"777700028723373497af49a6833c3caa7aae392efdacc3c3002c1adca66f71e20f9575ae000000000000000000000001ebd0dcff0a13a363084cfe2b9499ebd427ffb3f5f029f074c37659c5a21c9c5315875e0b77cd000000000000000000000000000000000007","node":"8723373497af49a6833c3caa7aae392efdacc3c3002c1adca66f71e20f9575ae","references":null,"round":0,"timestamp":1551312000000000000,"topology":7,"transactions":["ebd0dcff0a13a363084cfe2b9499ebd427ffb3f5f029f074c37659c5a21c9c53"],"version":2,"witness":{"signature":"3f8d40ab6656bf0b20f4512952d7056ca8ca83a7fb7a4a8b750b74be63e8004a72091867d897abba633f2b9166884e102a3b7d77f2f81a37493e207dea9f6a05","timestamp":1696955053662416314}},{"hash":"e3651872106ed9b0785bc5ec1a609600d09651fdc781f5fc45ce6ca9e166fca2","hex":"777700020d4bbdc9bff475ded23e14f1e46195bbd31580d9301f90491c6d40ca9a0e318e00000000000000000000000130beb49f1f4aa7510fba6afcba4aa1b64f7e3d3617223df649bb8eb92a91580915875e0b77cd000000000000000000000000000000000008","node":"0d4bbdc9bff475ded23e14f1e46195bbd31580d9301f90491c6d40ca9a0e318e","references":null,"round":0,"timestamp":1551312000000000000,"topology":8,"transactions":["30beb49f1f4aa7510fba6afcba4aa1b64f7e3d3617223df649bb8eb92a915809"],"version":2,"witness":{"signature":"9b442e45155417d38c9df9aff45e44b117cc9fc8ff25d25f0c66e896ee7d04925124357d48dd8d020ebca86a5a9a02dc14bb0a4fc2e0af14e590cd4c8ef75f00","timestamp":1696955053662483763}},{"hash":"acee39a73260bea08ee0d5ca09c475299498ffa0af5bf0960bf4aa0d0c30b224","hex":"77770002f0d33a4768bf9987b45018cc758e098fe681bc73134ce1253d7dbecdd6185cd30000000000000000000000011600bb652ee1569caa25c2a5bc4ce56a32dc2cf5bc8ce7b9bc1c743316bed7cf15875e0b77cd000000000000000000000000000000000009","node":"f0d33a4768bf9987b45018cc758e098fe681bc73134ce1253d7dbecdd6185cd3","references":null,"round":0,"timestamp":1551312000000000000,"topology":9,"transactions":["1600bb652ee1569caa25c2a5bc4ce56a32dc2cf5bc8ce7b9bc1c743316bed7cf"],"version":2,"witness":{"signature":"499d04e37107e8b59c1ac2de414a153f453b6c97ef3b85c324f9e6149a8c681e41ec74cff63ea25f3907a3c41408e75ffd8a1f349b6a1ff174b0caab01e70a0d","timestamp":1696955053662550315}},{"hash":"c25f6d2df543fe20eeda2d55cf8a5395f9eef4b5e2a45d6614aa2e3202950861","hex":"77770002d5a951cfb37b3a6670dac2a5d4c517c3093715371f44011b37fbbdf1ddbee0ee000000000000000000000001416813d96052565447299fc979656dc1c98e9e8e77d3d9f1a03e287951a58f0a15875e0b77cd00000000000000000000000000000000000a","node":"d5a951cfb37b3a6670dac2a5d4c517c3093715371f44011b37fbbdf1ddbee0ee","references":null,"round":0,"timestamp":1551312000000000000,"topology":10,"transactions":["416813d96052565447299fc979656dc1c98e9e8e77d3d9f1a03e287951a58f0a"],"version":2,"witness":{"signature":"4053081f404a1e8173d089ec1119bd1468b8ea8f665ed31f96713187917aa89f1af27b8a887ef1df22e6c675cfa23d7e751e11f6b9f1c44aff64d6c9f8d44906","timestamp":1696955053662619361}},{"hash":"8b7caf567d77aff480ac886ca2fdb74268b35a281623b3db37ade146f38de37e","hex":"77770002e35422141e9286781231cbb8b0f690eadf117cfddc03c71746c317b90df278d800000000000000000000000115375dfd395517a2c8b63accfa4395f26846e7155f1673a912a05ad20b6373c615875e0b77cd00000000000000000000000000000000000b","node":"e35422141e9286781231cbb8b0f690eadf117cfddc03c71746c317b90df278d8","references":null,"round":0,"timestamp":1551312000000000000,"topology":11,"transactions":["15375dfd395517a2c8b63accfa4395f26846e7155f1673a912a05ad20b6373c6"],"version":2,"witness":{"signature":"edf37a76a1c4b53556b9b65ec61c450ce528fb9a15ccb65c1c23fe1558b54a99700b142c329435defae6a5f091e84284ae79820b158012f30a829338492b7c03","timestamp":1696955053662686975}},{"hash":"ef99df5a87e79bb1da178b19358e7165e7e25a4646c2f9596806b8292edc4998","hex":"77770002bfabd0265001c740c696dc9def66cc9acf3d5f332cb20efc6b1b62448710c8620000000000000000000000018dd6b8788a6927b87103f0529d6f658817d08cade108d0df4522068af1175a5b15875e0b77cd00000000000000000000000000000000000c","node":"bfabd0265001c740c696dc9def66cc9acf3d5f332cb20efc6b1b62448710c862","references":null,"round":0,"timestamp":1551312000000000000,"topology":12,"transactions":["8dd6b8788a6927b87103f0529d6f658817d08cade108d0df4522068af1175a5b"],"version":2,"witness":{"signature":"4d9ab5c6479b6ef31bd2e0480f8b4af24c052a1c1b0e98d1f1a9ed7ba516ea95ce516f6805829275d1f0f5ddc64d8bbc2ce8fab95e98eb43afe64350ab45a10c","timestamp":1696955053662757128}},{"hash":"85636fd394457851ccf503001f8567b680a69b6c70c06c91acc6d8c3767afd3e","hex":"77770002b266e7cf8ed627d1926a5e92c2f7617152193362ef3b06eb2a1a54b1db5edbd1000000000000000000000001d8f551c1dcf69302c1304838ecbe7215cc3c4d5af8386d982712013809cfcfb615875e0b77cd00000000000000000000000000000000000d","node":"b266e7cf8ed627d1926a5e92c2f7617152193362ef3b06eb2a1a54b1db5edbd1","references":null,"round":0,"timestamp":1551312000000000000,"topology":13,"transactions":["d8f551c1dcf69302c1304838ecbe7215cc3c4d5af8386d982712013809cfcfb6"],"version":2,"witness":{"signature":"a51be400d98f1f762a0e61b20c08c5105fb74737d35d088cda9aaea18f48e19ad618e23aa944528590ab19032657a73625af7e7385042b373d866aa909858907","timestamp":1696955053662825069}},{"hash":"c72ccff568aaa07ecebad578f12f665634b70e72f252fdea174286addb472aea","hex":"77770002aea0e6ef1a260f110714e601a46d1cd423be0aa0d57e9159728c2a8997814bf40000000000000000000000015d6409cd38803d67a5a2c4eaef04a90e15f717f8cd230618bd5e7864401ec61f15875e0b77cd00000000000000000000000000000000000e","node":"aea0e6ef1a260f110714e601a46d1cd423be0aa0d57e9159728c2a8997814bf4","references":null,"round":0,"timestamp":1551312000000000000,"topology":14,"transactions":["5d6409cd38803d67a5a2c4eaef04a90e15f717f8cd230618bd5e7864401ec61f"],"version":2,"witness":{"signature":"18c03d4a7c21c8c5844d76edb0dbc7de79bbeedefb2e6fe9d56244461ef2ff5517f75f422c61a307a765b69f1d37720eb185e9a8df85e4c39e741984a0202209","timestamp":1696955053662891504}},{"hash":"6d8cc2a6390759690811a4c88baf44b8ff027c1c8ddecc5ca389d45953a792b5","hex":"777700022181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f000000000000000000000001b44483e80c974e81a1fd1dacfa0fc39a4ee38bab6c1d9248169b1496269ebd2a15875e0b77cd00010000000000000000000000000000000f","node":"2181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f","references":null,"round":0,"timestamp":1551312000000000001,"topology":15,"transactions":["b44483e80c974e81a1fd1dacfa0fc39a4ee38bab6c1d9248169b1496269ebd2a"],"version":2,"witness":{"signature":"adcc2d3296021b27e1dfd692acde70855d06540cdde7e43f97afb1babf3d23c5e49e98ed8fb3ed5a00d2432ae574203aa94eaa756857a8e1cc474677ce97720e","timestamp":1696955053662957637}}]` + genesisSnapshotsData = `[{"hash":"7c83d32a6fdbde3e789869ebecf294e51e8d063264227312ab8edfd011c8db05","hex":"777700022181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f000000000000000000000001d4943cc2f3acf240ce068965c910788f46d7f1323cf37e496492658a3d7e7ad015875e0b77cd000000000000000000000000000000000000","node":"2181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f","references":null,"round":0,"timestamp":1551312000000000000,"topology":0,"transactions":["d4943cc2f3acf240ce068965c910788f46d7f1323cf37e496492658a3d7e7ad0"],"version":2,"witness":{"signature":"3d119f73deed79bbcc4b648a6bb8d5bf419ddf945a4cdac7affa040c81ee0eb672c4783b41a159a8d58ce04694089200e4f146a0e9f7168905219626bb5f490f","timestamp":1696955053661575526}},{"hash":"7d5bced03fb388352fe817f288cc7b76e1b970d4e382e0391fefe6ef14e2f693","hex":"7777000272ddc2d80b2c45d759aa35d392ceaabcbd1e58341b22e1d2b8c588455d9f5273000000000000000000000001c8629d37759c2652e9752b9ee44f9426003509a8c89818c2d2459cf8a295f6dd15875e0b77cd000000000000000000000000000000000001","node":"72ddc2d80b2c45d759aa35d392ceaabcbd1e58341b22e1d2b8c588455d9f5273","references":null,"round":0,"timestamp":1551312000000000000,"topology":1,"transactions":["c8629d37759c2652e9752b9ee44f9426003509a8c89818c2d2459cf8a295f6dd"],"version":2,"witness":{"signature":"beca304c7a44d08cbb02bc8c68824f98c5de66a78875617f19af3554ff2ab0241bb86828abcf14098b8537fe27b74d2ad6784f197b62a6a9773ed554bbffb206","timestamp":1696955053661737919}},{"hash":"7bf45f6cab454981a92a22766ddf4b6a5c848749b79749abc51c46ec2a382295","hex":"777700028467616ad7a46564a659c9436b1e3ae969efe7bb6c10ce45fa689ab0fe5178180000000000000000000000017523942f68e0d04a5a887e53a8632e53fc2ea3a91341af68406785eb8a0bb05e15875e0b77cd000000000000000000000000000000000002","node":"8467616ad7a46564a659c9436b1e3ae969efe7bb6c10ce45fa689ab0fe517818","references":null,"round":0,"timestamp":1551312000000000000,"topology":2,"transactions":["7523942f68e0d04a5a887e53a8632e53fc2ea3a91341af68406785eb8a0bb05e"],"version":2,"witness":{"signature":"46da6bd2ca178a5396fa321d315b3374fd957ce24544682d106fd56a6f4d089dd83ce5c1a4072d44e7c6aae043d227ae3af527546fad84e7817e7a9b126ebe0f","timestamp":1696955053661893586}},{"hash":"2ac55e8b43d0a0d10d81380e7ed65ae3471ef494e5d0f1b6cfca1133ed6d19ae","hex":"777700027de3e4ebdb74df93fdc63a3fefdf7d9852c1997b402a619cff6104f753034f00000000000000000000000001692076963feb2d845a1a600d75cb6865bc4c8d44f683c6e1060c3edc3d5a030315875e0b77cd000000000000000000000000000000000003","node":"7de3e4ebdb74df93fdc63a3fefdf7d9852c1997b402a619cff6104f753034f00","references":null,"round":0,"timestamp":1551312000000000000,"topology":3,"transactions":["692076963feb2d845a1a600d75cb6865bc4c8d44f683c6e1060c3edc3d5a0303"],"version":2,"witness":{"signature":"d070223a022f18e06525597e54de13c9776c9441386fd378e398381adf277be450c893e0389e8761b49b72073b524f215a63ad7ff44f40e7f415e3aa3606060a","timestamp":1696955053662048551}},{"hash":"1b2c840765a2872643f7ed3b8d5859293743f2247ed62e7e74f0684aebaf25dd","hex":"7777000278cc5e7430fe43a0516ddc8d425fe1314207b4ff39e2cbb25e89807e06d65954000000000000000000000001a059fdace5260d77acc79160e605b267043bc3aad566d40efe6f5ecc98efcee215875e0b77cd000000000000000000000000000000000004","node":"78cc5e7430fe43a0516ddc8d425fe1314207b4ff39e2cbb25e89807e06d65954","references":null,"round":0,"timestamp":1551312000000000000,"topology":4,"transactions":["a059fdace5260d77acc79160e605b267043bc3aad566d40efe6f5ecc98efcee2"],"version":2,"witness":{"signature":"ecc78a1099c4d9eeb0bdebbbf54d37c1b6eb47359f1ba8e68067cfee867274f0f609bfc118e04d9c74c56c899b7b2d86cd910f7ec26ccf7ac1bd81f249c7ae09","timestamp":1696955053662202963}},{"hash":"d692a47551ab4d5a47992f0eef9821f509ae91ad9c43c3eb3c991ae738386fe2","hex":"77770002f75ab04c4ddd6391baad5af45f961152177132498cbb244bee5555bc4061df090000000000000000000000015a41c3de860236c99b797e48f3fd2fad1fcc7fcbb2ecaef7d88ed3e454d13ed615875e0b77cd000000000000000000000000000000000005","node":"f75ab04c4ddd6391baad5af45f961152177132498cbb244bee5555bc4061df09","references":null,"round":0,"timestamp":1551312000000000000,"topology":5,"transactions":["5a41c3de860236c99b797e48f3fd2fad1fcc7fcbb2ecaef7d88ed3e454d13ed6"],"version":2,"witness":{"signature":"fef8273672e43e34f55b52b7e3a195b4454df46d11fb7f3218a6436a48b5d20990cf8fa620a779af8e5b72e768e49694b8e30ea3d044af91e6abdd3baefc0802","timestamp":1696955053662280446}},{"hash":"273e7ee1e7b13a70200932ae385785536c8f81ac7f7c3be490309ccc5bdc2371","hex":"777700023176875e209ddfd6cfc4bf743746e5ca04c354439010d188b246e01bc39b81530000000000000000000000019c99a5e288ccac85b774689aa04d675cdb5f8849c230fdef29369b9572eff23815875e0b77cd000000000000000000000000000000000006","node":"3176875e209ddfd6cfc4bf743746e5ca04c354439010d188b246e01bc39b8153","references":null,"round":0,"timestamp":1551312000000000000,"topology":6,"transactions":["9c99a5e288ccac85b774689aa04d675cdb5f8849c230fdef29369b9572eff238"],"version":2,"witness":{"signature":"fbbf69cf99da0e109fa1065560a3de1fb4fd95e9d97a953b03413171f85a45837c2a17bbeda707ef1be8f7c19a96121c611d9f00ce922b46378cd99230acb90e","timestamp":1696955053662349788}},{"hash":"3b01d0e177c123178572fddf6b4cab37df7519cdaf9eaee5bcdeb518d720ce7a","hex":"777700028723373497af49a6833c3caa7aae392efdacc3c3002c1adca66f71e20f9575ae000000000000000000000001ebd0dcff0a13a363084cfe2b9499ebd427ffb3f5f029f074c37659c5a21c9c5315875e0b77cd000000000000000000000000000000000007","node":"8723373497af49a6833c3caa7aae392efdacc3c3002c1adca66f71e20f9575ae","references":null,"round":0,"timestamp":1551312000000000000,"topology":7,"transactions":["ebd0dcff0a13a363084cfe2b9499ebd427ffb3f5f029f074c37659c5a21c9c53"],"version":2,"witness":{"signature":"3f8d40ab6656bf0b20f4512952d7056ca8ca83a7fb7a4a8b750b74be63e8004a72091867d897abba633f2b9166884e102a3b7d77f2f81a37493e207dea9f6a05","timestamp":1696955053662416314}},{"hash":"e3651872106ed9b0785bc5ec1a609600d09651fdc781f5fc45ce6ca9e166fca2","hex":"777700020d4bbdc9bff475ded23e14f1e46195bbd31580d9301f90491c6d40ca9a0e318e00000000000000000000000130beb49f1f4aa7510fba6afcba4aa1b64f7e3d3617223df649bb8eb92a91580915875e0b77cd000000000000000000000000000000000008","node":"0d4bbdc9bff475ded23e14f1e46195bbd31580d9301f90491c6d40ca9a0e318e","references":null,"round":0,"timestamp":1551312000000000000,"topology":8,"transactions":["30beb49f1f4aa7510fba6afcba4aa1b64f7e3d3617223df649bb8eb92a915809"],"version":2,"witness":{"signature":"9b442e45155417d38c9df9aff45e44b117cc9fc8ff25d25f0c66e896ee7d04925124357d48dd8d020ebca86a5a9a02dc14bb0a4fc2e0af14e590cd4c8ef75f00","timestamp":1696955053662483763}},{"hash":"acee39a73260bea08ee0d5ca09c475299498ffa0af5bf0960bf4aa0d0c30b224","hex":"77770002f0d33a4768bf9987b45018cc758e098fe681bc73134ce1253d7dbecdd6185cd30000000000000000000000011600bb652ee1569caa25c2a5bc4ce56a32dc2cf5bc8ce7b9bc1c743316bed7cf15875e0b77cd000000000000000000000000000000000009","node":"f0d33a4768bf9987b45018cc758e098fe681bc73134ce1253d7dbecdd6185cd3","references":null,"round":0,"timestamp":1551312000000000000,"topology":9,"transactions":["1600bb652ee1569caa25c2a5bc4ce56a32dc2cf5bc8ce7b9bc1c743316bed7cf"],"version":2,"witness":{"signature":"499d04e37107e8b59c1ac2de414a153f453b6c97ef3b85c324f9e6149a8c681e41ec74cff63ea25f3907a3c41408e75ffd8a1f349b6a1ff174b0caab01e70a0d","timestamp":1696955053662550315}},{"hash":"c25f6d2df543fe20eeda2d55cf8a5395f9eef4b5e2a45d6614aa2e3202950861","hex":"77770002d5a951cfb37b3a6670dac2a5d4c517c3093715371f44011b37fbbdf1ddbee0ee000000000000000000000001416813d96052565447299fc979656dc1c98e9e8e77d3d9f1a03e287951a58f0a15875e0b77cd00000000000000000000000000000000000a","node":"d5a951cfb37b3a6670dac2a5d4c517c3093715371f44011b37fbbdf1ddbee0ee","references":null,"round":0,"timestamp":1551312000000000000,"topology":10,"transactions":["416813d96052565447299fc979656dc1c98e9e8e77d3d9f1a03e287951a58f0a"],"version":2,"witness":{"signature":"4053081f404a1e8173d089ec1119bd1468b8ea8f665ed31f96713187917aa89f1af27b8a887ef1df22e6c675cfa23d7e751e11f6b9f1c44aff64d6c9f8d44906","timestamp":1696955053662619361}},{"hash":"8b7caf567d77aff480ac886ca2fdb74268b35a281623b3db37ade146f38de37e","hex":"77770002e35422141e9286781231cbb8b0f690eadf117cfddc03c71746c317b90df278d800000000000000000000000115375dfd395517a2c8b63accfa4395f26846e7155f1673a912a05ad20b6373c615875e0b77cd00000000000000000000000000000000000b","node":"e35422141e9286781231cbb8b0f690eadf117cfddc03c71746c317b90df278d8","references":null,"round":0,"timestamp":1551312000000000000,"topology":11,"transactions":["15375dfd395517a2c8b63accfa4395f26846e7155f1673a912a05ad20b6373c6"],"version":2,"witness":{"signature":"edf37a76a1c4b53556b9b65ec61c450ce528fb9a15ccb65c1c23fe1558b54a99700b142c329435defae6a5f091e84284ae79820b158012f30a829338492b7c03","timestamp":1696955053662686975}},{"hash":"ef99df5a87e79bb1da178b19358e7165e7e25a4646c2f9596806b8292edc4998","hex":"77770002bfabd0265001c740c696dc9def66cc9acf3d5f332cb20efc6b1b62448710c8620000000000000000000000018dd6b8788a6927b87103f0529d6f658817d08cade108d0df4522068af1175a5b15875e0b77cd00000000000000000000000000000000000c","node":"bfabd0265001c740c696dc9def66cc9acf3d5f332cb20efc6b1b62448710c862","references":null,"round":0,"timestamp":1551312000000000000,"topology":12,"transactions":["8dd6b8788a6927b87103f0529d6f658817d08cade108d0df4522068af1175a5b"],"version":2,"witness":{"signature":"4d9ab5c6479b6ef31bd2e0480f8b4af24c052a1c1b0e98d1f1a9ed7ba516ea95ce516f6805829275d1f0f5ddc64d8bbc2ce8fab95e98eb43afe64350ab45a10c","timestamp":1696955053662757128}},{"hash":"85636fd394457851ccf503001f8567b680a69b6c70c06c91acc6d8c3767afd3e","hex":"77770002b266e7cf8ed627d1926a5e92c2f7617152193362ef3b06eb2a1a54b1db5edbd1000000000000000000000001d8f551c1dcf69302c1304838ecbe7215cc3c4d5af8386d982712013809cfcfb615875e0b77cd00000000000000000000000000000000000d","node":"b266e7cf8ed627d1926a5e92c2f7617152193362ef3b06eb2a1a54b1db5edbd1","references":null,"round":0,"timestamp":1551312000000000000,"topology":13,"transactions":["d8f551c1dcf69302c1304838ecbe7215cc3c4d5af8386d982712013809cfcfb6"],"version":2,"witness":{"signature":"a51be400d98f1f762a0e61b20c08c5105fb74737d35d088cda9aaea18f48e19ad618e23aa944528590ab19032657a73625af7e7385042b373d866aa909858907","timestamp":1696955053662825069}},{"hash":"c72ccff568aaa07ecebad578f12f665634b70e72f252fdea174286addb472aea","hex":"77770002aea0e6ef1a260f110714e601a46d1cd423be0aa0d57e9159728c2a8997814bf40000000000000000000000015d6409cd38803d67a5a2c4eaef04a90e15f717f8cd230618bd5e7864401ec61f15875e0b77cd00000000000000000000000000000000000e","node":"aea0e6ef1a260f110714e601a46d1cd423be0aa0d57e9159728c2a8997814bf4","references":null,"round":0,"timestamp":1551312000000000000,"topology":14,"transactions":["5d6409cd38803d67a5a2c4eaef04a90e15f717f8cd230618bd5e7864401ec61f"],"version":2,"witness":{"signature":"18c03d4a7c21c8c5844d76edb0dbc7de79bbeedefb2e6fe9d56244461ef2ff5517f75f422c61a307a765b69f1d37720eb185e9a8df85e4c39e741984a0202209","timestamp":1696955053662891504}},{"hash":"b1c077de2b90de5332b863569d1561709bf0359c8ea2da10d73ed797d279e54c","hex":"777700022181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f000000000000000000000001b44483e80c974e81a1fd1dacfa0fc39a4ee38bab6c1d9248169b1496269ebd2a15875e0b77cd00010000000000000000000000000000000f","node":"2181cf6eb942b0abb4e3d81ebb573e2db573400f6c434e5ef1410d540342c77f","references":null,"round":0,"timestamp":1551312000000000001,"topology":15,"transactions":["87a3dd5b98b71049a303d2aa823216cebf3198ef0d7e222d77a1764ba965cee2"],"version":2,"witness":{"signature":"adcc2d3296021b27e1dfd692acde70855d06540cdde7e43f97afb1babf3d23c5e49e98ed8fb3ed5a00d2432ae574203aa94eaa756857a8e1cc474677ce97720e","timestamp":1696955053662957637}}]` ) diff --git a/kernel/round.go b/kernel/round.go index e1c5b4261..234b21a8e 100644 --- a/kernel/round.go +++ b/kernel/round.go @@ -249,9 +249,8 @@ func ComputeRoundHash(nodeId crypto.Hash, number uint64, snapshots []*common.Sna } } - var hash crypto.Hash buf := binary.BigEndian.AppendUint64(nodeId[:], number) - hash = crypto.Blake3Hash(buf) + hash := crypto.Blake3Hash(buf) for _, s := range snapshots { if s.Version > version { panic(nodeId) diff --git a/rpc/consensus_test.go b/rpc/consensus_test.go index 55c36c0b6..f72129502 100644 --- a/rpc/consensus_test.go +++ b/rpc/consensus_test.go @@ -32,10 +32,10 @@ var ( ) func TestConsensus(t *testing.T) { - testConsensus(t, 0) + testConsensus(t) } -func testConsensus(t *testing.T, snapVersionMint int) { +func testConsensus(t *testing.T) { require := require.New(t) kernel.TestMockReset() @@ -109,13 +109,13 @@ func testConsensus(t *testing.T, snapVersionMint int) { gt := testVerifyInfo(require, nodes) require.Truef(gt.Timestamp.Before(epoch.Add(1*time.Second)), "%s should before %s", gt.Timestamp, epoch.Add(1*time.Second)) - genesisAmount := 13442.5 / float64(INPUTS) + genesisAmount := (13439 + 3.5) / float64(INPUTS) domainAddress := accounts[0].String() deposits := make([]*common.VersionedTransaction, 0) for i := 0; i < INPUTS; i++ { raw := fmt.Sprintf(`{"version":5,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"deposit":{"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27","asset":"0xa974c709cfb4566686553a20790685a47aceaa33","transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1%06d","index":0,"amount":"%f"}}],"outputs":[{"type":0,"amount":"%f","script":"fffe01","accounts":["%s"]}]}`, i, genesisAmount, genesisAmount, domainAddress) rand.Seed(time.Now().UnixNano()) - tx, err := testSignTransaction(nodes[rand.Intn(len(nodes))].Host, accounts[0], raw, snapVersionMint) + tx, err := testSignTransaction(nodes[rand.Intn(len(nodes))].Host, accounts[0], raw) require.Nil(err) require.NotNil(tx) deposits = append(deposits, &common.VersionedTransaction{SignedTransaction: *tx}) @@ -136,9 +136,9 @@ func testConsensus(t *testing.T, snapVersionMint int) { utxos := make([]*common.VersionedTransaction, 0) for _, d := range deposits { - raw := fmt.Sprintf(`{"version":2,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"hash":"%s","index":0}],"outputs":[{"type":0,"amount":"%f","script":"fffe01","accounts":["%s"]}]}`, d.PayloadHash().String(), genesisAmount, domainAddress) + raw := fmt.Sprintf(`{"version":5,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"hash":"%s","index":0}],"outputs":[{"type":0,"amount":"%f","script":"fffe01","accounts":["%s"]}]}`, d.PayloadHash().String(), genesisAmount, domainAddress) rand.Seed(time.Now().UnixNano()) - tx, err := testSignTransaction(nodes[rand.Intn(len(nodes))].Host, accounts[0], raw, snapVersionMint) + tx, err := testSignTransaction(nodes[rand.Intn(len(nodes))].Host, accounts[0], raw) require.Nil(err) require.NotNil(tx) if tx != nil { @@ -172,7 +172,7 @@ func testConsensus(t *testing.T, snapVersionMint int) { require.Len(all, NODES) require.Equal("ACCEPTED", all[NODES-1].State) - input, _ := testBuildPledgeInput(t, nodes, accounts[0], utxos, snapVersionMint) + input, _ := testBuildPledgeInput(t, nodes, accounts[0], utxos) time.Sleep(3 * time.Second) transactionsCount = transactionsCount + 1 tl, _ = testVerifySnapshots(require, nodes) @@ -191,7 +191,7 @@ func testConsensus(t *testing.T, snapVersionMint int) { legacy := time.Date(2023, time.Month(10), 31, 0, 0, 0, 0, time.UTC).Sub(epoch) kernel.TestMockDiff(legacy) for i := 0; i < 3; i++ { - dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount, snapVersionMint) + dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount) transactionsCount = transactionsCount + len(dummyInputs) } @@ -207,14 +207,14 @@ func testConsensus(t *testing.T, snapVersionMint int) { gt = testVerifyInfo(require, nodes) require.Less(gt.Timestamp, epoch.Add(legacy).Add(61*time.Second)) - pn, pi, sv := testPledgeNewNode(t, nodes, accounts[0], gdata, plist, input, root, snapVersionMint) + pn, pi, sv := testPledgeNewNode(t, nodes, accounts[0], gdata, plist, input, root) t.Logf("PLEDGE %s\n", pn.Signer) transactionsCount = transactionsCount + 1 defer pi.Teardown() defer sv.Close() for i := 0; i < 5; i++ { - dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount, snapVersionMint) + dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount) transactionsCount = transactionsCount + len(dummyInputs) } @@ -300,7 +300,7 @@ func testConsensus(t *testing.T, snapVersionMint int) { require.Equal("XINCtoRSJYrNNQUv3xTsptxDKRqwHMwtNkvsQwFS58oFXYvgu9QhoetNwbmxUQ4JJGcjR1gnttMau1nCmGpkSimHR1dxrP8u", payee.String()) nodes = testRemoveNode(nodes, signer) for i := 0; i < 3; i++ { - dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount, snapVersionMint) + dummyInputs = testSendDummyTransactionsWithRetry(t, nodes, accounts[0], dummyInputs, dummyAmount) transactionsCount = transactionsCount + len(dummyInputs) } transactionsCount = transactionsCount + 1 @@ -329,7 +329,7 @@ func testConsensus(t *testing.T, snapVersionMint int) { require.Greater(hr.Round, uint64(1)) removalInputs := []*common.Input{{Hash: all[NODES].Transaction, Index: 0}} - removalInputs = testSendDummyTransactionsWithRetry(t, nodes[:1], payee, removalInputs, "13439", snapVersionMint) + removalInputs = testSendDummyTransactionsWithRetry(t, nodes[:1], payee, removalInputs, "13439") transactionsCount = transactionsCount + 1 tl, _ = testVerifySnapshots(require, nodes) require.Equal(transactionsCount, len(tl)) @@ -388,7 +388,7 @@ func testCustodianUpdateNodes(t *testing.T, nodes []*Node, signers, payees []com raw := fmt.Sprintf(`{"version":5,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","inputs":[{"deposit":{"chain":"8dd50817c082cdcdd6f167514928767a4b52426997bd6d4930eca101c5ff8a27","asset":"0xa974c709cfb4566686553a20790685a47aceaa33","transaction":"0xc7c1132b58e1f64c263957d7857fe5ec5294fce95d30dcd64efef71da1%06d","index":0,"amount":"%s"}}],"outputs":[{"type":0,"amount":"%s","script":"fffe01","accounts":["%s"]}]}`, 13439, amount.String(), amount.String(), domain.String()) rand.Seed(time.Now().UnixNano()) - deposit, err := testSignTransaction(nodes[0].Host, domain, raw, 0) + deposit, err := testSignTransaction(nodes[0].Host, domain, raw) require.Nil(err) require.NotNil(deposit) deposits := []*common.VersionedTransaction{{SignedTransaction: *deposit}} @@ -412,7 +412,7 @@ func testCustodianUpdateNodes(t *testing.T, nodes []*Node, signers, payees []com "outputs": outputs, "extra": hex.EncodeToString(tx.Extra), }) - signed, err := testSignTransaction(nodes[0].Host, domain, string(rb), 0) + signed, err := testSignTransaction(nodes[0].Host, domain, string(rb)) require.Nil(err) require.NotNil(signed) @@ -492,8 +492,8 @@ func testRemoveNode(nodes []*Node, r common.Address) []*Node { return tmp } -func testSendDummyTransactionsWithRetry(t *testing.T, nodes []*Node, domain common.Address, inputs []*common.Input, amount string, snapVersionMint int) []*common.Input { - outputs := testSendDummyTransactions(nodes, domain, inputs, amount, snapVersionMint) +func testSendDummyTransactionsWithRetry(t *testing.T, nodes []*Node, domain common.Address, inputs []*common.Input, amount string) []*common.Input { + outputs := testSendDummyTransactions(nodes, domain, inputs, amount) time.Sleep(3 * time.Second) var missingInputs []*common.Input @@ -515,12 +515,12 @@ func testSendDummyTransactionsWithRetry(t *testing.T, nodes []*Node, domain comm missingNodes = append(missingNodes, nodes[i]) } if len(missingInputs) > 0 { - testSendDummyTransactionsWithRetry(t, missingNodes, domain, missingInputs, amount, snapVersionMint) + testSendDummyTransactionsWithRetry(t, missingNodes, domain, missingInputs, amount) } return outputs } -func testSendDummyTransactions(nodes []*Node, domain common.Address, inputs []*common.Input, amount string, snapVersionMint int) []*common.Input { +func testSendDummyTransactions(nodes []*Node, domain common.Address, inputs []*common.Input, amount string) []*common.Input { outputs := make([]*common.Input, len(inputs)) var wg sync.WaitGroup @@ -541,7 +541,7 @@ func testSendDummyTransactions(nodes []*Node, domain common.Address, inputs []*c "accounts": []string{domain.String()}, }}, }) - tx, _ := testSignTransaction(node.Host, domain, string(raw), snapVersionMint) + tx, _ := testSignTransaction(node.Host, domain, string(raw)) ver := common.VersionedTransaction{SignedTransaction: *tx} id, _ := testSendTransaction(node.Host, hex.EncodeToString(ver.Marshal())) var res map[string]string @@ -568,7 +568,7 @@ metric = true peers = [%s] ` -func testPledgeNewNode(t *testing.T, nodes []*Node, domain common.Address, genesisData []byte, plist, input, root string, snapVersionMint int) (Node, *kernel.Node, *http.Server) { +func testPledgeNewNode(t *testing.T, nodes []*Node, domain common.Address, genesisData []byte, plist, input, root string) (Node, *kernel.Node, *http.Server) { require := require.New(t) var signer, payee common.Address @@ -604,7 +604,7 @@ func testPledgeNewNode(t *testing.T, nodes []*Node, domain common.Address, genes }}, "extra": signer.PublicSpendKey.String() + payee.PublicSpendKey.String(), }) - tx, err := testSignTransaction(nodes[0].Host, domain, string(raw), snapVersionMint) + tx, err := testSignTransaction(nodes[0].Host, domain, string(raw)) require.Nil(err) ver := common.VersionedTransaction{SignedTransaction: *tx} testSendTransactionsToNodesWithRetry(t, nodes, []*common.VersionedTransaction{&ver}) @@ -628,7 +628,7 @@ func testPledgeNewNode(t *testing.T, nodes []*Node, domain common.Address, genes return Node{Signer: signer, Payee: payee, Host: "127.0.0.1:18099"}, pnode, server } -func testBuildPledgeInput(t *testing.T, nodes []*Node, domain common.Address, utxos []*common.VersionedTransaction, snapVersionMint int) (string, error) { +func testBuildPledgeInput(t *testing.T, nodes []*Node, domain common.Address, utxos []*common.VersionedTransaction) (string, error) { require := require.New(t) inputs := []map[string]any{} for _, tx := range utxos { @@ -658,7 +658,7 @@ func testBuildPledgeInput(t *testing.T, nodes []*Node, domain common.Address, ut "inputs": inputs, "outputs": outputs, }) - tx, err := testSignTransaction(nodes[0].Host, domain, string(raw), snapVersionMint) + tx, err := testSignTransaction(nodes[0].Host, domain, string(raw)) require.Nil(err) ver := common.VersionedTransaction{SignedTransaction: *tx} testSendTransactionsToNodesWithRetry(t, nodes, []*common.VersionedTransaction{&ver}) @@ -787,7 +787,7 @@ func setupTestNet(root string) ([]common.Address, []common.Address, []byte, stri return signers, payees, genesisData, peersList } -func testSignTransaction(node string, account common.Address, rawStr string, snapVersionMint int) (*common.SignedTransaction, error) { +func testSignTransaction(node string, account common.Address, rawStr string) (*common.SignedTransaction, error) { var raw signerInput err := json.Unmarshal([]byte(rawStr), &raw) if err != nil {