Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
934cd0a7
Commit
934cd0a7
authored
Dec 06, 2021
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
fbdd7d9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
ticket.go
plugin/dapp/ticket/executor/ticket.go
+1
-1
ticketdb.go
plugin/dapp/ticket/executor/ticketdb.go
+1
-1
kvmvcc_mavl.go
plugin/store/kvmvccmavl/kvmvcc_mavl.go
+3
-3
kvmvccdb.go
plugin/store/kvmvccmavl/kvmvccdb.go
+4
-4
No files found.
plugin/dapp/ticket/executor/ticket.go
View file @
934cd0a7
...
...
@@ -198,7 +198,7 @@ func (t *Ticket) CheckReceiptExecOk() bool {
// 自定义接口,用于删除不再需要保存的kv
// 比如 ticket 已经 close 之后就废弃了,可以删除
func
expiredKVChecker
(
key
,
value
[]
byte
)
bool
{
func
expiredKVChecker
(
key
,
value
[]
byte
)
bool
{
// 由于 ticketBindKeyPrefix 包含了 ticketKeyPrefix,所以需要多做一次检查
if
bytes
.
HasPrefix
(
key
,
ticketBindKeyPrefix
)
{
return
false
...
...
plugin/dapp/ticket/executor/ticketdb.go
View file @
934cd0a7
...
...
@@ -30,7 +30,7 @@ var tlog = log.New("module", "ticket.db")
//var addrSeed = []byte("address seed bytes for public key")
var
(
ticketKeyPrefix
=
[]
byte
(
"mavl-ticket-"
)
ticketKeyPrefix
=
[]
byte
(
"mavl-ticket-"
)
ticketBindKeyPrefix
=
[]
byte
(
"mavl-ticket-tbind-"
)
)
...
...
plugin/store/kvmvccmavl/kvmvcc_mavl.go
View file @
934cd0a7
...
...
@@ -81,9 +81,9 @@ type KVmMavlStore struct {
type
subKVMVCCConfig
struct
{
EnableMVCCIter
bool
`json:"enableMVCCIter"`
EnableMVCCPrune
bool
`json:"enableMVCCPrune"`
PruneHeight
int32
`json:"pruneHeight"`
//每PruneHeight高度做一次状态精简
PruneHeight
int32
`json:"pruneHeight"`
//每PruneHeight高度做一次状态精简
EnableEmptyBlockHandle
bool
`json:"enableEmptyBlockHandle"`
ReservedHeight
int64
`json:"reservedHeight"`
//保留最新的ReservedHeight个区块的状态数据
ReservedHeight
int64
`json:"reservedHeight"`
//保留最新的ReservedHeight个区块的状态数据
}
type
subMavlConfig
struct
{
...
...
@@ -116,7 +116,7 @@ type subConfig struct {
// 使能空块处理
EnableEmptyBlockHandle
bool
`json:"enableEmptyBlockHandle"`
//保留的状态数据的高度
ReservedHeight
int64
`json:"reservedHeight"`
ReservedHeight
int64
`json:"reservedHeight"`
}
// New construct KVMVCCStore module
...
...
plugin/store/kvmvccmavl/kvmvccdb.go
View file @
934cd0a7
...
...
@@ -32,8 +32,8 @@ var (
var
(
//同common/db中的mvcc相关的定义保持一致
mvccPrefix
=
[]
byte
(
".-mvcc-."
)
mvccMeta
=
append
(
mvccPrefix
,
[]
byte
(
"m."
)
...
)
mvccData
=
append
(
mvccPrefix
,
[]
byte
(
"d."
)
...
)
mvccMeta
=
append
(
mvccPrefix
,
[]
byte
(
"m."
)
...
)
mvccData
=
append
(
mvccPrefix
,
[]
byte
(
"d."
)
...
)
//mvccLast = append(mvccPrefix, []byte("l.")...)
mvccMetaVersion
=
append
(
mvccMeta
,
[]
byte
(
"version."
)
...
)
mvccMetaVersionKeyList
=
append
(
mvccMeta
,
[]
byte
(
"versionkl."
)
...
)
...
...
@@ -130,7 +130,7 @@ func (mvccs *KVMVCCStore) MemSet(datas *types.StoreSet, hash []byte, sync bool)
mvccs
.
sync
=
sync
// 进行裁剪
if
mvccs
.
kvmvccCfg
!=
nil
&&
mvccs
.
kvmvccCfg
.
EnableMVCCPrune
&&
!
isPruning
()
&&
datas
.
Height
%
int64
(
mvccs
.
kvmvccCfg
.
PruneHeight
)
==
0
{
!
isPruning
()
&&
datas
.
Height
%
int64
(
mvccs
.
kvmvccCfg
.
PruneHeight
)
==
0
{
wg
.
Add
(
1
)
go
mvccs
.
pruningMVCC
(
datas
.
Height
)
}
...
...
@@ -500,7 +500,7 @@ func pruneDapp(db dbm.DB, name string, safeHeight int64) {
}
var
prefix
[]
byte
prefix
=
append
(
prefix
,
mvccData
...
)
prefix
=
append
(
prefix
,
"mavl-"
+
name
...
)
prefix
=
append
(
prefix
,
"mavl-"
+
name
...
)
it
:=
db
.
Iterator
(
prefix
,
nil
,
true
)
defer
it
.
Close
()
for
it
.
Rewind
();
it
.
Valid
();
it
.
Next
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment