Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ recover:

.PHONY: ioctl
ioctl:
$(GOBUILD) -ldflags "$(PackageFlags)" -o ./bin/$(BUILD_TARGET_IOCTL) -v ./tools/ioctl
$(GOBUILD) -tags $(BUILD_TAGS) -ldflags "$(PackageFlags)" -o ./bin/$(BUILD_TARGET_IOCTL) -v ./tools/ioctl

.PHONY: newioctl
newioctl:
Expand Down
10 changes: 5 additions & 5 deletions action/protocol/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ func WithFeatureCtx(ctx context.Context) context.Context {
TimestampedStakingContract: g.IsWake(height),
PreStateSystemAction: !g.IsWake(height),
CreatePostActionStates: g.IsWake(height),
NotSlashUnproductiveDelegates: !g.IsToBeEnabled(height),
CandidateBLSPublicKey: g.IsToBeEnabled(height),
NotUseMinSelfStakeToBeActive: !g.IsToBeEnabled(height),
StoreVoteOfNFTBucketIntoView: !g.IsToBeEnabled(height),
NotSlashUnproductiveDelegates: !g.IsXingu(height),
CandidateBLSPublicKey: g.IsXingu(height),
NotUseMinSelfStakeToBeActive: !g.IsXingu(height),
StoreVoteOfNFTBucketIntoView: !g.IsXingu(height),
},
)
}
Expand All @@ -351,7 +351,7 @@ func GetFeatureCtx(ctx context.Context) (FeatureCtx, bool) {
func MustGetFeatureCtx(ctx context.Context) FeatureCtx {
fc, ok := ctx.Value(featureContextKey{}).(FeatureCtx)
if !ok {
log.S().Panic("Miss feature context")
log.L().Panic("Miss feature context")
}
return fc
}
Expand Down
2 changes: 1 addition & 1 deletion action/protocol/execution/evm/evmstatedbadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ func (stateDB *StateDBAdapter) CommitContracts() error {
sort.Slice(contractAddrs, func(i, j int) bool { return bytes.Compare(contractAddrs[i][:], contractAddrs[j][:]) < 0 })

for _, addr := range contractAddrs {
_, err := stateDB.sm.DelState(protocol.KeyOption(addr[:]))
_, err := stateDB.sm.DelState(protocol.KeyOption(addr[:]), protocol.ObjectOption(&state.Account{}))
if stateDB.assertError(err, "failed to delete SelfDestruct account/contract", zap.Error(err), zap.String("address", addr.Hex())) {
return errors.Wrapf(err, "failed to delete SelfDestruct account/contract %x", addr[:])
}
Expand Down
17 changes: 13 additions & 4 deletions action/protocol/managers.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@ func ObjectOption(obj any) StateOption {
}
}

// ErigonStoreOnlyOption sets the option to only read/write from/to erigon store
func ErigonStoreOnlyOption() StateOption {
return func(cfg *StateConfig) error {
cfg.ErigonStoreOnly = true
return nil
}
}

type (
// StateConfig is the config for accessing stateDB
StateConfig struct {
Namespace string // namespace used by state's storage
Key []byte
Keys [][]byte
Object any // object used by state's storage
Namespace string // namespace used by state's storage
Key []byte
Keys [][]byte
Object any // object used by state's storage
ErigonStoreOnly bool // whether only read/write from/to erigon store
}

// StateOption sets parameter for access state
Expand Down
2 changes: 1 addition & 1 deletion action/protocol/rewarding/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func testProtocol(t *testing.T, test func(*testing.T, context.Context, protocol.
g.Rewarding.NumDelegatesForFoundationBonus = 5
g.Rewarding.FoundationBonusLastEpoch = 365
g.Rewarding.ProductivityThreshold = 50
g.ToBeEnabledBlockHeight = slashHeight
g.XinguBlockHeight = slashHeight
// Initialize the protocol
if withExempt {
g.Rewarding.ExemptAddrStrsFromEpochReward = []string{
Expand Down
5 changes: 5 additions & 0 deletions action/protocol/staking/contractstake_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/iotexproject/iotex-address/address"

"github.com/iotexproject/iotex-core/v2/action"
"github.com/iotexproject/iotex-core/v2/action/protocol"
"github.com/iotexproject/iotex-core/v2/action/protocol/staking/contractstaking"
Expand Down Expand Up @@ -64,6 +65,10 @@ type (
LoadStakeView(context.Context, protocol.StateReader) (ContractStakeView, error)
// CreateEventProcessor creates a new event processor
CreateEventProcessor(context.Context, EventHandler) EventProcessor
// ContractStakingBuckets returns all the contract staking buckets
ContractStakingBuckets() (uint64, map[uint64]*contractstaking.Bucket, error)

BucketReader
}
// ContractStakingIndexerWithBucketType defines the interface of contract staking reader with bucket type
ContractStakingIndexerWithBucketType interface {
Expand Down
62 changes: 62 additions & 0 deletions action/protocol/staking/contractstake_indexer_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading