Skip to content

Commit

Permalink
Merge pull request #716 from oasisprotocol/ptrus/feature/oasis-core-v…
Browse files Browse the repository at this point in the history
…24.0

oasis core v24.0
  • Loading branch information
ptrus authored Jun 27, 2024
2 parents bb46907 + 8a41d4e commit 1cf5545
Show file tree
Hide file tree
Showing 102 changed files with 1,666 additions and 176 deletions.
1 change: 1 addition & 0 deletions .changelog/716.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vendor oasis-core v24.0
30 changes: 20 additions & 10 deletions analyzer/consensus/convert_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import (
roothash "github.com/oasisprotocol/nexus/coreapi/v22.2.11/roothash/api"
staking "github.com/oasisprotocol/nexus/coreapi/v22.2.11/staking/api"

beaconEden "github.com/oasisprotocol/nexus/coreapi/v23.0/beacon/api"
consensusEden "github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api"
governanceEden "github.com/oasisprotocol/nexus/coreapi/v23.0/governance/api"
keymanagerEden "github.com/oasisprotocol/nexus/coreapi/v23.0/keymanager/api"
registryEden "github.com/oasisprotocol/nexus/coreapi/v23.0/registry/api"
roothashEden "github.com/oasisprotocol/nexus/coreapi/v23.0/roothash/api"
stakingEden "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
beaconEden "github.com/oasisprotocol/nexus/coreapi/v24.0/beacon/api"
consensusEden "github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api"
governanceEden "github.com/oasisprotocol/nexus/coreapi/v24.0/governance/api"
keymanagerChurpEden "github.com/oasisprotocol/nexus/coreapi/v24.0/keymanager/churp"
keymanagerSecretsEden "github.com/oasisprotocol/nexus/coreapi/v24.0/keymanager/secrets"
registryEden "github.com/oasisprotocol/nexus/coreapi/v24.0/registry/api"
roothashEden "github.com/oasisprotocol/nexus/coreapi/v24.0/roothash/api"
stakingEden "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
vaultEden "github.com/oasisprotocol/nexus/coreapi/v24.0/vault/api"
)

