Skip to content

Commit

Permalink
3.5.6.4-Leisure
Browse files Browse the repository at this point in the history
Gridcoin Research 3.5.6.4/MSI=40.1
Leisure Upgrade

- Fix neural network: ensure RAC timestamps are current and synced
within 24 hours.  Reduce size of master database by filtering unecessary
rows.
- Remove potential database memory leak
- Add watchonly support (req by Derp): Bitcoin d4640d7, 952877e,
d7d5d23, f87ba3d, 0fa2f88, f606bb9 (Affects RPC calls for getbalance,
listreceived, listreceivedbyaddress, listreceivedbyaccount,
listtransactions, listaccounts, listsinceblock, gettransaction).
- Added code to keep the node in sync.  Periodically, if the client
falls out of sync for more then 30 minutes, the client asks other nodes
for blocks, clears orphans, clears ban flags, reconnects to the network,
reloads the chain and resyncs.
b. Added execute recover (this manually attempts to recover).
- Moved Surpassed max inbound connections to (debug=true) to remove spam
from the logs.
- Add hex support to getrawtransaction for coinvault.io.
  • Loading branch information
gridcoin committed May 15, 2016
1 parent ce93f74 commit 27a3ab7
Show file tree
Hide file tree
Showing 17 changed files with 489 additions and 200 deletions.
2 changes: 1 addition & 1 deletion Makefile.Debug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: gridcoinresearch
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Apr 23 10:25:02 2016
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun May 15 10:50:44 2016
# Project: gridcoinresearch.pro
# Template: app
#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Release
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: gridcoinresearch
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Apr 23 10:25:02 2016
# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun May 15 10:50:45 2016
# Project: gridcoinresearch.pro
# Template: app
#############################################################################
Expand Down
60 changes: 30 additions & 30 deletions contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
}
"Entry"
{
"MsmKey" = "8:_1F7D757BF031E15D44C47B631F994972"
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_2C7D9AF4C6E04C06A26314A95B1FF010"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
Expand Down Expand Up @@ -111,12 +117,6 @@
}
"Entry"
{
"MsmKey" = "8:_7EFEAD66FF864CE6AB4AE36FCBA65659"
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_86404F6E19794F8A9F8C0ED67F7ADBFC"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
Expand Down Expand Up @@ -416,6 +416,26 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1F7D757BF031E15D44C47B631F994972"
{
"SourcePath" = "8:BoincStake.tlb"
"TargetName" = "8:BoincStake.tlb"
"Tag" = "8:"
"Folder" = "8:_A31B68165F144F3EBC3FF86D68C9E31B"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:2"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2C7D9AF4C6E04C06A26314A95B1FF010"
{
"SourcePath" = "8:..\\..\\..\\share\\pixmaps\\GrcInstallBanner.jpg"
Expand Down Expand Up @@ -691,26 +711,6 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_7EFEAD66FF864CE6AB4AE36FCBA65659"
{
"SourcePath" = "8:BoincStake.tlb"
"TargetName" = "8:BoincStake.tlb"
"Tag" = "8:"
"Folder" = "8:_A31B68165F144F3EBC3FF86D68C9E31B"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:2"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_88C4C520DC26489AAE9A79AE2F7F22EB"
{
"SourcePath" = "8:..\\..\\..\\share\\pixmaps\\nsis-header.bmp"
Expand Down Expand Up @@ -1120,19 +1120,19 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Gridcoin Research"
"ProductCode" = "8:{F46F8BB1-89BD-4D20-8943-B47D57D1E3DF}"
"PackageCode" = "8:{9E0BB970-CC39-4F43-81D0-265B5575530B}"
"ProductCode" = "8:{35E668C0-64F2-4DA0-B82B-CF835081B360}"
"PackageCode" = "8:{DD4F1D71-50AF-4A04-8C67-91E2B9E8E695}"
"UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:FALSE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:40.0"
"ProductVersion" = "8:40.1"
"Manufacturer" = "8:GridcoinResearch"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"Title" = "8:Gridcoin Research 40.0"
"Title" = "8:Gridcoin Research 40.1"
"Subject" = "8:"
"ARPCONTACT" = "8:The Gridcoin Developers"
"Keywords" = "8:Gridcoin Research"
Expand Down
2 changes: 1 addition & 1 deletion contrib/Installer/boinc/boinc/Utilization.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Public Class Utilization

Public ReadOnly Property Version As Double
Get
Return 408
Return 409
End Get
End Property

Expand Down
17 changes: 11 additions & 6 deletions contrib/Installer/boinc/boinc/clsBoincProjectDownload.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Public Class clsBoincProjectDownload

Public Function DownloadGZipFiles() As Boolean

Dim lAgeOfMaster = GetFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
Dim lAgeOfMaster = GetUnixFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
Log("UFA Timestamp: " + Trim(lAgeOfMaster))

If lAgeOfMaster > SYNC_THRESHOLD Then
ReconnectToNeuralNetwork()
Dim bFail As Boolean = mGRCData.GetNeuralNetworkQuorumData(mbTestNet)
lAgeOfMaster = GetFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
lAgeOfMaster = GetUnixFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
End If
If lAgeOfMaster < SYNC_THRESHOLD Then Return True
Dim rWhiteListedProjects As New Row
Expand Down Expand Up @@ -63,7 +65,7 @@ Public Class clsBoincProjectDownload
Dim sGzipPathUnzipped As String = Replace(sPath, ".gz", ".xml")
'If older than 7 days, download the team files again:
GuiDoEvents()
If GetFileAge(sTeamPathUnzipped) > TEAM_SYNC_THRESHOLD Then
If GetWindowsFileAge(sTeamPathUnzipped) > TEAM_SYNC_THRESHOLD Then
Dim w As New MyWebClient
For iRetry As Integer = 1 To 5
Try
Expand All @@ -83,7 +85,7 @@ Public Class clsBoincProjectDownload

'Sync the main RAC gz file

If GetFileAge(sGzipPathUnzipped) > PROJECT_SYNC_THRESHOLD Then
If GetWindowsFileAge(sGzipPathUnzipped) > PROJECT_SYNC_THRESHOLD Then
Dim w As New MyWebClient
For iRetry As Integer = 1 To 5
Try
Expand Down Expand Up @@ -144,8 +146,11 @@ Public Class clsBoincProjectDownload
sTemp = Replace(sTemp, "</name>", "</username>")
sTemp = Replace(sTemp, "<user>", "<project><name>" + sProjectLocal + "</name><team_name>gridcoin</team_name>")
sTemp = Replace(sTemp, "</user>", "</project>")

oSW.WriteLine(sTemp)
'Dont bother writing timestamps older than 32 days since we base mag off of RAC
Dim lRowAgeInMins = GetRowAgeInMins(sTemp)
If lRowAgeInMins < (60 * 24 * 32) Then
oSW.WriteLine(sTemp)
End If
End While
objReader.Close()
End Using
Expand Down
4 changes: 2 additions & 2 deletions contrib/Installer/boinc/boinc/frmMining.vb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Public Class frmMining
Dim sReport As String = ""
Dim sReportRow As String = ""
Dim sMemoryName = IIf(mbTestNet, "magnitudes_testnet", "magnitudes")
If GetFileAge(GetGridPath("NeuralNetwork") + "\contract.dat") < 240 Then
If GetWindowsFileAge(GetGridPath("NeuralNetwork") + "\contract.dat") < 240 Then
PopulateNeuralDataViaContractFile()
Exit Sub
End If
Expand Down Expand Up @@ -808,7 +808,7 @@ Refresh:
End Sub
Private Function GetAgeOfContract() As Double

Return GetFileAge(GetGridFolder() + "NeuralNetwork\contract.dat")
Return GetWindowsFileAge(GetGridFolder() + "NeuralNetwork\contract.dat")

End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Expand Down
49 changes: 40 additions & 9 deletions contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Module modPersistedDataSystem
Private lUseCount As Long = 0
Private MAX_NEURAL_NETWORK_THREADS = 255
Public msNeuralDetail As String = ""
Public SYNC_THRESHOLD As Double = 60 * 12 '12 hours
Public SYNC_THRESHOLD As Double = 60 * 24 '24 hours
Public TEAM_SYNC_THRESHOLD As Double = 60 * 24 * 7 '1 WEEK
Public PROJECT_SYNC_THRESHOLD As Double = 60 * 24 '12 HOURS
Public PROJECT_SYNC_THRESHOLD As Double = 60 * 24 '24 HOURS

Public Structure NeuralStructure
Public PK As String
Expand Down Expand Up @@ -88,6 +88,9 @@ Module modPersistedDataSystem
Log("Unable to connect to neural network.")
End Try
End Sub
Public Function UnixTimestampToDate(ByVal timestamp As Double) As DateTime
Return New DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(timestamp)
End Function
Public Function GetMagnitudeContractDetails() As String
Dim surrogateRow As New Row
surrogateRow.Database = "CPID"
Expand Down Expand Up @@ -122,7 +125,7 @@ Module modPersistedDataSystem
Public Function GetMagnitudeContract() As String
Try

If GetFileAge(GetGridPath("NeuralNetwork") + "\contract.dat") < 240 Then
If GetWindowsFileAge(GetGridPath("NeuralNetwork") + "\contract.dat") < 240 Then
Dim sData As String
sData = FileToString(GetGridPath("NeuralNetwork") + "\contract.dat")
Return sData
Expand Down Expand Up @@ -363,8 +366,8 @@ Module modPersistedDataSystem
Log("EnsureTeamIsSynchronized: " + Trim(dAge))
Dim dWindow As Double = 60 * 60 '1 hour before and 1 hour after superblock expires:
If dAge > (86400 - dWindow) And dAge < (86400 + dWindow) Then
Dim lAgeOfMaster = GetFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
If lAgeOfMaster > dWindow Then
Dim lAgeOfMaster = GetUnixFileAge(GetGridFolder() + "NeuralNetwork\db.dat")
If lAgeOfMaster > SYNC_THRESHOLD Then
'Clear out this nodes project data, so the node can sync with the team at the same exact time:
Log("Clearing project data so we can synchronize as a team.")
ClearProjectData()
Expand All @@ -380,7 +383,8 @@ Module modPersistedDataSystem
End Try
End Sub
Private Sub ClearProjectData()
Dim sPath As String = GetFileAge(GetGridFolder() + "NeuralNetwork\")
Dim sPath As String = GetGridFolder() + "NeuralNetwork\"

SoftKill(sPath + "db.dat")
'Erase the projects
SoftKill(sPath + "*.gz")
Expand All @@ -389,7 +393,7 @@ Module modPersistedDataSystem
SoftKill(sPath + "*team.gz")
End Sub
Private Sub ClearWhitelistData()
Dim sPath As String = GetFileAge(GetGridFolder() + "NeuralNetwork\")
Dim sPath As String = GetGridFolder() + "NeuralNetwork\"
SoftKill(sPath + "whitelist*.dat")
End Sub
Public Function EnsureNNDirExists()
Expand Down Expand Up @@ -1673,14 +1677,41 @@ Retry:
Log("Unable to get quote data probably due to SSL being blocked: " + ex.Message)
End Try
End Function
Public Function GetFileAge(sPath As String) As Double
Public Function GetWindowsFileAge(sPath As String) As Double
If File.Exists(sPath) = False Then Return 1000000
Dim fi As New FileInfo(sPath)
If fi.Length = 0 Then Return 1000000
Dim iMins As Long = DateDiff(DateInterval.Minute, fi.LastWriteTime, Now)
Return iMins
End Function

Public Function GetRowAgeInMins(sRow As String) As Double
Dim sTS As String = ExtractXML(sRow, "<expavg_time>", "</expavg_time>")
Dim dStamp As Double = Val(sTS)
Dim dTime As DateTime = UnixTimestampToDate(dStamp)
Dim iMins As Long = DateDiff(DateInterval.Minute, dTime, Now)
Return iMins
End Function
Public Function GetUnixFileAge(sPath As String) As Double
If File.Exists(sPath) = False Then Return 1000000
Dim fi As New FileInfo(sPath)
If fi.Length = 0 Then Return 1000000
Dim sr As New StreamReader(sPath)
Dim dMaxStamp As Double = 0
Dim sTemp As String = ""
While sr.EndOfStream = False
sTemp = sr.ReadLine
Dim sTS As String = ExtractXML(sTemp, "<expavg_time>", "</expavg_time>")
Dim dStamp As Double = Val(sTS)
If dStamp > 0 And dStamp > dMaxStamp Then
dMaxStamp = dStamp
End If
End While
sr.Close()
Log("GUFA Timestamp: " + Trim(dMaxStamp))
Dim dTime As DateTime = UnixTimestampToDate(dMaxStamp)
Dim iMins As Long = DateDiff(DateInterval.Minute, dTime, Now)
Return iMins
End Function
Public Function GetQuorumHash(data As String)
Return mclsQHA.QuorumHashingAlgorithm(data)
End Function
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 5
#define CLIENT_VERSION_REVISION 6
#define CLIENT_VERSION_BUILD 3
#define CLIENT_VERSION_BUILD 4

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
Loading

0 comments on commit 27a3ab7

Please sign in to comment.