# Invalid generation signature

**URL:** <https://talk.jelurida.com/t/invalid-generation-signature/523>\
**Category:** Developers\
**Created:** [18 September 2021 07:51 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523 "2021-09-18T07:51:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [18 September 2021 07:51 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/1 "2021-09-18T07:51:49Z")

</div>

![image](https://talk.jelurida.com/uploads/default/original/1X/d1e6cc14b72a067945dcd5d58a6119cf1812e09d.png)  
I deleted the database and restarted the project, and the operation reported an error

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [18 September 2021 15:22 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/2 "2021-09-18T15:22:22Z")

</div>

In the context of adding a new child chain, you probably enabled the new child chain from height 0 and this caused difference in the genesis block generation signature

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [21 September 2021 15:43 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/3 "2021-09-21T15:43:43Z")

</div>

Thank you, how can I solve this problem

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [23 September 2021 09:37 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/4 "2021-09-23T09:37:46Z")

</div>

![d9a0922021c4f787e4aa960543652e5](https://talk.jelurida.com/uploads/default/original/1X/060ec65f48fe766a9ee58241726084e68333a8ae.png)  
look this picture

Did it means i need a public\_key to start up a new childchain( for the genesis blocks)

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [23 September 2021 10:36 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/5 "2021-09-23T10:36:20Z")

</div>

You must not change the PUBLIC\_KEY.json or any other jsons. Just add the 2 JSONs for the balances of your new child chain. You can specify the public keys in the keys of the balance jsons (instead of account IDs). See how it's done for MPG

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 05:05 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/6 "2021-09-24T05:05:21Z")

</div>

for the 2.2.6 code of coal ,there is no public\_key code above

 ![image](https://talk.jelurida.com/uploads/default/original/1X/7bc23b5ed86848838f9642aab8a96f418973913e.jpeg)  
after we init the DUSD childchain , the error comes out .  
if this means the DUSDtestnet.json has some error with the signature?

if we do not init the DUSD childchain ,after delete the database ,it goes well.

the childchain code as below:

```
  public static final ChildChain DUSD = new ChildChainBuilder(7, "DUSD")
        .setTotalAmount(100_000_000_000_000000L)
        .setPermissionPolicy(CHILD_CHAIN)
        .setMasterAdminAccounts(defaultAdminAccounts)
        .setTotalAmount(1_000_000_000_00000000L)
        .setDisabledTransactionTypes(
                ShufflingTransactionType.SHUFFLING_CREATION, DigitalGoodsTransactionType.LISTING,
                MonetarySystemTransactionType.CURRENCY_ISSUANCE, MonetarySystemTransactionType.CURRENCY_DELETION,
                MonetarySystemTransactionType.CURRENCY_MINTING, MonetarySystemTransactionType.CURRENCY_TRANSFER,
                MonetarySystemTransactionType.PUBLISH_EXCHANGE_OFFER, MonetarySystemTransactionType.EXCHANGE_BUY,
                MonetarySystemTransactionType.EXCHANGE_SELL, MonetarySystemTransactionType.RESERVE_INCREASE,
                MonetarySystemTransactionType.RESERVE_CLAIM, TaggedDataTransactionType.TAGGED_DATA_UPLOAD,
                AliasTransactionType.ALIAS_ASSIGNMENT)
        .setDisabledAPITags(APITag.SHUFFLING, APITag.DGS, APITag.MS, APITag.DATA, APITag.ALIASES)
        .setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 145645)
        .build();

```

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 05:21 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/7 "2021-09-24T05:21:59Z")

</div>

![image](https://talk.jelurida.com/uploads/default/original/1X/dea38070f007c76c01b89dbdf0dabfcc73dcaada.png)  
it happened from here,  
delete database means the genesisblock should be added  
the UST is ok, but DUSD which we added will get errors

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [24 September 2021 06:15 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/8 "2021-09-24T06:15:26Z")

</div>

As I said earlier the problem with the generation signature is that you are loading the DUSD chain at height 0. You must enable it after some height in the future. I see you try this

```auto
.setIsEnabled(() -> Nxt.getBlockchain().getHeight() >= 145645)

```

Not sure how it compiles because in Ardor 2.2.6 there is no `setIsEnabled` method. Probably you have some additional changes over 2.2.6? Here is how MPG is enabled there:

```auto
        @Override
        public boolean isEnabled() {
            return Nxt.getBlockchain().getHeight() >= Constants.MPG_BLOCK;
        }

```

Debug why `childChain.isEnabled()` returns `true` in `Genesis.importBalances`

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 06:53 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/9 "2021-09-24T06:53:52Z")

</div>

we use this, but the childchain build not happend(when height is more than 145645)  
.setIsEnabled(() -\> Nxt.getBlockchain().getHeight() \>= 145645)  
but below will happed  
.setIsEnabled(() -\> Nxt.getBlockchain().getHeight() \>= 0)

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 06:55 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/10 "2021-09-24T06:55:44Z")

</div>

we checked about isEnabled() function  
ardor and coal is the same

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 07:09 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/11 "2021-09-24T07:09:15Z")

