Skip to content

Instantly share code, notes, and snippets.

View nisdas's full-sized avatar

Nishant Das nisdas

View GitHub Profile
@nisdas
nisdas / blst.patch
Created September 7, 2021 14:43
Patch For M1
diff --git a/shared/bls/blst/aliases.go b/shared/bls/blst/aliases.go
index ce47bcfc4..48f664ab6 100644
--- a/shared/bls/blst/aliases.go
+++ b/shared/bls/blst/aliases.go
@@ -1,4 +1,4 @@
-// +build linux,amd64 linux,arm64 darwin,amd64 windows,amd64
+// +build linux,amd64 linux,arm64 darwin,amd64 darwin,arm64 windows,amd64
// +build !blst_disabled
package blst
@nisdas
nisdas / benchmark.go
Created July 10, 2020 13:46
MultipleVerify BLST Benchmark
func BenchmarkVerifyMultipleSignatures(b *testing.B) {
var dst = []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_")
pubkeys := make([]*blst.P1Affine, 0, 100)
sigs := make([]*blst.P2Affine, 0, 100)
var msgs [][]byte
for i := 0; i < 100; i++ {
msg := [32]byte{'h', 'e', 'l', 'l', 'o', byte(i)}
rdbyte := [32]byte{}
mrand.Read(rdbyte[:])
priv := blst.KeyGen(rdbyte[:])
@nisdas
nisdas / go.mod
Created June 26, 2020 11:43
Noise Binary
module github.com/prysmaticlabs/prysm/tools/test
go 1.14
require (
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/ipfs/go-ipfs-addr v0.0.1
github.com/ipfs/go-log/v2 v2.1.1
github.com/libp2p/go-libp2p v0.10.0
github.com/libp2p/go-libp2p-autonat v0.3.0 // indirect
@nisdas
nisdas / error.log
Created June 11, 2020 07:34
Teku DiscoveryV5 Error
2020-06-11 15:25:37.148+08:00 | nioEventLoopGroup-4-1 | DEBUG | MessagePacketHandler | Failed to read message [MessagePacket{0x9501b63db588b5c04296c9a67e7591ac5fbe4a168814b9362dff14be558698e18c916af88641795cf9acedadb314aec57e3f5177f9289c23a0909dcc894c3353234c66b7795829dc96cad992767875e57c20f418c343af12e0}] from node Optional[NodeRecordV4{publicKey=0x02eda46f7df886667b4c6de869582553a5a5652473972bd4184e50a0e0ebc8422d, udpAddress=Optional[/192.168.1.104:4000], asBase64=-Ku4QL3HGxkmW_3U7krPypTFcD1fWMTF0_XFEEfVzRB2YPk8N5or1jPrM1r3itMtD_OHNNIewD50bkasZmjRkndnlBYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhMCoAWiJc2VjcDI1NmsxoQLtpG99-IZme0xt6GlYJVOlpWUkc5cr1BhOUKDg68hCLYN1ZHCCD6A, nodeId=0x65bde10761eeff35be024019574157ac69d239c63e5c2eb97cc5534af474c92c}] in status AUTHENTICATED
java.lang.RuntimeException: Failed to decrypt message
at org.ethereum.beacon.discovery.util.Functions.aesgcm_decrypt(Functions.java:152) ~[discovery-0.3.6.jar:0.3.6]
at org.ethereum.beacon.discovery.packet.MessagePacke
@nisdas
nisdas / log.txt
Created March 8, 2020 07:12
BLS Archive Failure
../mcl/include/mcl/gmp_util.hpp:130: error: undefined reference to '__gmpz_get_str'
/usr/include/gmpxx.h:1214: error: undefined reference to '__gmp_get_memory_functions'
../mcl/include/mcl/gmp_util.hpp:130: error: undefined reference to '__gmpz_get_str'
/usr/include/gmpxx.h:1214: error: undefined reference to '__gmp_get_memory_functions'
../mcl/include/mcl/fp.hpp:370: error: undefined reference to 'mcl::fp::copyAndMask(unsigned long*, void const*, unsigned long, mcl::fp::Op const&, mcl::fp::MaskMode)'
../mcl/include/mcl/fp.hpp:342: error: undefined reference to 'mcl::fp::copyAndMask(unsigned long*, void const*, unsigned long, mcl::fp::Op const&, mcl::fp::MaskMode)'
../mcl/include/mcl/fp.hpp:370: error: undefined reference to 'mcl::fp::copyAndMask(unsigned long*, void const*, unsigned long, mcl::fp::Op const&, mcl::fp::MaskMode)'
../mcl/include/mcl/fp.hpp:370: error: undefined reference to 'mcl::fp::copyAndMask(unsigned long*, void const*, unsigned long, mcl::fp::Op const&, mcl::fp::MaskMode)'
/usr/include/gmp
@nisdas
nisdas / config.patch
Last active March 7, 2020 06:32
Lighthouse - Prysm Interop
diff --git a/shared/params/config.go b/shared/params/config.go
index ee3e02300..0e71da0eb 100644
--- a/shared/params/config.go
+++ b/shared/params/config.go
@@ -209,16 +209,73 @@ func MainnetConfig() *BeaconChainConfig {
// mainnet deposit values.
func DemoBeaconConfig() *BeaconChainConfig {
demoConfig := *MainnetConfig()
-
- demoConfig.MinDepositAmount /= 10
@nisdas
nisdas / trace.log
Created March 5, 2020 16:00
Lighthouse Interop
22:51:26.754 DEBUG swarm2: [16Uiu2HAmL5EFohvRiQGCdBWurRmSLtNjG6xsetFBZBgtBjW2YNE6] swarm dialing peer [16Uiu2HAmLsZWzZnsftESXAtQEZhQy7Na4aMjv5HvKVWommArRQPZ] swarm_dial.go:193
22:51:26.754 DEBUG swarm2: 16Uiu2HAmL5EFohvRiQGCdBWurRmSLtNjG6xsetFBZBgtBjW2YNE6 swarm dialing 16Uiu2HAmLsZWzZnsftESXAtQEZhQy7Na4aMjv5HvKVWommArRQPZ swarm_dial.go:371
22:51:26.754 DEBUG swarm2: [limiter] adding a dial job through limiter: /ip4/163.172.177.34/tcp/9000 limiter.go:192
22:51:26.754 DEBUG swarm2: [limiter] taking FD token: peer: 16Uiu2HAmLsZWzZnsftESXAtQEZhQy7Na4aMjv5HvKVWommArRQPZ; addr: /ip4/163.172.177.34/tcp/9000; prev consuming: 0 limiter.go:160
22:51:26.754 DEBUG swarm2: [limiter] executing dial; peer: 16Uiu2HAmLsZWzZnsftESXAtQEZhQy7Na4aMjv5HvKVWommArRQPZ; addr: /ip4/163.172.177.34/tcp/9000; FD consuming: 1; waiting: 0 limiter.go:166
22:51:26.754 DEBUG swarm2: 16Uiu2HAmL5EFohvRiQGCdBWurRmSLtNjG6xsetFBZBgtBjW2YNE6 swarm dialing 16Uiu2HAmLsZWzZnsftESXAtQEZhQy7Na4aMjv5HvKVWommArRQPZ /ip4/163.172.17
@nisdas
nisdas / diff.patch
Last active February 5, 2020 06:11
Aggregation Diff
diff --git a/beacon-chain/operations/attestations/aggregate.go b/beacon-chain/operations/attestations/aggregate.go
index adc8107fe..cf45dbfe6 100644
--- a/beacon-chain/operations/attestations/aggregate.go
+++ b/beacon-chain/operations/attestations/aggregate.go
@@ -18,16 +18,12 @@ var timeToAggregate = time.Duration(params.BeaconConfig().SecondsPerSlot/3) * ti
// This kicks off a routine to aggregate the unaggregated attestations from pool.
func (s *Service) aggregateRoutine() {
ticker := time.NewTicker(timeToAggregate)
- ctx := context.TODO()
for {
[2020-02-04 00:41:57] FATAL modified: .BlockRoots[5767][0] = 0x8a
modified: .BlockRoots[5767][10] = 0x6a
modified: .BlockRoots[5767][11] = 0x64
modified: .BlockRoots[5767][12] = 0x42
modified: .BlockRoots[5767][13] = 0x8e
modified: .BlockRoots[5767][14] = 0x75
modified: .BlockRoots[5767][15] = 0x5f
modified: .BlockRoots[5767][16] = 0x19
modified: .BlockRoots[5767][17] = 0x41
modified: .BlockRoots[5767][18] = 0x1b
Seed: 0x92caaec9f731ab6c29b77f3d57ca91857c5e1d418c132eceee4c16a03d55d41f
Rounds: 90
HashFunction: SHA-256
Input-List: [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 25