chain reorganization – How do nodes handle long reorgs?

In a reorg where a node receives blocks for a longer or equal-length chain than the chain they previously followed as longest, what is the process for that node to handle this situation?

I can imagine that in the situation the new chain is clearly longer, the node would have to revert its UTXO set to the point at which the chains diverged, add back mempool transactions that were used since the chains diverged, and then re validate all blocks in the new chain. I can also imagine that some work that was already done in validating transactions could be reused, but not all of it.

How is the UTXO set reverted? Do nodes maintain a history of UTXO set diffs?

In the case where the length of the chains are not significantly different, I can imagine that a node might want to maintain both chains concurrently until it becomes clear one will be longer. Are nodes programmed to do this?

What is the longest reorg a node can handle without revalidating the entire chain from the genesis block?

These questions are primarily about how the software is currently written, rather than about theoretical ways nodes could handle these cases.

nodes – Implementing hidden content parts (as in old “Hidden Content” module)

There is (long unsupported) “Hidden Content” module, allowing to insert content blocks visible by certain roles only, i.e. like below:

(hidden role="Role Name")
   ...content visible to "Role Name" role only
(/hidden)

I browsed through related modules (from “Content Access Control” etc), but see no good match for this module’s capabilities. Are there any simple means to achieve the above without either re-implementing the module for Drupal 9 or using inline PHP?

“Paragraphs Access Control” looks somewhat suitable, but it requires creating quite a complex structure only to restrict access to text blocks.

9 – Book node entity to set child nodes access permissions

I’m working on a simple permissions module for books. This module should make a book with its child nodes private. The toplevel content type is called reader than I have a child content type edition and a child content type of edition is article.

In the content type reader I have a boolean field called Private (field_private). This can be turned on to make the node private.

My module is inspired by the Private Content module, this basically covers what I want. The only thing I need is to also set permissions of the child nodes.

The code I have written so far seems to work. But what I have to do now is save the toplevel reader and than save all child nodes manually. I’m wondering if it is possible to automatically set the permissions of the child nodes when the toplevel reader (parent) node is saved?

My guess is I have to iterate trough the children and change their views access permission. But how?

My code till now:
In my own private_content module I have a private_content.module file.

In this file I have a hook_node_grants function:

function private_content_node_grants(AccountInterface $account, $op){
  $grants = array();

  if ($op == 'view') {
    if (!$account->isAnonymous()) {
      $grants('private_author') = array($account->id());
    }
    if ($account->hasPermission('access private content')) {
      $grants('private_view') = array(PRIVATE_GRANT_ALL);
    }
  }
  return $grants;
}

And I have a hook_node_access_records function:

function private_content_node_access_records(NodeInterface $node){
  $grants = array();

  //check content type
  if ($node->bundle() == 'reader') {
    //if reader
    $book = $node;
  } else if ($node->bundle() == 'edition' || $node->bundle() == 'article') {
    //if edition or article
    //get parent book
    $book = Node::load($node->book('bid'));
  }

  //get private state from book
  $private = $book->field_private->get(0)->value;

  if ($node->status && $private == 1) {
    // Grant read access to users with 'access private content'.
    $grants() = array(
      'realm' => 'private_view',
      'gid' => PRIVATE_GRANT_ALL,
      'grant_view' => 1,
      'grant_update' => 0,
      'grant_delete' => 0,
      'priority' => 0,
    );

    // Grant read access to the owner, but not ANONYMOUS user.
    if (!$node->getOwner()->isAnonymous()) {
      $grants() = array(
        'realm' => 'private_author',
        'gid' => $node->getOwnerId(),
        'grant_view' => 1,
        'grant_update' => 0,
        'grant_delete' => 0,
        'priority' => 0,
      );
    }

    // Otherwise, deny read access for private nodes.
  }

  return $grants;
}

IPs stuck in docker swarm nodes using docker network