var bodyTypeForTxMethodCobalt = map[string]interface{}{
Expand Down Expand Up @@ -80,9 +82,9 @@ var bodyTypeForTxMethodEden = map[string]interface{}{
"consensus.Meta": consensusEden.BlockMetadata{},
"governance.SubmitProposal": governanceEden.ProposalContent{},
"governance.CastVote": governanceEden.ProposalVote{},
"keymanager.PublishMasterSecret": keymanagerEden.SignedEncryptedMasterSecret{},
"keymanager.PublishEphemeralSecret": keymanagerEden.SignedEncryptedEphemeralSecret{},
"keymanager.UpdatePolicy": keymanagerEden.SignedPolicySGX{},
"keymanager.PublishMasterSecret": keymanagerSecretsEden.SignedEncryptedMasterSecret{},
"keymanager.PublishEphemeralSecret": keymanagerSecretsEden.SignedEncryptedEphemeralSecret{},
"keymanager.UpdatePolicy": keymanagerSecretsEden.SignedPolicySGX{},
"registry.RegisterEntity": entity.SignedEntity{},
"registry.DeregisterEntity": registryEden.DeregisterEntity{},
"registry.RegisterNode": node.MultiSignedNode{},
Expand All @@ -99,6 +101,14 @@ var bodyTypeForTxMethodEden = map[string]interface{}{
"staking.AmendCommissionSchedule": stakingEden.AmendCommissionSchedule{},
"staking.Allow": stakingEden.Allow{},
"staking.Withdraw": stakingEden.Withdraw{},
// Added in v24.0.
"keymanager/churp.Apply": keymanagerChurpEden.ApplicationRequest{},
"keymanager/churp.Confirm": keymanagerChurpEden.ConfirmationRequest{},
"keymanager/churp.Create": keymanagerChurpEden.CreateRequest{},
"keymanager/churp.Update": keymanagerChurpEden.UpdateRequest{},
"vault.AuthorizeAction": vaultEden.AuthorizeAction{},
"vault.CancelAction": vaultEden.CancelAction{},
"vault.Create": vaultEden.Create{},
}

type freshnessProofEden struct {
Expand Down
8 changes: 8 additions & 0 deletions api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,14 @@ components:
- staking.ReclaimEscrow
- staking.Transfer
- staking.Withdraw
# Added in v24.0.
- keymanager/churp.Apply
- keymanager/churp.Confirm
- keymanager/churp.Create
- keymanager/churp.Update
- vault.AuthorizeAction
- vault.CancelAction
- vault.Create
example: staking.Transfer

TransactionList:
Expand Down
2 changes: 1 addition & 1 deletion cmd/bisect/data_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/oasisprotocol/nexus/storage/oasis/nodeapi/history"
"github.com/oasisprotocol/nexus/storage/postgres"

staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
)

// Returns number of shares delegated by `delegator` to `delegatee` at `height`.
Expand Down
2 changes: 1 addition & 1 deletion cmd/bisect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/oasisprotocol/nexus/storage/oasis/nodeapi/history"
"github.com/oasisprotocol/nexus/storage/postgres"

staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
)

var logger = log.NewDefaultLogger("cmd/bisect")
Expand Down
7 changes: 0 additions & 7 deletions coreapi/v23.0/staking/api/address.go

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package api

import (
"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"

"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction"
)

// GasOpVRFProve is the gas operation identifier for VRF proof submission.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,22 @@ type CapabilityTEE struct {
// Verify verifies the node's TEE capabilities, at the provided timestamp and height.
// removed func

// EndorseCapabilityTEESignatureContext is the signature context used for TEE capability endorsement.
// removed var statement

// EndorsedCapabilityTEE is the endorsed CapabilityTEE structure.
//
// Endorsement is needed for off-chain runtime components where their RAK is not published in the
// consensus layer and verification is part of the runtime itself. Via endorsement one can enforce
// policies like "only components executed by the current compute committee are authorized".
type EndorsedCapabilityTEE struct {
// CapabilityTEE is the TEE capability structure to be endorsed.
CapabilityTEE CapabilityTEE `json:"capability_tee"`

// NodeEndorsement is the node endorsement signature.
NodeEndorsement signature.Signature `json:"node_endorsement"`
}

// String returns a string representation of itself.
func (n *Node) String() string {
return "<Node id=" + n.ID.String() + ">"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ import (
"strings"
"time"

beacon "github.com/oasisprotocol/nexus/coreapi/v24.0/beacon/api"
"github.com/oasisprotocol/nexus/coreapi/v24.0/common/node"
"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction"
"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction/results"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
"github.com/oasisprotocol/oasis-core/go/common/cbor"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
"github.com/oasisprotocol/oasis-core/go/common/version"
mkvsNode "github.com/oasisprotocol/oasis-core/go/storage/mkvs/node"

beacon "github.com/oasisprotocol/nexus/coreapi/v23.0/beacon/api"
"github.com/oasisprotocol/nexus/coreapi/v23.0/common/node"
"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction"
"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction/results"
staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
)

const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package events

import (
"sync"
)

// eventSeparator is the separator used to separate module from event name.
const eventSeparator = "."

// registeredEvents stores registered event names.
var registeredEvents sync.Map

// NewEventName creates a new event name.
//
// Module and event must be unique. If they are not, this method will panic.
// removed func

// Provable is an interface implemented by event types which can be proven.
// removed interface

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,7 @@ type stateReadSync struct {

// removed func

// removed func

// NewConsensusClient creates a new gRPC consensus client service.
// removed func
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package api
import (
"time"

"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/genesis"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"

"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/genesis"
)

// LightService is a consensus light client service.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package api

import (
"time"

"github.com/oasisprotocol/oasis-core/go/common/quantity"
)

const (
Expand All @@ -14,22 +12,9 @@ const (
// PriceDiscovery is the consensus fee price discovery interface.
// removed interface

type staticPriceDiscovery struct {
price quantity.Quantity
}

// NewStaticPriceDiscovery creates a price discovery mechanism which always returns the same static
// price specified at construction time.
// removed func

// removed func

type noOpPriceDiscovery struct{}

// removed func

// SubmissionManager is a transaction submission manager interface.
// removed interface

// removed type

// Implements SubmissionManager.
Expand Down Expand Up @@ -75,6 +60,10 @@ type noOpPriceDiscovery struct{}
// estimation and current gas price discovery.
// removed func

type noOpPriceDiscovery struct{}

// removed func

// NoOpSubmissionManager implements a submission manager that doesn't support submitting transactions.
type NoOpSubmissionManager struct{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package results

import (
governance "github.com/oasisprotocol/nexus/coreapi/v23.0/governance/api"
registry "github.com/oasisprotocol/nexus/coreapi/v23.0/registry/api"
roothash "github.com/oasisprotocol/nexus/coreapi/v23.0/roothash/api"
staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
governance "github.com/oasisprotocol/nexus/coreapi/v24.0/governance/api"
registry "github.com/oasisprotocol/nexus/coreapi/v24.0/registry/api"
roothash "github.com/oasisprotocol/nexus/coreapi/v24.0/roothash/api"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
)

// Event is a consensus service event that may be emitted during processing of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package testvectors

import (
"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"

"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction"
)

const keySeedPrefix = "oasis-core test vectors: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ package genesis
import (
"time"

"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"

"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction"
)

// Genesis contains various consensus config flags that should be part of the genesis state.
Expand All @@ -26,6 +25,9 @@ type Parameters struct { // nolint: maligned
MaxBlockGas transaction.Gas `json:"max_block_gas"`
MaxEvidenceSize uint64 `json:"max_evidence_size"`

// MinGasPrice is the minimum gas price.
MinGasPrice uint64 `json:"min_gas_price,omitempty"`

// StateCheckpointInterval is the expected state checkpoint interval (in blocks).
StateCheckpointInterval uint64 `json:"state_checkpoint_interval"`
// StateCheckpointNumKept is the expected minimum number of state checkpoints to keep.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ package api
import (
"time"

beacon "github.com/oasisprotocol/nexus/coreapi/v24.0/beacon/api"
consensus "github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/genesis"
governance "github.com/oasisprotocol/nexus/coreapi/v24.0/governance/api"
keymanager "github.com/oasisprotocol/nexus/coreapi/v24.0/keymanager/api"
registry "github.com/oasisprotocol/nexus/coreapi/v24.0/registry/api"
roothash "github.com/oasisprotocol/nexus/coreapi/v24.0/roothash/api"
scheduler "github.com/oasisprotocol/nexus/coreapi/v24.0/scheduler/api"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
vault "github.com/oasisprotocol/nexus/coreapi/v24.0/vault/api"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"

beacon "github.com/oasisprotocol/nexus/coreapi/v23.0/beacon/api"
consensus "github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/genesis"
governance "github.com/oasisprotocol/nexus/coreapi/v23.0/governance/api"
keymanager "github.com/oasisprotocol/nexus/coreapi/v23.0/keymanager/api"
registry "github.com/oasisprotocol/nexus/coreapi/v23.0/registry/api"
roothash "github.com/oasisprotocol/nexus/coreapi/v23.0/roothash/api"
scheduler "github.com/oasisprotocol/nexus/coreapi/v23.0/scheduler/api"
staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
)

const filePerm = 0o600
Expand All @@ -40,6 +40,8 @@ type Document struct {
Beacon beacon.Genesis `json:"beacon"`
// Governance is the governance genesis state.
Governance governance.Genesis `json:"governance"`
// Vault is the optional vault genesis state.
Vault *vault.Genesis `json:"vault,omitempty"`
// Consensus is the consensus genesis state.
Consensus consensus.Genesis `json:"consensus"`
// Extra data is arbitrary extra data that is part of the
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,25 @@
package api

import (
beacon "github.com/oasisprotocol/nexus/coreapi/v24.0/beacon/api"
"github.com/oasisprotocol/nexus/coreapi/v24.0/consensus/api/transaction"
staking "github.com/oasisprotocol/nexus/coreapi/v24.0/staking/api"
upgrade "github.com/oasisprotocol/nexus/coreapi/v24.0/upgrade/api"
"github.com/oasisprotocol/oasis-core/go/common/cbor"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
"github.com/oasisprotocol/oasis-core/go/common/quantity"

beacon "github.com/oasisprotocol/nexus/coreapi/v23.0/beacon/api"
"github.com/oasisprotocol/nexus/coreapi/v23.0/consensus/api/transaction"
staking "github.com/oasisprotocol/nexus/coreapi/v23.0/staking/api"
upgrade "github.com/oasisprotocol/nexus/coreapi/v23.0/upgrade/api"
)

// ModuleName is a unique module name for the governance backend.
const ModuleName = "governance"

// ProposalContentInvalidText is the textual representation of an invalid
// ProposalContent.
const ProposalContentInvalidText = "(invalid)"

// removed var block

// ProposalContent is a consensus layer governance proposal content.
type ProposalContent struct {
// Metadata contains optional proposal metadata which is ignored during proposal execution.
Metadata *ProposalMetadata `json:"metadata,omitempty"`

Upgrade *UpgradeProposal `json:"upgrade,omitempty"`
CancelUpgrade *CancelUpgradeProposal `json:"cancel_upgrade,omitempty"`
ChangeParameters *ChangeParametersProposal `json:"change_parameters,omitempty"`
Expand All @@ -45,6 +43,30 @@ type ProposalContent struct {
// pretty printing.
// removed func

const (
// MinProposalTitleLength is the minimum length of a proposal's title.
MinProposalTitleLength = 3
// MaxProposalTitleLength is the maximum length of a proposal's title.
MaxProposalTitleLength = 100
)

// ProposalMetadata contains metadata about a proposal.
type ProposalMetadata struct {
// Title is the human-readable proposal title.
Title string `json:"title"`
// Description is the human-readable description.
Description string `json:"description,omitempty"`
}

// ValidateBasic performs basic proposal metadata validity checks.
// removed func

// PrettyPrint writes a pretty-printed representation of ProposalMetadata to the given writer.
// removed func

// PrettyType returns a representation of ProposalMetadata that can be used for pretty printing.
// removed func

// UpgradeProposal is an upgrade proposal.
type UpgradeProposal struct {
upgrade.Descriptor
Expand Down Expand Up @@ -175,6 +197,12 @@ type ConsensusParameters struct {

// EnableChangeParametersProposal is true iff change parameters proposals are allowed.
EnableChangeParametersProposal bool `json:"enable_change_parameters_proposal,omitempty"`

// AllowVoteWithoutEntity is true iff casting votes without a registered entity is allowed.
AllowVoteWithoutEntity bool `json:"allow_vote_without_entity,omitempty"`

// AllowProposalMetadata is true iff proposals are allowed to contain metadata.
AllowProposalMetadata bool `json:"allow_proposal_metadata,omitempty"`
}

// ConsensusParameterChanges are allowed governance consensus parameter changes.
Expand Down
File renamed without changes.
Loading

0 comments on commit 1cf5545

Please sign in to comment.