Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain
Commits
a4133845
Commit
a4133845
authored
6 years ago
by
Dmitriy Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] Sharded variant of block's header
parent
62b75944
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_chain_block.h
+17
-3
17 additions, 3 deletions
dap_chain_block.h
with
17 additions
and
3 deletions
dap_chain_block.h
+
17
−
3
View file @
a4133845
...
...
@@ -43,15 +43,29 @@ typedef struct dap_chain_block{
uint32_t
signature
;
/// @param signature @brief Magic number, always equels to DAP_CHAIN_BLOCK_SIGNATURE
int32_t
version
;
/// @param version @brief block version (be carefull, signed value, as Bitcoin has)
uint32_t
size
;
/// @param size of the whole block
dap_chain_hash_t
prev_block
;
/// @param prev_block Hash of the previous block
uint64_t
timestamp
;
/// @param timestamp @brief Block create time timestamp
uint64_t
difficulty
;
/// difficulty level
uint64_t
nonce
;
/// Nonce value to allow header variation for mining
uint64_t
difficulty
;
/// difficulty level
uint64_t
nonce
;
/// Nonce value to allow header variation for mining
union
{
struct
{
// Zero-level block without sharding
dap_chain_hash_t
prev_block
;
/// @param prev_block Hash of the previous block
dap_chain_hash_t
padding0
;
//
uint32_t
padding1
;
//
uint64_t
padding2
;
// Always zero (should be well compresed)
};
struct
{
dap_chain_hash_t
prev_block_0lvl
;
/// @param prev_block Hash of the previous block
dap_chain_hash_t
prev_block_shard
;
/// @param prev_block Hash of the previous block
uint32_t
shard_id
;
// Shard id
uint64_t
nonce2
;
// Second NonCE for block mining inside the shard
}
}
dap_chain_hash_t
root_sections
;
/// @param root_main Main tree's root for all sections's hashes
}
DAP_ALIGN_PACKED
header
;
uint8_t
sections
[];
// Sections
}
DAP_ALIGN_PACKED
dap_chain_block_t
;
dap_chain_block_t
*
dap_chain_block_new
(
dap_chain_hash_t
*
a_prev_block
);
dap_chain_section_t
*
dap_chain_block_create_section
(
dap_chain_block_t
*
a_block
,
uint32_t
a_section_offset
...
...
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