I have some issues with a docker network in a docker swarm platform. Right now we are using a docker network to let some APIs do request to each other. The issue we had here is that when resolving the name of the APIs we receive more IPs than replicas of the service and even deleting the service, the “extra IPs” are still there. The only way I could solve it was to reboot all nodes. I would like to know how to prevent this issue so I don’t need to reboot all the nodes for this. It seems something like it is caching old IPs or something similar.

Additional info: The network is an overlay network in a swarm scope. Only the rebooted nodes get the correct ips. So I can have 2 instances of the same service resolving diferent IPs for another service

Thank you for your time, ask for any necessary information for solving this issue

nodes – peer does not offer the expected services

I am working on setting up a node and a normal consumer just to understand how all this works and I have the node up and running and my normal consumer. I see the connection is accepted on both ends but then I get the following message and I am not sure what this is related to and can’t find any documentation. Has anyone run into this before?

peer=0 does not offer the expected services (00000405 offered, 00000009 expected)

networking – IPs stuck in docker swarm nodes using docker network

I have some issues with a docker network in a docker swarm platform.
Right now we are using a docker network to let some APIs do request to each other.
The issue we had here is that when resolving the name of the APIs we receive more IPs than replicas of the service and even deleting the service, the “extra IPs” are still there. The only way I could solve it was to reboot all nodes. I would like to know how to prevent this issue so I don’t need to reboot all the nodes for this. It seems something like it is caching old IPs or something similar.

Additional info:
The network is an overlay network in a swarm scope.
Only the rebooted nodes get the correct ips. So I can have 2 instances of the same service resolving diferent IPs for another service

Thank you for your time, ask for any necessary information for solving this issue

blockchain – In case of private data collections how can the nodes that don’t have complete access to the transactions know about the world state?

Hyperledger Fabric offers the ability to create private data collections, which allow a defined subset of organizations on a channel the ability to endorse, commit, or query private data without having to create a separate channel.
In that case, how can the nodes that don’t have complete access to the transactions know about the world state?
Will the world state differ between the organization that has and doesn’t have the access to the private data?

8 – Advanced Migration – update nodes

I’m a little bit new in Drupal but experienced in PHP.
I would like to migrate data from CSV and assign to existing nodes in DB.

My question is about the possibility to match processing rows with existing data from the database.
I mean, I have CSV file with data and with foreign key called: SERVICE_ACTION and now I would like to assign that data to existing NODE which hasn’t SERVICE_ACTION key but has different KEY which is assigned to another specific entity with Service Action key. How can I get ID of that entity in migration script to assign?

Perhaps, I need target_id to assign newly created paragraph to the specific node. I’m not sure what I’m working bad.

langcode: en
status: true
dependencies:
  enforced:
    module:
      - xxx_migration
      - paragraphs
id: xxx_release_notes
migration_tags:
  - custom-migrate
  - soap-apis
migration_group: xxx_soap_api
label: 'xxx release notes'
source:
  plugin: csv
  data_fetcher_plugin: file
  path: modules/custom/xxx_migration/artifacts/releases_notes.csv
  header_row_count: 1
  keys:
    - id
  column_names:
    -
      id: 'Unique Id'
    -
      title: Title
    -
      body: 'Post body'
    -
      service_action_code: 'Service Action Code'
process:
  type:
    plugin: default_value
    default_value: people
  field_service_action_code:
    plugin: migration_lookup
    migration: xxx_release_notes
    source: service_action_code
destination:
  plugin: 'entity_reference_revisions:paragraph'
  default_bundle: release_note
migration_dependencies:
  required: {  }
optional: {  }

here is my CSV file:

id,title,body,service_action_code
1,TITLE,example body,PassengerDetailsRQ
2,TITLE2,example body2,ePaymentRQ

[cXF] RSS Feeds for Single Nodes | NulledTeam UnderGround

Description:
Add RSS icon on forum list for every single node, on forum view next to forum title and customize them.

*works great with our [cXF] Grid Nodes add-on

Features:

  • Show RSS icon on forum list
  • Show RSS icon only on node hover
  • Show RSS icon next to Node title
  • Show RSS icon on top position
  • Show RSS icon next to board title
  • Show RSS icon on forum view
  • Hide RSS icon on…

.