No Branch/Tag Specified
v1.11.6-statediff-v5
v1.10.26-statediff-4.2.2-alpha
jenkins_reborn
v1.10.25-statediff-v4
v1.10.25-statediff-v4-wip
cerc_refactor
release-v1.10.23-statediff-4.2.0-alpha
v1.10.23-statediff-v4
v1.10.23-statediff-v4-wip
v1.10.22-statediff-v4-wip
v1.10.22-statediff-v4
v1.10.21-statediff-v4
linter_updates_wip
release-v1.10-21-statediff-4.1.2-alpha
release-v1.10.21-statediff-4.1.2-alpha
v1.10.20-statediff-v4
v1.10.19-statediff-v4
statediff
v1.13.14
v1.11.6-statediff-v5.0.8
v1.10.23-statediff-4.2.0-alpha-cerc-unstable
v1.10.23-statediff-4.2.0-alpha-unstable
v1.10.25
v1.10.24
v1.10.23-statediff-4.2.0-alpha
v1.10.23-statediff-v4-unstable
v1.10.23
v1.10.22
v1.10.21-statediff-4.1.2-alpha
v1.10.21
v1.10.19-statediff-4.1.1-alpha
v1.10.20-statediff-4.1.0-alpha
v1.10.19-statediff-4.1.0-alpha
v1.10.20
v1.10.19-statediff-4.0.4-alpha
v1.10.19-statediff-4.0.3-alpha
v1.10.19-statediff-4.0.2-alpha
v1.10.19
v1.10.18-statediff-4.0.2-alpha
v1.10.18-statediff-3.2.2
v1.10.18-statediff-4.0.1-alpha
v1.10.18-statediff-3.2.1
v1.10.18
v1.10.17-statediff-4.0.1-alpha
v1.10.17-statediff-4.0.0-alpha
v1.10.17-statediff-3.2.1
v1.10.17-statediff-3.2.0
v1.10.17
v1.10.16-statediff-3.0.2
v3.0.2
v1.10.15-statediff-3.0.2
v1.10.16
v1.10.15-statediff-3.1.0
v1.10.15-statediff-3.0.1
v1.10.15-statediff-3.0.0
v1.10.11-statediff-3.0.0
v1.10.15-statediff-2.0.0
v1.10.15-statediff-0.0.29
v1.10.15
v1.10.11-statediff-0.1.0
v1.10.14-statediff-0.0.29
v1.10.14-statediff-0.0.28
v1.10.14
v1.10.13-statediff-0.0.29
v1.10.11-statediff-0.0.28a
v1.10.13-statediff-0.0.28
v1.10.12-statediff-0.0.28
v1.10.12-statediff-0.0.27
v1.10.11-statediff-0.0.27i
v1.10.11-statediff-0.0.27h
v1.10.11-statediff-0.0.27g
v1.10.11-statediff-0.0.27f
v1.10.11-statediff-0.0.27e
v1.10.13
v1.10.11-statediff-0.0.27d
v1.10.11-statediff-0.0.27c
v1.10.11-statediff-0.0.27b
v1.10.11-statediff-0.0.27a
v1.10.12
v1.10.11-statediff-0.0.27
v1.10.11
v1.10.10-statediff-0.0.27
v1.10.10
v1.10.9-statediff-0.0.27
v1.10.9
v1.10.8-statediff-0.0.27
v1.10.8-statediff-0.0.26
v1.10.8-statediff-0.0.25
v1.10.8
v1.10.7-statediff-0.0.25
v1.10.7
v1.10.6-statediff-0.0.25
v1.10.6
v1.10.5-statediff-0.0.25
v1.10.5
v1.10.4-statediff-0.0.25
v1.10.4-statediff-0.0.24
v1.10.3-statediff-0.0.24
v1.10.4-ir-0.0.1
v1.10.3-statediff-0.0.23
v1.10.4
v1.10.3-statediff-0.0.22
v1.10.3-statediff-0.0.21
v1.10.3
v1.10.2-statediff-0.0.21
v1.10.2-statediff-0.0.20
v1.10.2-statediff-0.0.19
v1.10.2-statediff-0.0.18
v1.10.2-statediff-0.0.17
v1.10.1-statediff-0.0.17
v1.10.2
v1.10.1-statediff-0.0.16
v1.10.1-statediff-0.0.15
v1.10.1
v1.10.0
v1.9.25-statediff-0.0.15
v1.9.25-statediff-0.0.14
v1.9.25-statediff-0.0.13
v1.9.25
v1.9.24-statediff-0.0.13
v1.9.24-statediff-0.0.12
v1.9.24-statediff-0.0.11
v1.9.23-statediff-0.0.11
v1.9.24
v1.9.23-statediff-0.0.10
v1.9.23-statediff-0.0.9
v1.9.11-statediff-0.0.9
v1.9.11-statediff-0.0.8
v1.9.23
v1.9.15-1559-0.0.1
v1.9.11-statediff-0.0.7
v1.9.10-optimism-0.0.2
v1.9.22
v1.9.21
v1.9.10-optimism-0.0.1
v1.9.11-statediff-0.0.6
v1.9.20
v1.9.11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2
v0.8.5
v0.8.4
v0.8.4-1
v0.7.11
v0.7.10
vv0.7.10
v0.7.10-broken
PoC6
v0.6.8
v0.6.7
v0.6.6
v0.6.5-2
v0.6.5-1
v0.6.5
v0.6.4
v0.6.3
v0.6.0
0.5.19
0.5.18
0.5.17
0.5.16
0.5.15
0.5.14
0.5.13
poc5-rc12
poc5-rc11
2
poc5-rc10
poc5-rc9
poc5-rc8
poc5-rc7
poc5-rc6
poc5-rc4
poc5-rc3
poc5-rc2
poc5-rc1
0.3.1
0.3.0
0.2.2
poc1
Labels
Clear labels
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#359
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In v4 the
CopyFrommode usesstrconv.ParseFloatin order to converttransaction.Valueandaccount.Balanceto a format that can be loaded by the binary lib/pq driver using theCopyFromsupport. This doesn't overflow, but it does cause incorrect values to be inserted into the database for very large values ofBalanceandValuedue to loss of precision during the conversion.In v5 I foolishly switched to
strconv.ParseUint, and while this doesn't have precision issues it simply overflows at very largeBalanceandValue.We can't format as a string (the obvious choice) because it results in the below error:
ERROR: insufficient data left in message (SQLSTATE 08P01)This is also telling of a deficiency in our unit tests which is easily addressed by using large account balances in our mock data, will fix this as this missing coverage is entirely on me.
The direct write mode and sql/csv file write mode is unaffected in either version because the string format is used there without issue.
Having trouble chasing down any solution so tried some shots in the dark:
Tried implementing a custom Scanner/Valuer interface for a big.Int e.g.
But this doesn't work, get
SQLSTATE 57014error e.g.ERROR: COPY from stdin failed: cannot convert {{false [1000]}} to Numeric (SQLSTATE 57014)Tried casting the strings to []uint8 but that throws
ERROR: COPY from stdin failed: cannot convert [49 48 48 48] to Numeric (SQLSTATE 57014)Tried checking and ensuring no null/newline characters are present in the string (there aren't), so that didn't fix anything either.
I'm not confident there is a solution using the binary CopyFrom mode used by lib/pq.
This change uses a pgx-compatible Numeric datatype which is backed by a shopspring.Decimal.
https://github.com/cerc-io/go-ethereum/pull/360/commits/d2bfae64eb2d35523a92d27b755806a868a532c0
Thanks for the quick fix on this @telackey !