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
14ffde83
Unverified
Commit
14ffde83
authored
Feb 17, 2020
by
Jaynti Kanani
Committed by
GitHub
Feb 17, 2020
Browse files
Options
Downloads
Plain Diff
Merge pull request #20 from maticnetwork/develop
Develop
parents
67260a71
1fc442e5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
consensus/bor/bor.go
+20
-0
20 additions, 0 deletions
consensus/bor/bor.go
consensus/bor/clerk.go
+1
-0
1 addition, 0 deletions
consensus/bor/clerk.go
with
21 additions
and
0 deletions
consensus/bor/bor.go
+
20
−
0
View file @
14ffde83
...
...
@@ -1048,6 +1048,15 @@ func (c *Bor) commitSpan(
return
err
}
// check if chain id matches with heimdall span
if
heimdallSpan
.
ChainID
!=
c
.
chainConfig
.
ChainID
.
String
()
{
return
fmt
.
Errorf
(
"Chain id proposed span, %s, and bor chain id, %s, doesn't match"
,
heimdallSpan
.
ChainID
,
c
.
chainConfig
.
ChainID
,
)
}
// get validators bytes
var
validators
[]
MinimalVal
for
_
,
val
:=
range
heimdallSpan
.
ValidatorSet
.
Validators
{
...
...
@@ -1167,11 +1176,22 @@ func (c *Bor) CommitStates(
if
err
:=
json
.
Unmarshal
(
response
.
Result
,
&
eventRecord
);
err
!=
nil
{
return
err
}
// check if chain id matches with event record
if
eventRecord
.
ChainID
!=
""
&&
eventRecord
.
ChainID
!=
c
.
chainConfig
.
ChainID
.
String
()
{
return
fmt
.
Errorf
(
"Chain id proposed state in span, %s, and bor chain id, %s, doesn't match"
,
eventRecord
.
ChainID
,
c
.
chainConfig
.
ChainID
,
)
}
log
.
Info
(
"→ committing new state"
,
"id"
,
eventRecord
.
ID
,
"contract"
,
eventRecord
.
Contract
,
"data"
,
hex
.
EncodeToString
(
eventRecord
.
Data
),
"txHash"
,
eventRecord
.
TxHash
,
"chainID"
,
eventRecord
.
ChainID
,
)
recordBytes
,
err
:=
rlp
.
EncodeToBytes
(
eventRecord
)
...
...
This diff is collapsed.
Click to expand it.
consensus/bor/clerk.go
+
1
−
0
View file @
14ffde83
...
...
@@ -12,4 +12,5 @@ type EventRecord struct {
Data
hexutil
.
Bytes
`json:"data" yaml:"data"`
TxHash
common
.
Hash
`json:"tx_hash" yaml:"tx_hash"`
LogIndex
uint64
`json:"log_index" yaml:"log_index"`
ChainID
string
`json:"bor_chain_id" yaml:"bor_chain_id"`
}
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