</div>

private ChildChainBuilder setIsEnabled(BooleanSupplier isEnabled) {  
this.isEnabled = isEnabled;  
return this;  
}

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 08:08 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/12 "2021-09-24T08:08:01Z")

</div>

![image](https://talk.jelurida.com/uploads/default/original/1X/71674207c92616a06156b32003d243ac1fe46890.png)  
Is the source of this generationSignature provided by you?  
Do I need to modify the generationSignature to add a child chain?

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [24 September 2021 08:45 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/13 "2021-09-24T08:45:55Z")

</div>

No, if you change the generation signature you will create a new blockchain which is incompatible with current coalculus

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [24 September 2021 09:38 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/14 "2021-09-24T09:38:59Z")

</div>

as you said we should not modified the signature, can we modifiled not to verify?  
we found the testnet.json only used in the start after we delete database, it will never used after it

 ![image](https://talk.jelurida.com/uploads/default/original/1X/c78734d3ace0bc5ce43581c6a783f4920b344c57.png)

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [24 September 2021 09:44 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/15 "2021-09-24T09:44:17Z")

</div>

No. What you must do is to make sure isEnabled of your new child chain returns false during the genesis apply.

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [24 September 2021 09:48 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/16 "2021-09-24T09:48:17Z")

</div>

More generally: `Genesis.apply` must do exactly the same operations after your changes like before your changes. Check why this is not happening. If it's doing the same operations you will not get "invalid generation signature"

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [26 September 2021 08:17 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/17 "2021-09-26T08:17:59Z")

</div>

we found there is no code for the childchain or hardfork .  
can you give the functions on your ardor code which you suggest will happened when childchain changes to enabled?

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [26 September 2021 11:20 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/18 "2021-09-26T11:20:05Z")

</div>

I don't understand your question

---

<div class="post-metadata">

**Author:** ![petko.petkov](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@petko.petkov](https://talk.jelurida.com/u/petko.petkov)\
**Post date:** [27 September 2021 08:25 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/19 "2021-09-27T08:25:22Z")

</div>

It is not trivial to add another child chain without also upgrading to the latest Ardor version. Upgrading is a complicated task which is better done by us. So the Jelurida management will send a proposal to Coalculus.

---

<div class="post-metadata">

**Author:** ![Tom](https://talk.jelurida.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@Tom](https://talk.jelurida.com/u/Tom)\
**Post date:** [29 September 2021 15:52 UTC](https://talk.jelurida.com/t/invalid-generation-signature/523/20 "2021-09-29T15:52:22Z")

</div>

![image](https://talk.jelurida.com/uploads/default/original/1X/3846e70856a3f2b7012f50ec6f22a5bbc7077f71.png)  
What is fork resolution? Where is it configured?

[Next page](https://talk.jelurida.com/t/invalid-generation-signature/523.md?page=2)
