• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版02c921a590c5d1828fc019ad230aea5ed1cc5b84 (tree)
时间2019-06-19 11:11:16
作者mars <mars@byto...>
Commitermars

Log Message

fix review

更改概述

差异

--- a/blockchain/txbuilder/actions.go
+++ b/blockchain/txbuilder/actions.go
@@ -290,8 +290,7 @@ func (a *crossInAction) Build(ctx context.Context, builder *TemplateBuilder) err
290290 }
291291
292292 // arguments will be set when materializeWitnesses
293- fedProg := config.FederationProgrom(config.CommonConfig)
294- txin := types.NewCrossChainInput(nil, a.SourceID, *a.AssetId, a.Amount, a.SourcePos, a.VMVersion, fedProg, a.RawDefinitionByte, a.IssuanceProgram)
293+ txin := types.NewCrossChainInput(nil, a.SourceID, *a.AssetId, a.Amount, a.SourcePos, a.VMVersion, a.RawDefinitionByte, a.IssuanceProgram)
295294 tplIn := &SigningInstruction{}
296295 fed := config.CommonConfig.Federation
297296 tplIn.AddRawWitnessKeys(fed.Xpubs, nil, fed.Quorum)
--- a/protocol/bc/bc.pb.go
+++ b/protocol/bc/bc.pb.go
@@ -696,9 +696,9 @@ type CrossChainInput struct {
696696 Value *AssetAmount `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
697697 WitnessDestination *ValueDestination `protobuf:"bytes,3,opt,name=witness_destination,json=witnessDestination" json:"witness_destination,omitempty"`
698698 ControlProgram *Program `protobuf:"bytes,4,opt,name=control_program,json=controlProgram" json:"control_program,omitempty"`
699- WitnessArguments [][]byte `protobuf:"bytes,5,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"`
700- Ordinal uint64 `protobuf:"varint,6,opt,name=ordinal" json:"ordinal,omitempty"`
701- AssetDefinition *AssetDefinition `protobuf:"bytes,7,opt,name=asset_definition,json=assetDefinition" json:"asset_definition,omitempty"`
699+ AssetDefinition *AssetDefinition `protobuf:"bytes,5,opt,name=asset_definition,json=assetDefinition" json:"asset_definition,omitempty"`
700+ WitnessArguments [][]byte `protobuf:"bytes,6,rep,name=witness_arguments,json=witnessArguments,proto3" json:"witness_arguments,omitempty"`
701+ Ordinal uint64 `protobuf:"varint,7,opt,name=ordinal" json:"ordinal,omitempty"`
702702 }
703703
704704 func (m *CrossChainInput) Reset() { *m = CrossChainInput{} }
@@ -734,6 +734,13 @@ func (m *CrossChainInput) GetControlProgram() *Program {
734734 return nil
735735 }
736736
737+func (m *CrossChainInput) GetAssetDefinition() *AssetDefinition {
738+ if m != nil {
739+ return m.AssetDefinition
740+ }
741+ return nil
742+}
743+
737744 func (m *CrossChainInput) GetWitnessArguments() [][]byte {
738745 if m != nil {
739746 return m.WitnessArguments
@@ -748,13 +755,6 @@ func (m *CrossChainInput) GetOrdinal() uint64 {
748755 return 0
749756 }
750757
751-func (m *CrossChainInput) GetAssetDefinition() *AssetDefinition {
752- if m != nil {
753- return m.AssetDefinition
754- }
755- return nil
756-}
757-
758758 func init() {
759759 proto.RegisterType((*Hash)(nil), "bc.Hash")
760760 proto.RegisterType((*Program)(nil), "bc.Program")
@@ -781,65 +781,65 @@ func init() {
781781 func init() { proto.RegisterFile("bc.proto", fileDescriptor0) }
782782
783783 var fileDescriptor0 = []byte{
784- // 958 bytes of a gzipped FileDescriptorProto
785- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x5f, 0x6f, 0x23, 0x35,
786- 0x10, 0x57, 0x36, 0xdb, 0x24, 0x9d, 0xf4, 0x9a, 0xc4, 0xbd, 0x83, 0xd5, 0xe9, 0x10, 0xd5, 0x4a,
787- 0x47, 0x0f, 0x21, 0x55, 0xfd, 0x73, 0xfc, 0x79, 0x40, 0x88, 0xd2, 0x72, 0x5c, 0x1e, 0x4e, 0x87,
788- 0xdc, 0x2a, 0xaf, 0x2b, 0x67, 0xd7, 0x49, 0x2c, 0x92, 0x75, 0xb0, 0xbd, 0xa1, 0xd7, 0xaf, 0xc0,
789- 0x33, 0x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x90, 0x0b, 0x00, 0x00,
784+ // 960 bytes of a gzipped FileDescriptorProto
785+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4d, 0x6f, 0x1b, 0x37,
786+ 0x13, 0x86, 0x56, 0x6b, 0x49, 0x1e, 0x39, 0x96, 0x44, 0x27, 0xef, 0xbb, 0x08, 0x52, 0xd4, 0x58,
787+ 0x20, 0x75, 0x8a, 0x02, 0x86, 0x3f, 0xd2, 0x8f, 0x43, 0x51, 0xd4, 0xb5, 0x9b, 0x46, 0x87, 0x20,
788+ 0x05, 0x6d, 0xe8, 0xba, 0xa0, 0x76, 0x29, 0x89, 0xa8, 0xb4, 0x54, 0x49, 0xae, 0xea, 0xf8, 0x2f,
789+ 0xf4, 0xdc, 0x43, 0x7f, 0x51, 0x0f, 0x45, 0xff, 0x4e, 0xaf, 0x2d, 0x38, 0xcb, 0x95, 0x56, 0x1f,
790+ 0xb6, 0x13, 0x14, 0x45, 0xdb, 0xdb, 0xce, 0x70, 0xf8, 0xcc, 0x33, 0x0f, 0x67, 0xb8, 0x84, 0x46,
791+ 0x3f, 0x3e, 0x9c, 0x2a, 0x69, 0x24, 0xf1, 0xfa, 0x71, 0xf8, 0x02, 0xfc, 0x97, 0x4c, 0x8f, 0xc8,
792+ 0x2e, 0x78, 0xb3, 0xa3, 0xa0, 0xb2, 0x5f, 0x79, 0x56, 0xa3, 0xde, 0xec, 0x08, 0xed, 0xe3, 0xc0,
793+ 0x73, 0xf6, 0x31, 0xda, 0x27, 0x41, 0xd5, 0xd9, 0x27, 0x68, 0x9f, 0x06, 0xbe, 0xb3, 0x4f, 0xc3,
794+ 0xcf, 0xa1, 0xfe, 0xad, 0x92, 0x43, 0xc5, 0x26, 0xe4, 0x3d, 0x80, 0xd9, 0x24, 0x9a, 0x71, 0xa5,
795+ 0x85, 0x4c, 0x11, 0xd2, 0xa7, 0xdb, 0xb3, 0x49, 0x2f, 0x77, 0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x46, 0x22, 0x3f, 0xee, 0xcf,
840+ 0x60, 0x6f, 0xc2, 0x44, 0x1a, 0x5b, 0xcf, 0x1d, 0x75, 0x75, 0xe6, 0x41, 0xf3, 0xda, 0xde, 0xf2,
841+ 0x9d, 0x70, 0x8b, 0x04, 0xd5, 0x77, 0x94, 0x60, 0xc3, 0x20, 0xf8, 0xf7, 0x0f, 0xc2, 0x17, 0xd0,
842+ 0xce, 0x9f, 0x84, 0xc9, 0xfc, 0x4d, 0xe7, 0xfe, 0xf8, 0x7b, 0x73, 0xba, 0x8b, 0xe7, 0x1e, 0x6d,
843+ 0xb1, 0x95, 0xf7, 0xdf, 0x46, 0xe1, 0x6b, 0xf7, 0x0b, 0x5f, 0x5f, 0x12, 0xbe, 0x5f, 0xc3, 0x47,
844+ 0xf8, 0xe9, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x1b, 0x9e, 0x47, 0x90, 0x0b, 0x00, 0x00,
845845 }
--- a/protocol/bc/bc.proto
+++ b/protocol/bc/bc.proto
@@ -130,7 +130,7 @@ message CrossChainInput {
130130 AssetAmount value = 2;
131131 ValueDestination witness_destination = 3;
132132 Program control_program = 4;
133- repeated bytes witness_arguments = 5;
134- uint64 ordinal = 6;
135- AssetDefinition asset_definition = 7;
133+ AssetDefinition asset_definition = 5;
134+ repeated bytes witness_arguments = 6;
135+ uint64 ordinal = 7;
136136 }
--- a/protocol/bc/types/crosschain_input.go
+++ b/protocol/bc/types/crosschain_input.go
@@ -18,7 +18,7 @@ type CrossChainInput struct {
1818 // NewCrossChainInput create a new CrossChainInput struct.
1919 // The source is created/issued by trusted federation and hence there is no need
2020 // to refer to it.
21-func NewCrossChainInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID, amount, sourcePos, vmVersion uint64, controlProgram, assetDefinition, issuanceProgram []byte) *TxInput {
21+func NewCrossChainInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID, amount, sourcePos, vmVersion uint64, assetDefinition, issuanceProgram []byte) *TxInput {
2222 sc := SpendCommitment{
2323 AssetAmount: bc.AssetAmount{
2424 AssetId: &assetID,
@@ -27,7 +27,6 @@ func NewCrossChainInput(arguments [][]byte, sourceID bc.Hash, assetID bc.AssetID
2727 SourceID: sourceID,
2828 SourcePosition: sourcePos,
2929 VMVersion: 1,
30- ControlProgram: controlProgram,
3130 }
3231 return &TxInput{
3332 AssetVersion: 1,
--- a/protocol/bc/types/map.go
+++ b/protocol/bc/types/map.go
@@ -141,7 +141,6 @@ func mapTx(tx *TxData) (headerID bc.Hash, hdr *bc.TxHeader, entryMap map[bc.Hash
141141 vetoInputs = append(vetoInputs, vetoInput)
142142
143143 case *CrossChainInput:
144- // TODO: fed peg script
145144 prog := &bc.Program{VmVersion: inp.VMVersion, Code: inp.ControlProgram}
146145 src := &bc.ValueSource{
147146 Ref: &inp.SourceID,
--- a/protocol/bc/types/txinput_test.go
+++ b/protocol/bc/types/txinput_test.go
@@ -72,20 +72,19 @@ func TestSerializationCrossIn(t *testing.T) {
7272 []byte("arguments2"),
7373 }
7474
75- crossIn := NewCrossChainInput(arguments, testutil.MustDecodeHash("fad5195a0c8e3b590b86a3c0a95e7529565888508aecca96e9aeda633002f409"), testutil.MustDecodeAsset("fe9791d71b67ee62515e08723c061b5ccb952a80d804417c8aeedf7f633c524a"), 254354, 3, 1, []byte("crossInProgram"), []byte("whatever"), []byte("IssuanceProgram"))
75+ crossIn := NewCrossChainInput(arguments, testutil.MustDecodeHash("fad5195a0c8e3b590b86a3c0a95e7529565888508aecca96e9aeda633002f409"), testutil.MustDecodeAsset("fe9791d71b67ee62515e08723c061b5ccb952a80d804417c8aeedf7f633c524a"), 254354, 3, 1, []byte("whatever"), []byte("IssuanceProgram"))
7676
7777 wantHex := strings.Join([]string{
7878 "01", // asset version
79- "56", // input commitment length
79+ "48", // input commitment length
8080 "00", // cross-chain input type flag
81- "54", // cross-chain input commitment length
81+ "46", // cross-chain input commitment length
8282 "fad5195a0c8e3b590b86a3c0a95e7529565888508aecca96e9aeda633002f409", // source id
8383 "fe9791d71b67ee62515e08723c061b5ccb952a80d804417c8aeedf7f633c524a", // assetID
8484 "92c30f", // amount
8585 "03", // source position
8686 "01", // vm version
87- "0e", // spend program length
88- "63726f7373496e50726f6772616d", // spend program
87+ "00", // spend program length
8988 "31", // witness length
9089 "02", // argument array length
9190 "0a", // first argument length
--- a/protocol/validation/tx.go
+++ b/protocol/validation/tx.go
@@ -254,7 +254,7 @@ func checkValid(vs *validationState, e bc.Entry) (err error) {
254254 if *e.Value.AssetId != *consensus.BTMAssetID && *e.Value.AssetId != assetID {
255255 return errors.New("incorrect asset_id while check CrossChainInput")
256256 }
257-
257+ e.ControlProgram.Code = config.FederationProgrom(config.CommonConfig)
258258 _, err := vm.Verify(NewTxVMContext(vs, e, e.ControlProgram, e.WitnessArguments), consensus.DefaultGasCredit)
259259 if err != nil {
260260 return errors.Wrap(err, "checking cross-chain input control program")
--- a/wallet/utxo_test.go
+++ b/wallet/utxo_test.go
@@ -671,8 +671,8 @@ func TestTxOutToUtxos(t *testing.T) {
671671 {
672672 tx: types.NewTx(types.TxData{
673673 Inputs: []*types.TxInput{
674- types.NewCrossChainInput([][]byte{}, bc.Hash{V0: 1}, bc.AssetID{V0: 1}, 5, 1, 1, []byte{0x51}, []byte("asset1"), []byte("IssuanceProgram")),
675- types.NewCrossChainInput([][]byte{}, bc.Hash{V0: 2}, *consensus.BTMAssetID, 7, 1, 1, []byte{0x51}, []byte("assetbtm"), []byte("IssuanceProgram"))},
674+ types.NewCrossChainInput([][]byte{}, bc.Hash{V0: 1}, bc.AssetID{V0: 1}, 5, 1, 1, []byte("asset1"), []byte("IssuanceProgram")),
675+ types.NewCrossChainInput([][]byte{}, bc.Hash{V0: 2}, *consensus.BTMAssetID, 7, 1, 1, []byte("assetbtm"), []byte("IssuanceProgram"))},
676676 Outputs: []*types.TxOutput{
677677 types.NewIntraChainOutput(bc.AssetID{V0: 1}, 2, []byte{0x51}),
678678 types.NewIntraChainOutput(bc.AssetID{V0: 1}, 3, []byte{0x52}),
@@ -684,35 +684,35 @@ func TestTxOutToUtxos(t *testing.T) {
684684 blockHeight: 0,
685685 wantUtxos: []*account.UTXO{
686686 &account.UTXO{
687- OutputID: bc.Hash{V0: 10846235764839195676, V1: 17124764185649747439, V2: 10628685558750997961, V3: 13297206452120029075},
687+ OutputID: bc.Hash{V0: 5429526025956869574, V1: 12188959875155232503, V2: 14722092106507294798, V3: 27876074648890075},
688688 AssetID: bc.AssetID{V0: 1},
689689 Amount: 2,
690690 ControlProgram: []byte{0x51},
691- SourceID: bc.Hash{V0: 2677144440510642284, V1: 17300012684713233857, V2: 8104296098763882727, V3: 11299124826964505999},
691+ SourceID: bc.Hash{V0: 10187915247323429348, V1: 4770401581694266753, V2: 4182269187154655368, V3: 9030883832705174512},
692692 SourcePos: 0,
693693 },
694694 &account.UTXO{
695- OutputID: bc.Hash{V0: 3381014554514609900, V1: 5680175057309334270, V2: 3343119029029595104, V3: 2354639458888741781},
695+ OutputID: bc.Hash{V0: 18100481287404207387, V1: 3365694797435565990, V2: 8136211093499423216, V3: 12028531817690438568},
696696 AssetID: bc.AssetID{V0: 1},
697697 Amount: 3,
698698 ControlProgram: []byte{0x52},
699- SourceID: bc.Hash{V0: 2677144440510642284, V1: 17300012684713233857, V2: 8104296098763882727, V3: 11299124826964505999},
699+ SourceID: bc.Hash{V0: 10187915247323429348, V1: 4770401581694266753, V2: 4182269187154655368, V3: 9030883832705174512},
700700 SourcePos: 1,
701701 },
702702 &account.UTXO{
703- OutputID: bc.Hash{V0: 2129811970775447483, V1: 5529067197700587525, V2: 17837487178845335220, V3: 1815160195786226238},
703+ OutputID: bc.Hash{V0: 15745816911932387102, V1: 5035893487696724781, V2: 10084725527786878517, V3: 11270352747873435606},
704704 AssetID: *consensus.BTMAssetID,
705705 Amount: 2,
706706 ControlProgram: []byte{0x53},
707- SourceID: bc.Hash{V0: 2677144440510642284, V1: 17300012684713233857, V2: 8104296098763882727, V3: 11299124826964505999},
707+ SourceID: bc.Hash{V0: 10187915247323429348, V1: 4770401581694266753, V2: 4182269187154655368, V3: 9030883832705174512},
708708 SourcePos: 2,
709709 },
710710 &account.UTXO{
711- OutputID: bc.Hash{V0: 8285123326464348167, V1: 11183568691487503969, V2: 2744924970797742540, V3: 7859069673372366746},
711+ OutputID: bc.Hash{V0: 10165799535720725897, V1: 9618876671942765420, V2: 17982649347111502590, V3: 15837286550437859084},
712712 AssetID: *consensus.BTMAssetID,
713713 Amount: 5,
714714 ControlProgram: []byte{0x54},
715- SourceID: bc.Hash{V0: 2677144440510642284, V1: 17300012684713233857, V2: 8104296098763882727, V3: 11299124826964505999},
715+ SourceID: bc.Hash{V0: 10187915247323429348, V1: 4770401581694266753, V2: 4182269187154655368, V3: 9030883832705174512},
716716 SourcePos: 3,
717717 },
718718 },
Show on old repository browser