Skip to content

Commit 8e9f7cf

Browse files
authored
Merge pull request #874 from CortexFoundation/torrent-hash
Torrent hash fix in storage
2 parents 8579eba + b77a17f commit 8e9f7cf

File tree

28 files changed

+379
-162
lines changed

28 files changed

+379
-162
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.15
55
require (
66
github.com/Azure/azure-storage-blob-go v0.8.1-0.20191213204130-762620a866ba
77
github.com/CortexFoundation/inference v1.0.2-0.20201224021922-b0ffbeb3641a
8-
github.com/CortexFoundation/torrentfs v1.0.23-0.20201231051304-82ddc94679e2
8+
github.com/CortexFoundation/torrentfs v1.0.23-0.20210107061014-4ce882e6c1af
99
github.com/VictoriaMetrics/fastcache v1.5.8-0.20200305212624-8835719dc76c
1010
github.com/aristanetworks/goarista v0.0.0-20200513152637-638451432ae4
1111
github.com/arsham/figurine v1.0.1
@@ -24,7 +24,7 @@ require (
2424
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3
2525
github.com/google/gofuzz v1.0.0
2626
github.com/gorilla/websocket v1.4.2
27-
github.com/hashicorp/golang-lru v0.5.5-0.20200511160909-eb529947af53
27+
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
2828
github.com/holiman/uint256 v1.1.1
2929
github.com/huin/goupnp v1.0.0
3030
github.com/influxdata/influxdb v1.8.0

go.sum

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8/go.m
5555
github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274/go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk=
5656
github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc/go.mod h1:N5BsicP5ynjXIi/Npl/SRzlJ630n1PJV2sRj0Z0t2HA=
5757
github.com/CortexFoundation/torrentfs v1.0.22-0.20201126093427-f455d2481b9b/go.mod h1:lcAYtGEoWAeIhWH/JpXno34eNA17xslgwg6UBBd769U=
58-
github.com/CortexFoundation/torrentfs v1.0.23-0.20201231051304-82ddc94679e2 h1:LYsw1PM1bO9P+k038HzNVwKOHH8YfqhptNOD5NpU+iI=
59-
github.com/CortexFoundation/torrentfs v1.0.23-0.20201231051304-82ddc94679e2/go.mod h1:G3ayO+jjreBIvSJ/Ybeau4BAFr8C7xXxfCT14k3vueU=
58+
github.com/CortexFoundation/torrentfs v1.0.23-0.20210107061014-4ce882e6c1af h1:REod3wU6mecnW9D26uiB+i23wJMBL/OUKe/pHTcFw/g=
59+
github.com/CortexFoundation/torrentfs v1.0.23-0.20210107061014-4ce882e6c1af/go.mod h1:vlT2WiXsQzl+fMK8UVs+o7q6bkOc/vkKM4XtEnAtHcM=
6060
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
6161
github.com/Julusian/godocdown v0.0.0-20170816220326-6d19f8ff2df8/go.mod h1:INZr5t32rG59/5xeltqoCJoNY7e5x/3xoY9WSWVWg74=
6262
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
@@ -174,8 +174,8 @@ github.com/anacrolix/torrent v1.15.1-0.20200504230043-cc5d2abe18e5/go.mod h1:QlO
174174
github.com/anacrolix/torrent v1.15.1-0.20200619022403-dd51e99b88cc/go.mod h1:wuopQPC5+/M+zHYvhcA2vp5UCTm9rUc+VqjyBa882Q8=
175175
github.com/anacrolix/torrent v1.15.1-0.20200715061614-dd906f8fa72e/go.mod h1:XWo/fJN1oKgcjgxM+pUZpvalHfqHDs27BY5mBZjIQWo=
176176
github.com/anacrolix/torrent v1.18.1-0.20201121024423-388e6899a15b/go.mod h1:nhOLTTTOcr5WnvNKJzHGKzyz5D8mujPIgdbRU2818v8=
177-
github.com/anacrolix/torrent v1.19.3-0.20201230004348-29cc20ede998 h1:v+D+H7RR0wPqh0P8xQk1OAtsNxi/g0hoGN9tU4KyBEA=
178-
github.com/anacrolix/torrent v1.19.3-0.20201230004348-29cc20ede998/go.mod h1:WjA5XIOm/3qWM8DUEhd5ACfD771/wsddW90nCAhCUOQ=
177+
github.com/anacrolix/torrent v1.20.1-0.20210106225046-69a419882b51 h1:pyAW9ilVARFMamxraj6l0+X2O7ctYNzK2WPUfXqUKKo=
178+
github.com/anacrolix/torrent v1.20.1-0.20210106225046-69a419882b51/go.mod h1:f/btzA0Ki6DT56yVGPbAN9n70wKeYjn22ikKkTaCFBs=
179179
github.com/anacrolix/upnp v0.1.1/go.mod h1:LXsbsp5h+WGN7YR+0A7iVXm5BL1LYryDev1zuJMWYQo=
180180
github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425 h1:/Wi6l2ONI1FUFWN4cBwHOO90V4ylp4ud/eov6GUcVFk=
181181
github.com/anacrolix/upnp v0.1.2-0.20200416075019-5e9378ed1425/go.mod h1:Pz94W3kl8rf+wxH3IbCa9Sq+DTJr8OSbV2Q3/y51vYs=
@@ -327,6 +327,8 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2
327327
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
328328
github.com/frankban/quicktest v1.9.0 h1:jfEA+Psfr/pHsRJYPpHiNu7PGJnGctNxvTaM3K1EyXk=
329329
github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
330+
github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY=
331+
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
330332
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
331333
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
332334
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -421,6 +423,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
421423
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
422424
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
423425
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
426+
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
427+
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
424428
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
425429
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
426430
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
@@ -484,6 +488,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
484488
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
485489
github.com/hashicorp/golang-lru v0.5.5-0.20200511160909-eb529947af53 h1:mcyf48FjrlX8JRXvy5v3LPeXBv+Um6WvoKS+kknfgIk=
486490
github.com/hashicorp/golang-lru v0.5.5-0.20200511160909-eb529947af53/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
491+
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
492+
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
487493
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
488494
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
489495
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
@@ -560,6 +566,8 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
560566
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
561567
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
562568
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
569+
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
570+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
563571
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
564572
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
565573
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=

miner/worker.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,6 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
872872
if parent.Time() >= uint64(timestamp) {
873873
timestamp = int64(parent.Time() + 1)
874874
}
875-
// this will ensure we're not going off too far in the future
876-
if now := time.Now().Unix(); timestamp > now+1 {
877-
wait := time.Duration(timestamp-now) * time.Second
878-
log.Info("Mining too far in the future", "wait", common.PrettyDuration(wait))
879-
time.Sleep(wait)
880-
}
881-
882875
num := parent.Number()
883876
if num.Uint64() <= w.checkpoint && w.checkpoint > 0 {
884877
return

vendor/github.com/CortexFoundation/torrentfs/chaindb.go

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/CortexFoundation/torrentfs/default.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/CortexFoundation/torrentfs/go.mod

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/CortexFoundation/torrentfs/go.sum

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)