good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
2f855bfa
Unverified
Commit
2f855bfa
authored
May 16, 2019
by
Péter Szilágyi
Committed by
GitHub
May 16, 2019
Browse files
Options
Downloads
Plain Diff
Merge pull request #19591 from karalabe/64bit-align
core/rawdb, eth/downloader: align 64bit atomic fields
parents
8cce6203
f35975ea
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/rawdb/freezer.go
+5
-1
5 additions, 1 deletion
core/rawdb/freezer.go
core/rawdb/freezer_table.go
+5
-1
5 additions, 1 deletion
core/rawdb/freezer_table.go
eth/downloader/downloader.go
+7
-3
7 additions, 3 deletions
eth/downloader/downloader.go
with
17 additions
and
5 deletions
core/rawdb/freezer.go
+
5
−
1
View file @
2f855bfa
...
@@ -66,8 +66,12 @@ const (
...
@@ -66,8 +66,12 @@ const (
// reserving it for go-ethereum. This would also reduce the memory requirements
// reserving it for go-ethereum. This would also reduce the memory requirements
// of Geth, and thus also GC overhead.
// of Geth, and thus also GC overhead.
type
freezer
struct
{
type
freezer
struct
{
tables
map
[
string
]
*
freezerTable
// Data tables for storing everything
// WARNING: The `frozen` field is accessed atomically. On 32 bit platforms, only
// 64-bit aligned fields can be atomic. The struct is guaranteed to be so aligned,
// so take advantage of that (https://golang.org/pkg/sync/atomic/#pkg-note-BUG).
frozen
uint64
// Number of blocks already frozen
frozen
uint64
// Number of blocks already frozen
tables
map
[
string
]
*
freezerTable
// Data tables for storing everything
instanceLock
fileutil
.
Releaser
// File-system lock to prevent double opens
instanceLock
fileutil
.
Releaser
// File-system lock to prevent double opens
}
}
...
...
This diff is collapsed.
Click to expand it.
core/rawdb/freezer_table.go
+
5
−
1
View file @
2f855bfa
...
@@ -73,6 +73,11 @@ func (i *indexEntry) marshallBinary() []byte {
...
@@ -73,6 +73,11 @@ func (i *indexEntry) marshallBinary() []byte {
// It consists of a data file (snappy encoded arbitrary data blobs) and an indexEntry
// It consists of a data file (snappy encoded arbitrary data blobs) and an indexEntry
// file (uncompressed 64 bit indices into the data file).
// file (uncompressed 64 bit indices into the data file).
type
freezerTable
struct
{
type
freezerTable
struct
{
// WARNING: The `items` field is accessed atomically. On 32 bit platforms, only
// 64-bit aligned fields can be atomic. The struct is guaranteed to be so aligned,
// so take advantage of that (https://golang.org/pkg/sync/atomic/#pkg-note-BUG).
items
uint64
// Number of items stored in the table (including items removed from tail)
noCompression
bool
// if true, disables snappy compression. Note: does not work retroactively
noCompression
bool
// if true, disables snappy compression. Note: does not work retroactively
maxFileSize
uint32
// Max file size for data-files
maxFileSize
uint32
// Max file size for data-files
name
string
name
string
...
@@ -86,7 +91,6 @@ type freezerTable struct {
...
@@ -86,7 +91,6 @@ type freezerTable struct {
// In the case that old items are deleted (from the tail), we use itemOffset
// In the case that old items are deleted (from the tail), we use itemOffset
// to count how many historic items have gone missing.
// to count how many historic items have gone missing.
items
uint64
// Number of items stored in the table (including items removed from tail)
itemOffset
uint32
// Offset (number of discarded items)
itemOffset
uint32
// Offset (number of discarded items)
headBytes
uint32
// Number of bytes written to the head file
headBytes
uint32
// Number of bytes written to the head file
...
...
This diff is collapsed.
Click to expand it.
eth/downloader/downloader.go
+
7
−
3
View file @
2f855bfa
...
@@ -98,6 +98,13 @@ var (
...
@@ -98,6 +98,13 @@ var (
)
)
type
Downloader
struct
{
type
Downloader
struct
{
// WARNING: The `rttEstimate` and `rttConfidence` fields are accessed atomically.
// On 32 bit platforms, only 64-bit aligned fields can be atomic. The struct is
// guaranteed to be so aligned, so take advantage of that. For more information,
// see https://golang.org/pkg/sync/atomic/#pkg-note-BUG.
rttEstimate
uint64
// Round trip time to target for download requests
rttConfidence
uint64
// Confidence in the estimated RTT (unit: millionths to allow atomic ops)
mode
SyncMode
// Synchronisation mode defining the strategy used (per sync cycle)
mode
SyncMode
// Synchronisation mode defining the strategy used (per sync cycle)
mux
*
event
.
TypeMux
// Event multiplexer to announce sync operation events
mux
*
event
.
TypeMux
// Event multiplexer to announce sync operation events
...
@@ -109,9 +116,6 @@ type Downloader struct {
...
@@ -109,9 +116,6 @@ type Downloader struct {
stateDB
ethdb
.
Database
// Database to state sync into (and deduplicate via)
stateDB
ethdb
.
Database
// Database to state sync into (and deduplicate via)
stateBloom
*
trie
.
SyncBloom
// Bloom filter for fast trie node existence checks
stateBloom
*
trie
.
SyncBloom
// Bloom filter for fast trie node existence checks
rttEstimate
uint64
// Round trip time to target for download requests
rttConfidence
uint64
// Confidence in the estimated RTT (unit: millionths to allow atomic ops)
// Statistics
// Statistics
syncStatsChainOrigin
uint64
// Origin block number where syncing started at
syncStatsChainOrigin
uint64
// Origin block number where syncing started at
syncStatsChainHeight
uint64
// Highest block number known when syncing started
syncStatsChainHeight
uint64
// Highest block number known when syncing started
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment