aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-11-20 14:13:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f (patch)
treedaec41863b9d4ecaa8bf8b48e9ac4c714ce3df82 /core
parenta3dcb5a40697f0383f0ddcd6eab79cf4125aaf2a (diff)
downloaddexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar.gz
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar.bz2
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar.lz
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar.xz
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.tar.zst
dexon-3e593e8e2cde4dcaef4e96f1e337272b9d8cbe4f.zip
dex: implement downloader for dex
We need governance state to verify block's signature (randomness), but in ethereum fast sync mode, eth downloader only downloads the whole state of pivot block, so we don't have governance state to verify the downloaded block that is before pivot block if we don't processing transaction. To avoid running transactions, dex downloader also downloads the governance state (merkle proof and storage) at snapshot height of each round, so that we can verify blocks in fast sync mode.
Diffstat (limited to 'core')
-rw-r--r--core/types/govstate.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/types/govstate.go b/core/types/govstate.go
index 75f77cb0d..2c3dff933 100644
--- a/core/types/govstate.go
+++ b/core/types/govstate.go
@@ -13,3 +13,8 @@ type GovState struct {
Proof [][]byte
Storage [][2][]byte
}
+
+type HeaderWithGovState struct {
+ *Header
+ GovState *GovState `rlp:"nil"`
+}